markovmodel / PyEMMA

🚂 Python API for Emma's Markov Model Algorithms 🚂
http://pyemma.org
GNU Lesser General Public License v3.0
311 stars 119 forks source link

Check blosc script runs now. #1477

Closed RobertArbon closed 3 years ago

RobertArbon commented 3 years ago

the h5py.File context requires a mode flag - I inserted a 'w' for write.

I added to the change log

Before change:

>>> python -m unittest pyemma/_base/serialization/tests/test_serialization.py
...
  File "/Users/robertarbon/Software/myPyEMMA/pyemma/_base/serialization/pickle_extensions.py", line 68, in <module>
    _DEFAULT_BLOSC_OPTIONS = _check_blosc_avail()
  File "/Users/robertarbon/Software/myPyEMMA/pyemma/_base/serialization/pickle_extensions.py", line 46, in _check_blosc_avail
    with h5py.File(name) as h5f:
  File "/Users/robertarbon/opt/miniconda3/envs/pyemma/lib/python3.7/site-packages/h5py/_hl/files.py", line 427, in __init__
    swmr=swmr)
  File "/Users/robertarbon/opt/miniconda3/envs/pyemma/lib/python3.7/site-packages/h5py/_hl/files.py", line 190, in make_fid
    fid = h5f.open(name, flags, fapl=fapl)
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "h5py/h5f.pyx", line 96, in h5py.h5f.open
OSError: Unable to open file (file signature not found)

After change:

>>> python -m unittest pyemma/_base/serialization/tests/test_serialization.py
....
/Users/robertarbon/Software/myPyEMMA/pyemma/_base/serialization/pickle_extensions.py:52: UserWarning: BLOSC compression filter unavailable. Your resulting file may be large and not optimal to process.
  warnings.warn('BLOSC compression filter unavailable. '
....../Users/robertarbon/Software/myPyEMMA/pyemma/_base/serialization/tests/test_serialization.py:103: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray
  x = np.array([None, np.array([1, 2, 3]), False])
..28-11-20 20:01:21 pyemma._base.serialization.serialization ERROR    Tried to restore a model created with a more recent version of PyEMMA. This is not supported! You need at least version 2.5.7+54.g0ff6a143
.......
----------------------------------------------------------------------
Ran 15 tests in 0.277s

OK
clonker commented 3 years ago

Hi there, thank you very much for your contribution :) This is indeed a bug and seems related to issue #1476 . However there are also very fundamental changes to the pyemma architecture in here plus ND clustering - was this intended?

I went ahead and cherry picked your last two commits into PR #1479 for that matter because there was another issue with the CI configuration.

Cheers!

RobertArbon commented 3 years ago

Hi - no, that wasn't intended! I think I must have merged in a copy that I was working on for a separate project. Sorry about that!

clonker commented 3 years ago

No problem, thanks!