RosettaCommons / RosettaCommons/atomworks

Import statements in examples are not working

Open
#51 0 comments 0 reactions 1 assignee View on GitHub

@nscorley is already working on this.

Since Oct 8, 2025.

Dominant language
Python
Stars
446
Forks
52
PR merge metrics
No merged PRs in 30d

Description

In the 'Dataset Exploration and Management in AtomWorks' example the first import statement:

from atomworks.ml.datasets.datasets import FileDataset

results in the following error when using AtomWorks installed from PyPI:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/miniconda3/envs/atomworks_env/lib/python3.12/site-packages/atomworks/ml/datasets/datasets.py", line 18, in <module>
    from atomworks.ml.datasets.parsers import MetadataRowParser, load_example_from_metadata_row
  File "/opt/miniconda3/envs/atomworks_env/lib/python3.12/site-packages/atomworks/ml/datasets/parsers/__init__.py", line 3, in <module>
    from atomworks.ml.datasets.parsers.default_metadata_row_parsers import *  # noqa: F403
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/atomworks_env/lib/python3.12/site-packages/atomworks/ml/datasets/parsers/default_metadata_row_parsers.py", line 86, in <module>
    class PNUnitsDFParser(MetadataRowParser):
  File "/opt/miniconda3/envs/atomworks_env/lib/python3.12/site-packages/atomworks/ml/datasets/parsers/default_metadata_row_parsers.py", line 99, in PNUnitsDFParser
    base_dir: Path | str | list[Path | str] | tuple[Path | str, ...] = Path(PDB_MIRROR_PATH),
                                                                       ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/atomworks_env/lib/python3.12/pathlib.py", line 1162, in __init__
    super().__init__(*args)
  File "/opt/miniconda3/envs/atomworks_env/lib/python3.12/pathlib.py", line 373, in __init__
    raise TypeError(
TypeError: argument should be a str or an os.PathLike object where __fspath__ returns a str, not 'NoneType'
>>> from atomworks.ml.datasets.datasets import FileDataset
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/miniconda3/envs/atomworks_env/lib/python3.12/site-packages/atomworks/ml/datasets/datasets.py", line 18, in <module>
    from atomworks.ml.datasets.parsers import MetadataRowParser, load_example_from_metadata_row
  File "/opt/miniconda3/envs/atomworks_env/lib/python3.12/site-packages/atomworks/ml/datasets/parsers/__init__.py", line 3, in <module>
    from atomworks.ml.datasets.parsers.default_metadata_row_parsers import *  # noqa: F403
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/atomworks_env/lib/python3.12/site-packages/atomworks/ml/datasets/parsers/default_metadata_row_parsers.py", line 86, in <module>
    class PNUnitsDFParser(MetadataRowParser):
  File "/opt/miniconda3/envs/atomworks_env/lib/python3.12/site-packages/atomworks/ml/datasets/parsers/default_metadata_row_parsers.py", line 99, in PNUnitsDFParser
    base_dir: Path | str | list[Path | str] | tuple[Path | str, ...] = Path(PDB_MIRROR_PATH),
                                                                       ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/atomworks_env/lib/python3.12/pathlib.py", line 1162, in __init__
    super().__init__(*args)
  File "/opt/miniconda3/envs/atomworks_env/lib/python3.12/pathlib.py", line 373, in __init__
    raise TypeError(
TypeError: argument should be a str or an os.PathLike object where __fspath__ returns a str, not 'NoneType'

This error is not present if using AtomWorks installed locally from source.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.