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

Update .ipynb notebooks from .py in pre-commit hook locally #537

Open
wants to merge 36 commits into
base: main
Choose a base branch
from

Conversation

lrlunin
Copy link
Collaborator

@lrlunin lrlunin commented Nov 14, 2024

see #504

Copy link
Contributor

github-actions bot commented Nov 14, 2024

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/mrpro/algorithms/csm
   inati.py24196%44
   walsh.py16194%34
src/mrpro/algorithms/dcf
   dcf_voronoi.py53492%15, 48–49, 76
src/mrpro/algorithms/optimizers
   adam.py20195%69
src/mrpro/algorithms/reconstruction
   DirectReconstruction.py281643%51–71, 85
   IterativeSENSEReconstruction.py13192%76
   Reconstruction.py502256%42, 54–56, 80–87, 104–113
   RegularizedIterativeSENSEReconstruction.py411759%96–100, 114–139
src/mrpro/data
   AcqInfo.py128398%26, 169, 207
   CsmData.py29390%15, 82–84
   DcfData.py45882%18, 66, 78–83
   IData.py67987%119, 125, 129, 159–167
   IHeader.py75791%75, 109, 127–131
   KData.py2142588%111–112, 127, 134, 144, 152, 206–207, 245, 250–251, 270–281, 435, 437, 500, 515, 552, 583, 592
   KHeader.py1531789%25, 119–123, 150, 199, 210, 217–218, 221, 228, 260–271
   KNoise.py311552%39–52, 56–61
   KTrajectory.py811285%108–113, 116–118, 203–207
   MoveDataMixin.py1401887%15, 113, 129, 143–145, 207, 323–325, 338, 417, 437–438, 440, 455–456, 458
   QData.py39782%42, 65–73
   Rotation.py6743595%100, 198, 335, 433, 477, 495, 581, 583, 592, 626, 628, 691, 768, 773, 776, 791, 808, 813, 889, 1077, 1082, 1085, 1109, 1113, 1240, 1242, 1250–1251, 1315, 1397, 1690, 1846, 1881, 1885, 1996
   SpatialDimension.py2322191%34, 104, 141, 148, 154, 274–276, 289–291, 325, 343, 356, 369, 382, 395, 404–405, 420, 429
   acq_filters.py12192%47
src/mrpro/data/traj_calculators
   KTrajectoryCalculator.py25292%23, 45
   KTrajectoryIsmrmrd.py13285%41, 50
   KTrajectoryPulseq.py23196%55
src/mrpro/operators
   CartesianSamplingOp.py89397%118, 157, 280
   ConstraintsOp.py60297%46, 48
   EndomorphOperator.py65297%228, 234
   FiniteDifferenceOp.py27293%40, 105
   FourierOp.py158398%263, 381, 386
   Functional.py71593%20–22, 117, 119
   GridSamplingOp.py136993%72–73, 82–83, 90–91, 94, 96, 98
   LinearOperator.py1681094%55, 91, 190, 220, 261, 270, 278, 287, 295, 320
   LinearOperatorMatrix.py1581690%82, 119, 152, 161, 166, 175–178, 191–194, 203, 215, 304, 331, 359
   MultiIdentityOp.py13285%43, 48
   Operator.py78297%25, 74
   ProximableFunctionalSeparableSum.py39392%50, 103, 110
   SliceProjectionOp.py173895%44, 61, 63, 69, 206, 227, 260, 300
   WaveletOp.py120596%152, 170, 205, 210, 233
   ZeroPadOp.py16194%30
src/mrpro/utils
   filters.py62297%44, 49
   reshape.py60198%191
   slice_profiles.py46687%20, 36, 113–116, 149
   sliding_window.py34197%34
   split_idx.py10280%43, 47
   summarize_tensorvalues.py11918%20–29
   typing.py181139%8–23
   zero_pad_or_crop.py31681%26, 30, 54, 57, 60, 63
TOTAL489136093% 

Tests Skipped Failures Errors Time
2263 0 💤 0 ❌ 0 🔥 1m 9s ⏱️

Copy link
Contributor

github-actions bot commented Nov 14, 2024

📚 Documentation

📁 Download as zip
🔍 View online

@lrlunin lrlunin force-pushed the notebooks-in-pre-commit branch from c348771 to 48e8080 Compare November 15, 2024 13:06
pyproject.toml Outdated Show resolved Hide resolved
@lrlunin lrlunin marked this pull request as ready for review November 19, 2024 18:00
@lrlunin lrlunin marked this pull request as draft November 19, 2024 18:37
@lrlunin lrlunin marked this pull request as ready for review November 19, 2024 20:15
@lrlunin lrlunin force-pushed the notebooks-in-pre-commit branch from 4ca0c47 to 279a578 Compare November 20, 2024 18:54
@fzimmermann89
Copy link
Member

Do we need the _notebooks folder?
Can we store the executed notebooks in the same directory as the non-executed ones?
Then, if we build the docs locally, we would still get the examples, just without results?

@lrlunin
Copy link
Collaborator Author

lrlunin commented Jan 9, 2025

Do we need the _notebooks folder?

Can we store the executed notebooks in the same directory as the non-executed ones?

Then, if we build the docs locally, we would still get the examples, just without results?

As far as I concerned the problem is that the sphinx is unable to list the directories above the docs root.

And symlink would not work on windows.

@fzimmermann89
Copy link
Member

two things:

  • %pip install -q to hide the install output?
  • maybe move your new commit hooks before the mypy hook, mypy is the slowest check, thus I think it would make sense to have it last.

@lrlunin
Copy link
Collaborator Author

lrlunin commented Jan 10, 2025

two things:

  • %pip install -q to hide the install output?
  • maybe move your new commit hooks before the mypy hook, mypy is the slowest check, thus I think it would make sense to have it last.
  1. Would not the supressed output of %pip install confuse a user and make an impression that installation did not work at all? Especially since the mrpro installation takes pretty long. I would be suspecious if the cell hangs for 5 minutes and does not have anyy output.
  2. Brillant idea (as always)

@fzimmermann89 fzimmermann89 force-pushed the notebooks-in-pre-commit branch from 43aa4e4 to abd30a3 Compare January 12, 2025 15:52
@fzimmermann89 fzimmermann89 force-pushed the notebooks-in-pre-commit branch from abd30a3 to 51d3dda Compare January 12, 2025 15:54
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.

Split examples into scripts & notebooks subfolders Move jupytext from action to pre commit
3 participants