Following the Orekit Manual installation of the Python wrapper process to the end, all tests succeed when running python -m pytest, except for the TransformTest.py file, with the following stack trace:
E orekit.JavaError: <super: <class 'JavaError'>, >
E Java stacktrace:
E org.orekit.errors.OrekitIllegalStateException: aucune entrée en cache
E at org.orekit.utils.GenericTimeStampedCache.getLatest(GenericTimeStampedCache.java:253)
E at org.orekit.bodies.JPLEphemeridesLoader$EphemerisRawPVProvider.getRawPV(JPLEphemeridesLoader.java:1055)
E at org.orekit.bodies.JPLCelestialBody.getPVCoordinates(JPLCelestialBody.java:113)
E at org.orekit.bodies.JPLCelestialBody$InertiallyOriented$1.getTransform(JPLCelestialBody.java:200)
E at org.orekit.frames.Frame.getTransformTo(Frame.java:263)
TransformTest.py:84: JavaError
My environment:
Conda 4.5.12
Python 3.7
Orekit 10.1
Hipparchus 1.6
Rugged 2.1
Looking into the TransformTest.py file, the date used for the test is 05/04/2019 (date = datetime_to_absolutedate(datetime(2019, 4, 5))), but when looking into the resources.zip archive, into the
resources/naif/DE431-ephemeris-NAIF.txt file, the available date range is around {january 2000..april 2000} (correlation between the failure and the missing data has been suggested by Bryan Cazabonne).
Solution: So, setting the TransformTest.py to the value in the DE431 ephemeris date range (13/03/2000 for instance, (datetime_to_absolutedate(datetime(2000, 3, 13)))) solved the issue and the two tests contained in the TransformTest.py file succeeded.
Olivier.
Designs
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
I do get the same error message if I use the resources.zip instead of orekit-data.zip, but this has to be explicily stated. The default file that setup_orekit_curdir() is using is the orekit-data.zip. The reason there are two files are for legacy reasons, should maybe clean this up at some point to one data file.. The structure of the orekit-data.zip seems different, cannot see the duration of the DE431 table.
Did you manually select the resources.zip instead, curious why this occurred for you? We can however change the date in case there is some mechanism using the resources, the test is as you seen checking the types as we had some issues with that before.
Hello Petrus,
I'm sorry for my post to be so long; I put all the details.
I did not selected manually the 'resources.zip' data providing archive instead of the 'orekit-data.zip' one.
However, when I run only the TransformTest.py (>python -W ignore -u -m pytest -s TransformTest.py, where -W is to ignore warnings and -s is to disable pytest's stdout capture), I have no problem.
But when I run all the tests (>python -W ignore -u -m pytest -s), the TransformTest.py fails.
After this observation, I first instrumented the code (see below) by adding a setup method listing the DataProvidersManager providers and loaded data filenames. It showed a different list between running the whole tests set and only the TransformTest:
First code instrumentation: code
`
ADDED CODE BEGIN
from org.orekit.data import DataProvidersManager
ADDED CODE END
class TransformTest(unittest.TestCase):
ADDED CODE BEGIN
def setUp(self): DM = DataProvidersManager.getInstance() print("Providers in setup: ") for provider in DataProvidersManager.getInstance().getProviders(): print("-" + provider.toString()) print("Loaded data names in setup: ") for name in DataProvidersManager.getInstance().getLoadedDataNames(): print("-" + name)
ADDED CODE END
`
First code instrumentation: running TransformTest only
TransformTest.py Providers in setup:
-org.orekit.data.ZipJarCrawler@1787bc24
Loaded data names in setup:
.Providers in setup:
-org.orekit.data.ZipJarCrawler@1787bc24
Loaded data names in setup:
<class 'org.orekit.utils.TimeStampedPVCoordinates'>
<class 'org.orekit.utils.TimeStampedPVCoordinates'>
.
================================================================ 2 passed in 4.76s ================================================================
E orekit.JavaError: <super: <class 'JavaError'>, >
E Java stacktrace:
E org.orekit.errors.OrekitIllegalStateException: aucune entrée en cache
E at org.orekit.utils.GenericTimeStampedCache.getLatest(GenericTimeStampedCache.java:253)
E at org.orekit.bodies.JPLEphemeridesLoader$EphemerisRawPVProvider.getRawPV(JPLEphemeridesLoader.java:1055)
E at org.orekit.bodies.JPLCelestialBody.getPVCoordinates(JPLCelestialBody.java:113)
E at org.orekit.bodies.JPLCelestialBody$InertiallyOriented$1.getTransform(JPLCelestialBody.java:200)
E at org.orekit.frames.Frame.getTransformTo(Frame.java:263)
TransformTest.py:146: JavaError
========================================================== 1 failed, 33 passed in 30.98s ==========================================================
Second code instrumentation
I then instrumented the TransformTest.py code (see below) and added a setup which still outputs the list of Data Providers and the loaded data filenames contained in the DataProvidersManager singleton, but then clears the providers and show its content again. I also added a tearDown method showing the DataProvidersManager internal state at the end of the tests. The resulting output log shows that resetting the DataProvidersManager state in the test setup method and putting only the orekit-data.zip provider triggers the Orekit data loading mechanism and the TransformTest goes fine, as the orekit-data.zip data seems to cover the requested date range.
Second code instrumentation: code
`
ADDED CODE BEGIN
from org.orekit.data import DataProvidersManager, ZipJarCrawler
from java.io import File
from java.lang import System
ADDED CODE END
class TransformTest(unittest.TestCase):
ADDED CODE BEGIN
def setUp(self): DM = DataProvidersManager.getInstance() print("Providers in setup, before reset: ") for provider in DataProvidersManager.getInstance().getProviders(): print("-" + provider.toString()) print("Loaded data names in setup, before reset: ") for name in DataProvidersManager.getInstance().getLoadedDataNames(): print("-" + name) datafile = File('orekit-data.zip') if not datafile.exists(): print('File :', datafile.absolutePath, ' not found') crawler = ZipJarCrawler(datafile) DM.clearProviders() DM.addProvider(crawler) System.setProperty(DataProvidersManager.OREKIT_DATA_PATH, 'potential/shm-format') print("Providers after setup reset: ") for provider in DataProvidersManager.getInstance().getProviders(): print("-" + provider.toString()) print("Loaded data names after setup reset: ") for name in DataProvidersManager.getInstance().getLoadedDataNames(): print("-" + name) print("Setup done")def tearDown(self): DM = DataProvidersManager.getInstance() print("Providers in tearDown: ") for provider in DataProvidersManager.getInstance().getProviders(): print("-" + provider.toString()) print("Loaded data names in tearDown: ") for name in DataProvidersManager.getInstance().getLoadedDataNames(): print("-" + name)
ADDED CODE END
`
Second code instrumentation: running the TransformTest only
TransformTest.py Providers in setup, before reset:
-org.orekit.data.ZipJarCrawler@1787bc24
Loaded data names in setup, before reset:
Providers after setup reset:
-org.orekit.data.ZipJarCrawler@52e7a6b2
Loaded data names after setup reset:
Setup done
Providers in tearDown:
-org.orekit.data.ZipJarCrawler@52e7a6b2
Loaded data names in tearDown:
.Providers in setup, before reset:
-org.orekit.data.ZipJarCrawler@52e7a6b2
Loaded data names in setup, before reset:
Providers after setup reset:
-org.orekit.data.ZipJarCrawler@1a1f79ce
Loaded data names after setup reset:
Setup done
<class 'org.orekit.utils.TimeStampedPVCoordinates'>
<class 'org.orekit.utils.TimeStampedPVCoordinates'>
Providers in tearDown:
-org.orekit.data.ZipJarCrawler@1a1f79ce
Loaded data names in tearDown:
-/home/olivier/JSatOrb/orekit/build3.7/test/orekit-data.zip!/orekit-data-master/tai-utc.dat
-/home/olivier/JSatOrb/orekit/build3.7/test/orekit-data.zip!/orekit-data-master/DE-430-ephemerides/lnxp1990.430
.
================================================================ 2 passed in 4.32s ================================================================
Second code instrumentation: running all the tests
AbstractDetectorTest.py 52
.
AdditionalEquationsTest.py Setup Finished ok
testInitDSST was successfully finished
.Setup Finished ok
testInitNumerical finished ok
.
AltitudeDetectorTest.py AltitudeDetectorTest successfully run
.
BackAndForthDetectorTest.py .
EventDetectorTest.py 52
.
EventHandlerTest.py .
FieldAdditionalEquationsTest.py Setup Finished ok
testInitNumerical finished ok
.
FieldStopOnDecreasingTest.py ..
GroundFieldOfViewDetectorTest.py .
ImpulseManeuverTest.py .
InterSatDirectViewDetectorTest.py ..
KeplerianConverterTest.py ..
KlobucharModelTest.py Setup Finished ok
.Setup Finished ok
.
NodeDetectorTest.py NodeDetectorTest Successfully run
.
OrekitStepHandlerTest.py .testIsInterpolated OK
.
SmallManeuverAnalyticalModelTest.py ...
SpinStabilizedTest.py testBBQModel finished ok
..
TLEConverterTest.py ......
TransformTest.py Providers in setup, before reset:
-org.orekit.data.ZipJarCrawler@18d9ba1
Loaded data names in setup, before reset:
-/home/olivier/JSatOrb/orekit/build3.7/test/orekit-data.zip!/orekit-data-master/tai-utc.dat
-/home/olivier/JSatOrb/orekit/build3.7/test/orekit-data.zip!/orekit-data-master/itrf-versions.conf
-/home/olivier/JSatOrb/orekit/build3.7/test/orekit-data.zip!/orekit-data-master/Earth-Orientation-Parameters/IAU-2000/finals2000A.all
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/potential/shm-format/eigen_cg03c_coef
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/orbit-determination/february-2016/lnxp2016.430
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/orbit-determination/W3B/lnxp2010.430
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/overlapping-data/data.zip!/unxp1950.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/overlapping-data/data.zip!/unxp2000.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de405-ephemerides/unxp0000.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de405-ephemerides/unxp0001.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de405-ephemerides/unxp0002.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de405-ephemerides/unxp0003.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de406-ephemerides/unxp0000.406
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de431-ephemerides/lnxp0000.431
Providers after setup reset:
-org.orekit.data.ZipJarCrawler@b28d8fc
Loaded data names after setup reset:
-/home/olivier/JSatOrb/orekit/build3.7/test/orekit-data.zip!/orekit-data-master/tai-utc.dat
-/home/olivier/JSatOrb/orekit/build3.7/test/orekit-data.zip!/orekit-data-master/itrf-versions.conf
-/home/olivier/JSatOrb/orekit/build3.7/test/orekit-data.zip!/orekit-data-master/Earth-Orientation-Parameters/IAU-2000/finals2000A.all
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/potential/shm-format/eigen_cg03c_coef
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/orbit-determination/february-2016/lnxp2016.430
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/orbit-determination/W3B/lnxp2010.430
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/overlapping-data/data.zip!/unxp1950.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/overlapping-data/data.zip!/unxp2000.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de405-ephemerides/unxp0000.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de405-ephemerides/unxp0001.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de405-ephemerides/unxp0002.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de405-ephemerides/unxp0003.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de406-ephemerides/unxp0000.406
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de431-ephemerides/lnxp0000.431
Setup done
Providers in tearDown:
-org.orekit.data.ZipJarCrawler@b28d8fc
Loaded data names in tearDown:
-/home/olivier/JSatOrb/orekit/build3.7/test/orekit-data.zip!/orekit-data-master/tai-utc.dat
-/home/olivier/JSatOrb/orekit/build3.7/test/orekit-data.zip!/orekit-data-master/itrf-versions.conf
-/home/olivier/JSatOrb/orekit/build3.7/test/orekit-data.zip!/orekit-data-master/Earth-Orientation-Parameters/IAU-2000/finals2000A.all
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/potential/shm-format/eigen_cg03c_coef
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/orbit-determination/february-2016/lnxp2016.430
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/orbit-determination/W3B/lnxp2010.430
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/overlapping-data/data.zip!/unxp1950.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/overlapping-data/data.zip!/unxp2000.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de405-ephemerides/unxp0000.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de405-ephemerides/unxp0001.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de405-ephemerides/unxp0002.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de405-ephemerides/unxp0003.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de406-ephemerides/unxp0000.406
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de431-ephemerides/lnxp0000.431
.Providers in setup, before reset:
-org.orekit.data.ZipJarCrawler@b28d8fc
Loaded data names in setup, before reset:
-/home/olivier/JSatOrb/orekit/build3.7/test/orekit-data.zip!/orekit-data-master/tai-utc.dat
-/home/olivier/JSatOrb/orekit/build3.7/test/orekit-data.zip!/orekit-data-master/itrf-versions.conf
-/home/olivier/JSatOrb/orekit/build3.7/test/orekit-data.zip!/orekit-data-master/Earth-Orientation-Parameters/IAU-2000/finals2000A.all
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/potential/shm-format/eigen_cg03c_coef
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/orbit-determination/february-2016/lnxp2016.430
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/orbit-determination/W3B/lnxp2010.430
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/overlapping-data/data.zip!/unxp1950.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/overlapping-data/data.zip!/unxp2000.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de405-ephemerides/unxp0000.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de405-ephemerides/unxp0001.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de405-ephemerides/unxp0002.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de405-ephemerides/unxp0003.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de406-ephemerides/unxp0000.406
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de431-ephemerides/lnxp0000.431
Providers after setup reset:
-org.orekit.data.ZipJarCrawler@3709549a
Loaded data names after setup reset:
-/home/olivier/JSatOrb/orekit/build3.7/test/orekit-data.zip!/orekit-data-master/tai-utc.dat
-/home/olivier/JSatOrb/orekit/build3.7/test/orekit-data.zip!/orekit-data-master/itrf-versions.conf
-/home/olivier/JSatOrb/orekit/build3.7/test/orekit-data.zip!/orekit-data-master/Earth-Orientation-Parameters/IAU-2000/finals2000A.all
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/potential/shm-format/eigen_cg03c_coef
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/orbit-determination/february-2016/lnxp2016.430
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/orbit-determination/W3B/lnxp2010.430
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/overlapping-data/data.zip!/unxp1950.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/overlapping-data/data.zip!/unxp2000.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de405-ephemerides/unxp0000.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de405-ephemerides/unxp0001.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de405-ephemerides/unxp0002.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de405-ephemerides/unxp0003.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de406-ephemerides/unxp0000.406
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de431-ephemerides/lnxp0000.431
Setup done
<class 'org.orekit.utils.TimeStampedPVCoordinates'>
<class 'org.orekit.utils.TimeStampedPVCoordinates'>
Providers in tearDown:
-org.orekit.data.ZipJarCrawler@3709549a
Loaded data names in tearDown:
-/home/olivier/JSatOrb/orekit/build3.7/test/orekit-data.zip!/orekit-data-master/tai-utc.dat
-/home/olivier/JSatOrb/orekit/build3.7/test/orekit-data.zip!/orekit-data-master/itrf-versions.conf
-/home/olivier/JSatOrb/orekit/build3.7/test/orekit-data.zip!/orekit-data-master/Earth-Orientation-Parameters/IAU-2000/finals2000A.all
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/potential/shm-format/eigen_cg03c_coef
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/orbit-determination/february-2016/lnxp2016.430
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/orbit-determination/W3B/lnxp2010.430
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/overlapping-data/data.zip!/unxp1950.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/overlapping-data/data.zip!/unxp2000.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de405-ephemerides/unxp0000.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de405-ephemerides/unxp0001.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de405-ephemerides/unxp0002.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de405-ephemerides/unxp0003.405
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de406-ephemerides/unxp0000.406
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/regular-data/de431-ephemerides/lnxp0000.431
-/home/olivier/JSatOrb/orekit/build3.7/test/orekit-data.zip!/orekit-data-master/DE-430-ephemerides/lnxp1990.430
.
=============================================================== 34 passed in 29.02s ===============================================================
Conclusion
So, resetting the DataProvidersManager internal state so that it only has the orekit-data archive as a data provider seems to resolve the issue.
Furthermore, given all that (huge, sorry again) information, my hypothesis is that, when the DataProvidersManager is requested about solar system planets ephemeris data, it looks first in its loaded data files, and if it finds some corresponding data type, it looks further into it. But if this data doesn't matches the date range requested, the DataProvidersManager raises an error without looking in the other Data Providers, even if they potentially contain the same data type, with, this time, the corresponding requested time range. I think it may explain the behaviour change and the ensuing failure, but this has to be investigated further.
Maybe the DataProvidersManager data looking algorithm strategy can be improved to cover this situation (which seems to be avoidable if the user gives only the orekit-data archive as the only one data provider).
I am highly confused. Good debugging printouts. But how does it find the resouces.zip at all? These should be closed down between tests I would think. But obviously something is going on.
Will check more later.
I ran one of these tests right before the unmodified TransformTest (except for the DataProvidersManager internal state printouts) and obtained the log below:
AdditionalEquationsTest.py Setup Finished ok
testInitDSST was successfully finished
.Setup Finished ok
testInitNumerical finished ok
.
TransformTest.py Providers in setup, before reset:
-org.orekit.data.ZipJarCrawler@539d019
Loaded data names in setup, before reset:
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/potential/shm-format/eigen_cg03c_coef
.Providers in setup, before reset:
-org.orekit.data.ZipJarCrawler@539d019
Loaded data names in setup, before reset:
-/home/olivier/JSatOrb/orekit/build3.7/test/resources.zip!/resources/potential/shm-format/eigen_cg03c_coef
<class 'org.orekit.utils.TimeStampedPVCoordinates'>
F
.> transform = eme2000.getTransformTo(icrf, date)
E orekit.JavaError: <super: <class 'JavaError'>, >
E Java stacktrace:
E org.orekit.errors.OrekitIllegalStateException: aucune entrée en cache
E at org.orekit.utils.GenericTimeStampedCache.getLatest(GenericTimeStampedCache.java:253)
E at org.orekit.bodies.JPLEphemeridesLoader$EphemerisRawPVProvider.getRawPV(JPLEphemeridesLoader.java:1055)
E at org.orekit.bodies.JPLCelestialBody.getPVCoordinates(JPLCelestialBody.java:113)
E at org.orekit.bodies.JPLCelestialBody$InertiallyOriented$1.getTransform(JPLCelestialBody.java:200)
E at org.orekit.frames.Frame.getTransformTo(Frame.java:263)
TransformTest.py:129: JavaError
=========================================================== 1 failed, 3 passed in 4.20s ===========================================================`
It seems that the DataProvidersManager should be "resetted" in the setup method of each class.
Tests addition:
I ran every other test using the resource.zip data archive with and just before the TransformTest and obtained every time the same error.
List of tests ran individually just before the TransformTest.
Command is: python -W ignore -u -m pytest -s [TEST].py TransformTest.py, with [TEST] in
AdditionalEquationsTest.py
OrekitStepHandlerTest.py
FieldAdditionalEquationsTest.py
TLEConverterTest.py
SpinStabilizedTest.py
KlobucharModelTest.py
I then added the DataProvidersManager state reset snippet (see below) and ran the exact same tests, and it succeeded everytime.
DataProvidersManager reset code snippet:
` datafile = File("orekit-data.zip")
if not datafile.exists():
print("File :", datafile.absolutePath, " not found")
Interesting. The Java tests using a Util.setDataRoot and that does indeed start by cleaning a lot of stuff including the clearProviders.
I am suprised however that there is somehow a "leak" between the different pytest tests, in my mind these should be separate VM's which should be dependent.
We should add the clearProvides() to the setup_orekit_curdir but need to understand a bit how this problem could occur at all.
I'm jumping in the discussion even if I don't have the solution of your problem (sorry).
I just wanted to add a few points:
We do have the same problem with the JUnit tests in Java, in some cases. That's why the Utils class in tests have the clearFactory-like methods.
Resetting the provider is not enough since loaded data are not cleared in the process.
@evanward1 designed a new way of handling the data context in Orekit. Hopefully it could help you here containerize loaded data for each test. But again I don't have a ready-to-use solution to give you;
In that perspective, I think the following line in pyhelpers.py#setup_orekit_curdir:
Just like what is done in the Data/Context tutorial.
It is a very small change, I admit, but I think the use of DataProvidersManager.getInstance() will be deprecated at some point, so it may be worth it;
While we are at it I've been said by @luc that using a zip archive is under-performant. So maybe we should leave the possibility for a user to input a directory instead of a zip/jar archive in setup_orekit_curdir; and use a DirectoryCrawler in that case instead of the ZipJarCrawler ?
While we are at it I've been said by @luc that using a zip archive is under-performant. So maybe we should leave the possibility for a user to input a directory instead of a zip/jar archive in setup_orekit_curdir; and use a DirectoryCrawler in that case instead of the ZipJarCrawler ?
FYI, this feature was merged in !3 (merged). It is indeed much more performant, it reduced the startup time of PycturePlanner (a Python + Orekit GUI that I presented briefly during the last Orekit day) by a few seconds.
FYI, this feature was merged in !3 (merged). It is indeed much more performant, it reduced the startup time of PycturePlanner (a Python + Orekit GUI that I presented briefly during the last Orekit day) by a few seconds.
Yes. Thank you Clément for this merge request.
I've followed from a distance your discussions with Petrus and knew this was done.
I'm happy to hear that it improves the performances of your tool.