From e13d6e64961c33ff95b31ad5e78f3ecb727da37a Mon Sep 17 00:00:00 2001
From: petrush <petrus.hyvonen@sscspace.com>
Date: Wed, 3 Apr 2019 12:26:28 +0200
Subject: [PATCH] Updates for v 9.3.1

---
 orekit-conda-recipe/bld.bat                   |  2 +-
 orekit-conda-recipe/build.sh                  |  2 +-
 orekit-conda-recipe/meta.yaml                 |  8 +++---
 orekit-conda-recipe/run_test.bat              |  6 ++++-
 orekit-conda-recipe/run_test.sh               | 11 ++++++--
 python_files/pyhelpers.py                     | 26 +++++++++++++------
 .../test/InterSatDirectViewDetectorTest.py    |  4 +--
 7 files changed, 40 insertions(+), 19 deletions(-)

diff --git a/orekit-conda-recipe/bld.bat b/orekit-conda-recipe/bld.bat
index 0ddb996..dfc525e 100644
--- a/orekit-conda-recipe/bld.bat
+++ b/orekit-conda-recipe/bld.bat
@@ -10,7 +10,7 @@
 --use_full_names ^
 --python orekit ^
 --version %PKG_VERSION% ^
---jar %SRC_DIR%\orekit-9.3.jar ^
+--jar %SRC_DIR%\orekit-9.3.1.jar ^
 --jar %SRC_DIR%\hipparchus-core-1.4.jar ^
 --jar %SRC_DIR%\hipparchus-filtering-1.4.jar ^
 --jar %SRC_DIR%\hipparchus-fitting-1.4.jar ^
diff --git a/orekit-conda-recipe/build.sh b/orekit-conda-recipe/build.sh
index aa31c1d..5b53424 100644
--- a/orekit-conda-recipe/build.sh
+++ b/orekit-conda-recipe/build.sh
@@ -4,7 +4,7 @@ $PYTHON -m jcc \
 --use_full_names \
 --python orekit \
 --version ${PKG_VERSION} \
---jar $SRC_DIR/orekit-9.3.jar \
+--jar $SRC_DIR/orekit-9.3.1.jar \
 --jar $SRC_DIR/hipparchus-core-1.4.jar \
 --jar $SRC_DIR/hipparchus-filtering-1.4.jar \
 --jar $SRC_DIR/hipparchus-fitting-1.4.jar \
diff --git a/orekit-conda-recipe/meta.yaml b/orekit-conda-recipe/meta.yaml
index d2d5374..fe622d7 100644
--- a/orekit-conda-recipe/meta.yaml
+++ b/orekit-conda-recipe/meta.yaml
@@ -1,7 +1,7 @@
 {% set name = "orekit" %}
-{% set version = "9.3" %}
-{% set filename = "v9_3_2" %}
-{% set sha256 = "c369e544442a32d39fc12cf5de569b4d5afd29174a73b8cd0c006c07dbe916d8" %}
+{% set version = "9.3.1" %}
+{% set filename = "v9_3_1_0" %}
+{% set sha256 = "8b6b84599542927a419261667ad0374c82b4d92daded52483fc9ce658af82217" %}
 
 package:
   name: {{ name|lower }}
@@ -13,7 +13,7 @@ source:
   sha256: {{ sha256 }}
 
 build:
-  number: 2
+  number: 0
 
   rpaths:
     - lib/
diff --git a/orekit-conda-recipe/run_test.bat b/orekit-conda-recipe/run_test.bat
index ed3e312..b49419d 100644
--- a/orekit-conda-recipe/run_test.bat
+++ b/orekit-conda-recipe/run_test.bat
@@ -1,2 +1,6 @@
 cd test
-for %%f in (*.py) do python "%%f" || exit /b 1
+for %%f in (*.py) do (
+    python "%%f"
+    if errorlevel 1 exit 1
+)
+
diff --git a/orekit-conda-recipe/run_test.sh b/orekit-conda-recipe/run_test.sh
index 06f212b..1bb0de0 100644
--- a/orekit-conda-recipe/run_test.sh
+++ b/orekit-conda-recipe/run_test.sh
@@ -1,5 +1,12 @@
 #!/usr/bin/env bash
 cd test
-set -e
-for f in *.py; do python "$f"; done || exit 1
 
+for f in *.py; do
+    if python "$f"; then
+        echo "Test reported ok"
+    else
+        echo "Trying to Fail!"
+        exit 1
+    fi
+done
+exit 0
diff --git a/python_files/pyhelpers.py b/python_files/pyhelpers.py
index 3df7e8e..155dab0 100644
--- a/python_files/pyhelpers.py
+++ b/python_files/pyhelpers.py
@@ -60,8 +60,8 @@ def setup_orekit_curdir(filename='orekit-data.zip'):
 
 
 def absolutedate_to_datetime(orekit_absolutedate):
-    """ Converts between orekit.AbsoluteDate objects
-    and python datetime objects (utc)"""
+    """ Converts from orekit.AbsoluteDate objects
+    to python datetime objects (utc)"""
 
     utc = TimeScalesFactory.getUTC()
     or_comp = orekit_absolutedate.getComponents(utc)
@@ -76,9 +76,10 @@ def absolutedate_to_datetime(orekit_absolutedate):
                     int(math.floor(seconds)),
                     int(1000000.0 * (seconds - math.floor(seconds))))
 
+
 def datetime_to_absolutedate(dt_date):
-    """ Converts between orekit.AbsoluteDate objects
-    and python datetime objects (utc)
+    """ Converts from python datetime objects (utc)
+    to orekit.AbsoluteDate objects.
 
     Args:
         dt_date (datetime): python datetime object to convert
@@ -97,12 +98,12 @@ def datetime_to_absolutedate(dt_date):
 
 
 def to_elevationmask(az, el):
-    ''' Converts an array of azimuths and elevations to a
+    """ Converts an array of azimuths and elevations to a
     orekit ElevationMask object. All unts in degrees.
 
         mask = to_elevationmask([0, 90, 180, 270], [5,10,8,5])
 
-    '''
+    """
 
     mask = JArray('object')(len(az))
 
@@ -112,12 +113,21 @@ def to_elevationmask(az, el):
 
     return ElevationMask(mask)
 
+
 def JArray_double2D(x, y):
-    '''Returns an JCC wrapped 2D double array'''
+    """Returns an JCC wrapped 2D double array
+
+    Args:
+        x: Number of rows in the array
+        y: Number of columns in the array
+
+    Note that the rows and columns are returned as objects and
+    are likely needed to be casted manually.
+    """
 
     arr = JArray('object')(x)
 
     for i in range(x):
         arr[i] = JArray('double')(y)
 
-    return arr
\ No newline at end of file
+    return arr
diff --git a/python_files/test/InterSatDirectViewDetectorTest.py b/python_files/test/InterSatDirectViewDetectorTest.py
index fc100d1..e28a810 100644
--- a/python_files/test/InterSatDirectViewDetectorTest.py
+++ b/python_files/test/InterSatDirectViewDetectorTest.py
@@ -76,7 +76,7 @@ class GrazingHandler(PythonEventHandler):
 
         testvalue = FastMath.abs(FastMath.toDegrees(topo.getAzimuth(pSlave, frame, grazingDate) -
                                                     topo.getAzimuth(pMaster, frame, grazingDate)))
-        assert -6.0e-14 < testvalue - 180.0 < 6.0e-15
+        assert -6.0e-14 < testvalue - 180.0 < 6.0e-14
 
         return EventHandler.Action.CONTINUE
 
@@ -142,7 +142,7 @@ class InterSatDirectViewDetectorTest(unittest.TestCase):
                            FastMath.toRadians(56.0), FastMath.toRadians(111.0),
                            o1.getAlphaM() + 2.2e-6, PositionAngle.MEAN, o1.getFrame(),
                            o1.getDate(),
-                           Constants.EIGEN5C_EARTH_MU);
+                           Constants.EIGEN5C_EARTH_MU)
 
         # LEO as master, MEO as slave
         pA = KeplerianPropagator(o1)
-- 
GitLab