Skip to content
Snippets Groups Projects
Commit 9d065e54 authored by Petrus Hyvönen's avatar Petrus Hyvönen
Browse files

Make numpy non-mandatory

parent 12b7fbd6
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@ It is assumed that the JVM is running.
Importing this file will automatically implement the changes.
"""
import numpy as np
import datetime, math
import orekit_jpype
......@@ -60,21 +60,26 @@ class _JAbsoluteDate(object):
int(math.floor(seconds)),
int(1000000.0 * (seconds - math.floor(seconds))))
try:
import numpy as np
@JImplementationFor("double[][]")
class _JDouble2DArray(object):
@JImplementationFor("double[][]")
class _JDouble2DArray(object):
def to_numpy(self) -> np.ndarray:
"""
Get the Java Double 2D Array as a Python numpy array
def to_numpy(self) -> np.ndarray:
"""
Get the Java Double 2D Array as a Python numpy array
Returns: the Double Array as numpy 2D array
Returns: the Double Array as numpy 2D array
"""
return np.array(self)
"""
return np.array(self)
def __repr__(self):
return f"<{self.getClass().getSimpleName()}: {np.array(self).__str__()}>"
def __repr__(self):
return f"<{self.getClass().getSimpleName()}: {np.array(self).__str__()}>"
except ImportError:
pass
# @JImplementationFor("double[]")
# class _JDoubleArray(object):
......
......@@ -25,8 +25,7 @@ classifiers = [
]
dependencies = [
'jpype1',
'numpy'
'Jpype1'
]
[project.urls]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment