Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring memmapped dataset classes #256

Merged
merged 4 commits into from
Jan 24, 2024
Merged

Refactoring memmapped dataset classes #256

merged 4 commits into from
Jan 24, 2024

Conversation

stefdoerr
Copy link
Collaborator

I refactored all memmaped datasets into a separate class to reduce code duplication

@stefdoerr stefdoerr requested a review from RaulPPelaez January 24, 2024 10:45
@RaulPPelaez
Copy link
Collaborator

That is really cool! Thanks!

Copy link
Collaborator

@RaulPPelaez RaulPPelaez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@RaulPPelaez
Copy link
Collaborator

Lets see if tests pass and then merge

@RaulPPelaez
Copy link
Collaborator

 tests/test_dataset_comp6.py::test_dataset_s66x8 FAILED
 ______________________________ test_dataset_s66x8 ______________________________

    def test_dataset_s66x8():
    
        with TemporaryDirectory() as root:
>           data_set = S66X8(root)

tests/test_dataset_comp6.py:15: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/share/miniconda3/envs/torchmd-net/lib/python3.11/site-packages/torchmdnet/datasets/comp6.py:41: in __init__
    super().__init__(
/usr/share/miniconda3/envs/torchmd-net/lib/python3.11/site-packages/torchmdnet/datasets/memdataset.py:47: in __init__
    super().__init__(root, transform, pre_transform, pre_filter)
/usr/share/miniconda3/envs/torchmd-net/lib/python3.11/site-packages/torch_geometric/data/dataset.py:102: in __init__
    self._process()
/usr/share/miniconda3/envs/torchmd-net/lib/python3.11/site-packages/torch_geometric/data/dataset.py:228: in _process
    if files_exist(self.processed_paths):  # pragma: no cover
/usr/share/miniconda3/envs/torchmd-net/lib/python3.11/site-packages/torch_geometric/data/dataset.py:187: in processed_paths
    files = self.processed_file_names
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <[AttributeError("'S66X8' object has no attribute 'idx_mm'") raised in repr()] S66X8 object at 0x7f16715fe310>

    @property
    def processed_file_names(self) -> Union[str, List[str], Tuple]:
        r"""The name of the files in the :obj:`self.processed_dir` folder that
        must be present in order to skip processing."""
>       raise NotImplementedError
E       NotImplementedError

/usr/share/miniconda3/envs/torchmd-net/lib/python3.11/site-packages/torch_geometric/data/dataset.py:58: NotImplementedError

@guillemsimeon
Copy link
Collaborator

Cool!

@stefdoerr
Copy link
Collaborator Author

I see, there is a bit of a chicken-egg issue with the processed_file_names. I'll fix it

… since the processed_file_names needs to be available before the process function
@RaulPPelaez
Copy link
Collaborator

You got it, shall we merge then?

@stefdoerr stefdoerr merged commit 625b655 into main Jan 24, 2024
2 checks passed
@stefdoerr stefdoerr deleted the refactor_memmaps branch January 24, 2024 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants