Make some serializers optionals
kripnerl opened this issue · 7 comments
Reasoning
OMAS should be (IMHO) a lightweight tool for; however, some of its dependencies make it bulky and have complicated dependencies.
Problem
I speak specifically about mojo-core
. We have already encountered a second issue with that library. First was an obsolete dependency on urllib (which is fixed in the newer version) and second is now Windows poetry installations:
Installing botocore (1.31.33): Failed
FileNotFoundError
[Errno 2] No such file or directory: 'C:\\Users\\jh\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\\LocalCache\\Local\\pypoetry\\Cache\\virtualenvs\\cug-vessel-model-WXhTS8yu-py3.11\\Lib\\site-packages\\botocore\\data\\kinesis-video-archived-media\\2017-09-30\\endpoint-rule-set-1.json.gz'
at C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\pathlib.py:1044 in open
1040│ the built-in open() function does.
1041│ """
1042│ if "b" not in mode:
1043│ encoding = io.text_encoding(encoding)
→ 1044│ return io.open(self, mode, buffering, encoding, errors, newline)
1045│
1046│ def read_bytes(self):
1047│ """
1048│ Open the file in bytes mode, read it, and close the file.
Proposed solution
Add specialized backend as optional dependencies in setup.py
:
...
install_requires = [
'numpy>=1.16.1',
'uncertainties',
'pint',
'netCDF4',
'matplotlib', # In principle, plotting could be also optional since some deployments do not require any plotting.
'scipy',
'h5py',
'dnspython', # Not sure about this one - it is not used in the code, or I missed it.
'xarray',
'setuptools>=41.2',
'Cython',
]
extras_require = {
'machine': [
'omfit_classes',
'pexpect',
'fortranformat',
'pygacode',
],
'hdc': ['pyhdc'],
'imas': ['imas'],
'uda': ['pyuda'],
'mongo': ['pymongo'],
'aws': ['boto3'],
'build_structures': ['bs4', 'xmltodict', 'tqdm'], # xmltodict is used only in `omas_structures` and `tqdm` only when fetching data and the code more over is checking on the existence of the `tqdm`.
'build_documentation': ['Sphinx', 'sphinx-bootstrap-theme', 'sphinx-gallery', 'Pillow'],
}
...
If you agree, I will be very happy to open a pull request.
I am not sure how much the MongoDB interface is used. I suspect zero. If so, I'd be inclined to actually remove all that part of the source... others can comment
Hah. I was just recently thinking that it would be cool to test the MongoDB :-D. However, I assume this will remain only with dreams since the day is only 24 hours long ... So no. We are nor using nor (actively) planning using this.
Ok, well, perhaps we can start by making it an optional dependency as you suggested. Who knows that someday you'll find the time :P
Other comments for the PR:
dnspython
can probably go, I honestly forgot why it got there- instead of
aws
can we uses3
?
Stale issue message
On hold, to be resolved soon.
Stale issue message