lyncs-api / lyncs.io Goto Github PK
View Code? Open in Web Editor NEWI/O functions for common Python and LQCD file formats
License: BSD 3-Clause "New" or "Revised" License
I/O functions for common Python and LQCD file formats
License: BSD 3-Clause "New" or "Revised" License
Fully read the archive returning nested dictionaries and arrays
data = load("foo.h5", all=True)
When trying to save txt files in a tar:
File "<array_function internals>", line 4, in savetxt
TypeError: _savetxt_dispatcher() got an unexpected keyword argument 'comm'
Describe the bug
A clear and concise description of what the bug is.
import lyncs_io
in python 3.8+ yields the error
AttributeError: module 'importlib' has no attribute 'util'
Editing the problem file (
lyncs_utils/extensions.py
) such thatimportlib.utils
is imported instead fixes this problem.
To Reproduce
If applicable, list the steps to reproduce the behavior:
This can be reproduced by simply importing
lyncs_io
using a fresh environment in python 3.8.
Error message / Output
If applicable, paste here the error messages / output you get.
Error(s) listed below:
Traceback (most recent call last):
File "/home/ben/anaconda3/envs/gluprop_test/lib/python3.8/site-packages/lyncs_utils/extensions.py", line 52, in lazy_import
return sys.modules[name]
KeyError: 'numpy'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "lyncs_test.py", line 1, in <module>
import lyncs_io as io
File "/home/ben/anaconda3/envs/gluprop_test/lib/python3.8/site-packages/lyncs_io/__init__.py", line 5, in <module>
from .base import *
File "/home/ben/anaconda3/envs/gluprop_test/lib/python3.8/site-packages/lyncs_io/base.py", line 13, in <module>
from .formats import formats
File "/home/ben/anaconda3/envs/gluprop_test/lib/python3.8/site-packages/lyncs_io/formats.py", line 10, in <module>
from lyncs_utils import open_file
File "/home/ben/anaconda3/envs/gluprop_test/lib/python3.8/site-packages/lyncs_utils/__init__.py", line 5, in <module>
from .math import *
File "/home/ben/anaconda3/envs/gluprop_test/lib/python3.8/site-packages/lyncs_utils/math.py", line 17, in <module>
from .numpy import numpy
File "/home/ben/anaconda3/envs/gluprop_test/lib/python3.8/site-packages/lyncs_utils/numpy.py", line 16, in <module>
numpy = lazy_import("numpy")
File "/home/ben/anaconda3/envs/gluprop_test/lib/python3.8/site-packages/lyncs_utils/extensions.py", line 54, in lazy_import
spec = importlib.util.find_spec(name)
AttributeError: module 'importlib' has no attribute 'util'
Installed versions
Paste here the output of lyncs_packages -v
.
Versions listed below:
cppyy==2.4.1
dataclasses==0.6
deprecated==1.2.13
filelock==3.9.0
gitpython==3.1.30
lyncs-cppyy==0.2.0
lyncs-io==0.2.3
lyncs-setuptools==0.3.1
lyncs-utils==0.4.4
numpy==1.24.1
packaging==23.0
pip==22.3.1
xmltodict==0.13.0
Would be nice to add a loop over various dtype
s to all tests and a random array generator for any of these dtype
s
I have disabled them in PR #25
Installing lyncs_io from within another project's setup.py
and then trying to load it fails with the following error:
ModuleNotFoundError: No module named 'filelock'
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-bb871a6d281e> in <module>
----> 1 from ML_Optimus.data.generate_raw import gen_from_poisson
2 from ML_Optimus.data.conversions import dict_to_mat
3 import lyncs_io as io
~/tmp/ML-Optimus/ML_Optimus/__init__.py in <module>
5 __version__ = "0.0.1"
6
----> 7 from .data import *
8 from .features import *
9 from .model import *
~/tmp/ML-Optimus/ML_Optimus/data/generate_raw.py in <module>
8
9 import numpy as np
---> 10 import lyncs_io as io
11 import scipy
12
~/miniconda3/envs/test_lyncs/lib/python3.8/site-packages/lyncs_io/__init__.py in <module>
3 __version__ = "0.1.0"
4
----> 5 from .base import *
~/miniconda3/envs/test_lyncs/lib/python3.8/site-packages/lyncs_io/base.py in <module>
11 ]
12
---> 13 from .formats import formats
14 from .utils import find_file
15
~/miniconda3/envs/test_lyncs/lib/python3.8/site-packages/lyncs_io/formats.py in <module>
10 from lyncs_utils import open_file
11 from .format import Formats
---> 12 from . import numpy, lime
13
14 formats = Formats()
~/miniconda3/envs/test_lyncs/lib/python3.8/site-packages/lyncs_io/numpy.py in <module>
30 from .utils import swap, is_dask_array
31 from .mpi_io import MpiIO, check_comm
---> 32 from .dask_io import DaskIO
33
34 loadtxt = numpy.loadtxt
~/miniconda3/envs/test_lyncs/lib/python3.8/site-packages/lyncs_io/dask_io.py in <module>
6 import numpy
7
----> 8 from filelock import FileLock, Timeout
9 from lyncs_utils import read, write
10 from .convert import from_array
ModuleNotFoundError: No module named 'filelock'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.