Skip to content

Commit

Permalink
Merge pull request #119 from MDIL-SNU/dev
Browse files Browse the repository at this point in the history
refactor: file not found error + warnings for graph dataset
  • Loading branch information
YutackPark authored Nov 2, 2024
2 parents df719ff + 6ad6afe commit 7f2a026
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sevenn/train/graph_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ def __init__(

def load(self, path: str, data_cls=Data) -> None:
super().load(path, data_cls)
if len(self) == 0:
warnings.warn(f'No graphs found {self.processed_paths[0]}')
self._load_meta()

def _load_meta(self) -> None:
Expand Down Expand Up @@ -377,6 +379,8 @@ def _read_graph_dataset(
) -> list[AtomGraphData]:
meta_f = filename.replace('.pt', '.yaml')
orig_cutoff = cutoff
if not os.path.exists(filename):
raise FileNotFoundError(f'No such file: {filename}')
if not os.path.exists(meta_f):
warnings.warn('No meta info found, beware of cutoff...')
else:
Expand Down

0 comments on commit 7f2a026

Please sign in to comment.