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

Split {test_,}pytorch.py into a few files #23

Merged
merged 9 commits into from
Dec 17, 2024
Merged

Split {test_,}pytorch.py into a few files #23

merged 9 commits into from
Dec 17, 2024

Conversation

ryan-williams
Copy link
Member

@ryan-williams ryan-williams commented Dec 17, 2024

Factored some classes/functions from pytorch.py into their own files:

  • dataset.py: ExperimentAxisQueryIterableDataset
  • datapipe.py: ExperimentAxisQueryIterDataPipe
  • dataloader.py: experiment_dataloader wrapper
  • _csr.py: CSR_IO_Buffer
  • _distributed.py: multiprocess world/rank helpers
  • _experiment_locator.py: ExperimentLocator
  • _utils: splits, batched

The code is unchanged

Some test_pytorch.py tests are similarly moved to files named after the above new files. Pytest @fixtures are also moved to conftest.py (for reuse across test files), and tests/_utils.py contains generic test helper functions.

b03c65f renamed these type aliases:

-XDatum = Union[NDArrayNumber, sparse.csr_matrix]
-XObsDatum = Tuple[XDatum, pd.DataFrame]
+XBatch = Union[NDArrayNumber, sparse.csr_matrix]
+Batch = Tuple[XBatch, pd.DataFrame]

Also a couple nits in 16a6090

@ryan-williams ryan-williams marked this pull request as ready for review December 17, 2024 15:43
)
from .dataloader import experiment_dataloader
from .datapipe import ExperimentAxisQueryIterDataPipe
from .dataset import ExperimentAxisQueryIterableDataset
Copy link
Member

Choose a reason for hiding this comment

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

do you need to define __all__?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's down at L14, unchanged

@ryan-williams ryan-williams merged commit 68a8fa2 into main Dec 17, 2024
24 checks passed
@ryan-williams ryan-williams deleted the rw/files branch December 17, 2024 19:48
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.

2 participants