Hey, folks!
I am doing a lot of algorithms, with submodules, in order to have it better structured.
I am using orekit_jpype, however I stumbled in an error with PythonOrekitFixedHandler.
All imports work correctly, I have my orekit-data.zip assigned in my codes and functions. I am using a venv where I installed orekit_jpype.
When I try to run, I get this error
File "/home/rodrigo.santos/Documents/git/python-workspace/projects/matool/src/decay/common.py", line 3, in <module>
from org.orekit.propagation.sampling import PythonOrekitFixedStepHandler
File "/home/rodrigo.santos/miniconda3/lib/python3.12/site-packages/jpype/imports.py", line 203, in find_spec
raise ImportError("Failed to import '%s'" % name) from ex
ImportError: Failed to import 'org.orekit.propagation.sampling.PythonOrekitFixedStepHandler'
Does anybody know whether that a bad import from my side or it’d a bug?
I tested by changing the import library from orekit_jpype
to orekit
in another env, and it imported without any issues.
Hi @rodreras ,
Yes the PythonOrekitFixedStep handler is only in the “orekit” (JCC version) of the wrapper and only needed when subclassing. As subclassing is not possible, and only implementation of interfaces in orekit_jpype there is no need of these special Python-classes. If you are starting new on a project I would recommend to go with the orekit_jpype version, it is closer to the java version.
1 Like
That worked like a charm.
@petrus.hyvonen I am facing a similar issue, now with Rugged.
In Orekit wrapped, I’d import like this: from org.orekit.rugged.raster import PythonTileUpdater
I thought that, since orekit_jpype is close to the Java version, importing TileUpdater instead of PythonTileUpdater would be enough. However, I got an error saying
class DEMTileUpdater(TileUpdater): TypeError: Java classes cannot be extended in Python
Could it be that in orekit_jpype the import is different? Both PythonTileUpdater and TileUpdater won’t work. So far, I could not find any related post.