Skip to content

Commit

Permalink
Merge pull request #140 from NLESC-JCER/fix_master_23
Browse files Browse the repository at this point in the history
Fix master 23
  • Loading branch information
NicoRenaud authored Apr 6, 2023
2 parents cff5770 + 38c5737 commit 129d7d9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [3.7, 3.8]
version: [3.8]

steps:
- name: Cancel Previous Runs
Expand All @@ -26,7 +26,10 @@ jobs:
conda-channels: anaconda
- run: conda --version
- run: which python
# - run: conda install -c conda-forge openmpi
- run: conda install mpi4py h5py pytorch torchvision cpuonly -c pytorch -c conda-forge
# - run: pip install horovod==0.27.0
- run: conda install -c conda-forge libstdcxx-ng=12

- name: Install the package
run: pip install .[test,hpc]
Expand Down
13 changes: 7 additions & 6 deletions qmctorch/utils/hdf5_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@


def print_insert_error(obj, obj_name):
print(obj_name, obj)
log.critical('Issue inserting data {0} of type {type}',
obj_name, type=str(type(obj)))


def print_insert_type_error(obj, obj_name):
log.critical('Issue inserting type of data {0}} ({type}})' %
obj_name, type=str(type(obj)))



def print_load_error(grp):
log.critical('Issue loading {grp}', grp=grp)

Expand Down Expand Up @@ -209,6 +209,7 @@ def insert_group(obj, parent_grp, obj_name):
except Exception as inst:
print(type(inst))
print(inst)

print_insert_error(obj, obj_name)

# if something went wrong anyway
Expand Down Expand Up @@ -247,7 +248,8 @@ def insert_data(obj, parent_grp, obj_name):
try:
insert_fn(obj, parent_grp, obj_name)
# insert_type(obj, parent_grp, obj_name)
except:
except Exception as expt_message:
print("YYY", expt_message)
print_insert_error(obj, obj_name)


Expand Down Expand Up @@ -288,10 +290,9 @@ def insert_list(obj, parent_grp, obj_name):
parent_grp {hdf5 group} -- group where to dump
obj_name {str} -- name of the object
"""
np.warnings.filterwarnings(
'ignore', category=np.VisibleDeprecationWarning)

try:
parent_grp.create_dataset(obj_name, data=obj)
parent_grp.create_dataset(obj_name, data=np.array(obj))
except:
for il, l in enumerate(obj):
try:
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,11 @@
test_suite='tests',
install_requires=['matplotlib', 'numpy', 'argparse',
'scipy', 'tqdm', 'torch',
# 'plams@git+https://github.com/SCM-NV/PLAMS@master',
'plams',
'pyscf', 'mendeleev', 'twiggy', 'mpi4py'],

extras_require={
'hpc': ['horovod'],
'hpc': ['horovod==0.27.0'],
'doc': ['recommonmark', 'sphinx', 'sphinx_rtd_theme'],
'test': ['pytest', 'pytest-runner',
'coverage', 'coveralls', 'pycodestyle'],
Expand Down
1 change: 0 additions & 1 deletion tests/wavefunction/jastrows/elec_elec_nuc/test_hess.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import torch
from torch import nn
from torch.autograd import grad
from torch.autograd.grad_mode import F
from torch.autograd.variable import Variable


Expand Down

0 comments on commit 129d7d9

Please sign in to comment.