Skip to content

Commit

Permalink
BUG: Allow the ARMC.hdf5 file to store PEP 440 compliant versions
Browse files Browse the repository at this point in the history
  • Loading branch information
BvB93 committed May 9, 2023
1 parent 0caad14 commit 2438469
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
pip install git+https://github.com/SCM-NV/PLAMS@master --upgrade
pip install git+https://github.com/NLeSC/noodles@master --upgrade
elif [[ $SPECIAL"${{ matrix.special }}" == '; minimum version' ]]; then
pip install Nano-Utils==1.2.1 schema==0.7.1 AssertionLib==2.2 noodles==0.3.3 pyyaml==5.1 numpy==1.17 h5py==2.10 pandas==0.24 scipy==1.2.0
pip install Nano-Utils==1.2.1 schema==0.7.1 AssertionLib==2.2 noodles==0.3.3 pyyaml==5.1 numpy==1.17 h5py==2.10 pandas==0.24 scipy==1.2.0 packaging==17.1
pip install -e .[test_no_optional]
else
pip install -e .[test_no_optional]
Expand Down
5 changes: 3 additions & 2 deletions FOX/io/hdf5_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import pandas as pd
from scm.plams import Settings
from nanoutils import PathType, group_by_values, recursive_keys
from packaging.version import Version

from .. import __file__ as _fox_file
from ..__version__ import __version__
Expand Down Expand Up @@ -103,7 +104,7 @@ def create_hdf5(filename: PathType, armc: ARMC) -> None:

f.attrs['super-iteration'] = -1
f.attrs['sub-iteration'] = -1
f.attrs['__version__'] = np.fromiter(__version__.split('.'), count=3, dtype=int)
f.attrs['__version__'] = np.fromiter(Version(__version__).release, dtype=np.int64)

commit_hash = get_commit_hash(Path(_fox_file).parents[1])
f.attrs['commit_hash'] = commit_hash if commit_hash is not None else ""
Expand Down Expand Up @@ -180,7 +181,7 @@ def create_xyz_hdf5(filename: PathType,

# Create a new hdf5 xyz files
with h5py.File(filename_xyz, 'w-', libver='latest') as f:
f.attrs['__version__'] = np.fromiter(__version__.split('.'), count=3, dtype=int)
f.attrs['__version__'] = np.fromiter(Version(__version__).release, dtype=np.int64)

iterator = (mol for mol in mol_list for _ in phi)
for i, mol in enumerate(iterator):
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
'h5py>=2.10',
'qmflows>=0.12.0',
'plams>=1.5.1',
'packaging>=17.1',
],
tests_require=tests_require,
extras_require={
Expand Down

0 comments on commit 2438469

Please sign in to comment.