Closed payalchandak closed 1 month ago
The changes introduce a new method load_subject_dynamic_data
in the PytorchDataset
class, which loads dynamic data slices based on a subject index. This method retrieves the subject ID and time range from the dataset's index and accesses corresponding data from a nested ragged tensor file. Additionally, the existing _seeded_getitem
method is modified to call this new method, enhancing the modularity and readability of the code while maintaining the overall structure of the class. The .pre-commit-config.yaml
file is also updated to refine pre-commit hooks and their configurations.
File Path | Change Summary |
---|---|
src/meds_torch/data/components/pytorch_dataset.py | Added method load_subject_dynamic_data(self, idx: int) ; modified _seeded_getitem to use the new method and updated assertion message. |
.pre-commit-config.yaml | Updated pre-commit hooks: changed Python version to 3.12 , modified docformatter , set black line length to 110 , added autoflake , and adjusted flake8 configurations. |
sequenceDiagram
participant User
participant PytorchDataset
participant DataLoader
User->>PytorchDataset: Call _seeded_getitem()
PytorchDataset->>DataLoader: Load subject dynamic data
DataLoader-->>PytorchDataset: Return dynamic data
PytorchDataset-->>User: Return data
π° In the meadow where data flows,
A new method blooms and grows.
With each slice, the rabbits cheer,
For loading fast, it brings us near.
So hop along, letβs celebrate,
Dynamic data, oh, how great! πΌ
Code quality checks pass locally for me, not sure what's going on with the automated testing
(eq) payal@narsil:.../meds-torch$ git status
On branch payal/load_subject_dynamic_data
Your branch is up to date with 'origin/payal/load_subject_dynamic_data'.
nothing to commit, working tree clean
(eq) payal@narsil:.../meds-torch$ pre-commit run --all-files
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check docstring is first.................................................Passed
check yaml...............................................................Passed
debug statements (python)................................................Passed
detect private key.......................................................Passed
check that executables have shebangs.................(no files to check)Skipped
check toml...............................................................Passed
check for case conflicts.................................................Passed
check for added large files..............................................Passed
docformatter.............................................................Passed
black....................................................................Passed
isort....................................................................Passed
autoflake................................................................Passed
pyupgrade................................................................Passed
docformatter.............................................................Passed
flake8...................................................................Passed
mdformat.................................................................Passed
codespell................................................................Passed
nbstripout...........................................(no files to check)Skipped
nbqa-black...............................................................Passed
nbqa-isort...............................................................Passed
nbqa-flake8..............................................................Passed
:warning: Please install the to ensure uploads and comments are reliably processed by Codecov.
Attention: Patch coverage is 90.90909%
with 1 line
in your changes missing coverage. Please review.
Project coverage is 70.76%. Comparing base (
b021a49
) to head (8955821
). Report is 2 commits behind head on dev.
Files with missing lines | Patch % | Lines |
---|---|---|
src/meds_torch/data/components/pytorch_dataset.py | 90.90% | 1 Missing :warning: |
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Summary by CodeRabbit
New Features
Improvements