Skip to content

Commit

Permalink
Additional changes to fix bugs and suggestions from erdem
Browse files Browse the repository at this point in the history
  • Loading branch information
allaffa committed Sep 3, 2024
1 parent 6a1b917 commit 86886cc
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion examples/ising_model/train_ising.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import numpy as np

try:
from hydragnn.utils.adiosdataset import AdiosWriter, AdiosDataset
from hydragnn.utils.datasets.adiosdataset import AdiosWriter, AdiosDataset
except ImportError:
pass

Expand Down
11 changes: 8 additions & 3 deletions examples/multidataset/energy_linear_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@
import numpy as np

import hydragnn
from hydragnn.utils import nsplit
from hydragnn.utils.adiosdataset import AdiosWriter, AdiosDataset
from hydragnn.utils.distributed import nsplit
from hydragnn.utils.datasets.adiosdataset import AdiosWriter, AdiosDataset
from tqdm import tqdm
from mpi_list import Context, DFM

# This import requires having installed the package mpi_list
try:
from mpi_list import Context, DFM
except ImportError:
print("mpi_list requires having installed: https://github.com/frobnitzem/mpi_list")


def subset(i):
Expand Down
2 changes: 1 addition & 1 deletion examples/ogb/train_gap.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import numpy as np

try:
from hydragnn.utils.adiosdataset import AdiosWriter, AdiosDataset
from hydragnn.utils.datasets.adiosdataset import AdiosWriter, AdiosDataset
except ImportError:
pass

Expand Down
2 changes: 1 addition & 1 deletion examples/qm7x/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def info(*args, logtype="info", sep=" "):
getattr(logging, logtype)(sep.join(map(str, args)))


from hydragnn.utils.datasets import AbstractBaseDataset
from hydragnn.utils.datasets.abstractbasedataset import AbstractBaseDataset

# FIXME: this radis cutoff overwrites the radius cutoff currently written in the JSON file
create_graph_fromXYZ = RadiusGraph(r=5.0) # radius cutoff in angstrom
Expand Down
2 changes: 1 addition & 1 deletion hydragnn/preprocess/stratified_sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def stratified_sampling(dataset: [Data], subsample_percentage: float, verbosity=
n_splits=1, train_size=subsample_percentage, random_state=0
)

for subsample_index, rest_of_data_index in sss.split(dataset, dataset_categories):
for subsample_index, _ in sss.split(dataset, dataset_categories):
subsample_indices = subsample_index.tolist()

for index in subsample_indices:
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/test_enthalpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

import os
import numpy as np
import hydragnn, tests
import tests
import pytest
from utils.lsms import (
from hydragnn.utils.lsms import (
convert_raw_data_energy_to_gibbs,
)

Expand Down
1 change: 0 additions & 1 deletion utils/__init__.py

This file was deleted.

0 comments on commit 86886cc

Please sign in to comment.