Open jarvist opened 3 weeks ago
@jarvist Hi there, thanks a lot for your feedback. I will have a look into this bug.
I think we've managed to sort it ourself.
On Windows a lot of them fail because the h5py
package fails to have a suitable binary dependency, but then it does not fail with a useful error message. (Perhaps a test that the .h5 file is being opened properly would be good to add to the examples?)
On Linux we found that downgrading the version of Python was able to build a working h5py
package.
On our Debian machine, this required a Conda install of:
python=3.8 pytorch==2.1.1 torchvision==0.16.1 torchaudio==2.1.1 pytorch-cuda=12.1
So a little bit suboptimal in terms of error messages, but resolved!
Hi @jarvist,
Thanks a lot for your valuable feedback!
Currently we only test the code on Linux machine, and the environment for testing can be found in .github/workflows/ci.yml
, which is python-version: ["3.8", "3.9", "3.10"]
with the following settings for packages:
python -m pip install --upgrade pip pip install pytest h5py ase typing 'pydantic>=1.10.0,<2.0.0' tomli dscribe pip3 install torch==1.12.1+cpu -f https://download.pytorch.org/whl/torch_stable.html
And in the latest pull request, the version of python and pytorch will be updated to python-version: ["3.11", "3.12"]
, with
python -m pip install --upgrade pip pip install pytest h5py ase typing 'pydantic>=1.10.0,<2.0.0' tomli dscribe pip3 install torch==2.3.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
Thanks again for your report. We may test other machines in the future and we will add documentation for the environment setting for the released version.
Best, Wenbo
Hello @jarvist. I have taken a look at this and it seems to be a operating system (Windows) specific bug. The Python hdf5 package requires data paths to be POSIX compliant like so "this/path/is/posix/compliant". However, windows uses backslashes as path component separators like so "this\path\is\not\posix\compliant". The os.path.join
method used to format paths will default to the standard specified by the operating system. So when the example is run on Windows the paths produced by the os.join
operation will not be POSIX compliant and will result in the h5py
package getting rather upset. Hence it stating that it cannot resolve the path "'CHHHH0\\dipole'". We can patch this by using the posixpath.join
method rather than os.path.join
for HDF5 related pathing.
Once we had a working Conda install of TBMaLT, we can run
examples/example_01/example_01.py
However,
examples/example_01/example_02.py
fails with an H5 error, trying to look up a key; as do the rest of the examples.Are the example .h5 files consisted with the latest version of the code? The H5 files appear to contain the correct keys. We are initially running on Windows.