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

Examples typos #449

Merged
merged 36 commits into from
Nov 14, 2024
Merged

Examples typos #449

merged 36 commits into from
Nov 14, 2024

Conversation

lrlunin
Copy link
Collaborator

@lrlunin lrlunin commented Oct 18, 2024

Fix issues caused by the switch to SI units.
Use new qmri challenge dataset
Use latex in notebooks

Closes #459
Closes #462

Hello,

there are some very minor changes, but you have to start somewhere :-)

  1. The first one is using T1 instead of subscript as done before. Only this example has used it.
  2. Use of \ln and \cos TeX commands instead of plain text.

They are not urgent at all.
Thanks in advance.

Copy link
Contributor

github-actions bot commented Oct 18, 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
   KHeader.py1531789%25, 119–123, 150, 199, 210, 217–218, 221, 228, 260–271
   KNoise.py311552%39–52, 56–61
   KTrajectory.py69593%178–182
   MoveDataMixin.py1371887%15, 113, 129, 143–145, 207, 305–307, 320, 399, 419–420, 422, 437–438, 440
   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.py2302191%33, 103, 128, 135, 141, 261–263, 276–278, 312, 330, 343, 356, 369, 382, 391–392, 407, 416
   acq_filters.py12192%47
src/mrpro/data/_kdata
   KData.py1341887%109–110, 125, 132, 142, 150, 204–205, 243, 248–249, 268–279
   KDataRemoveOsMixin.py29293%44, 46
   KDataSelectMixin.py19289%48, 63
   KDataSplitMixin.py48394%53, 84, 93
src/mrpro/data/traj_calculators
   KTrajectoryCalculator.py25292%23, 45
   KTrajectoryIsmrmrd.py13285%41, 50
   KTrajectoryPulseq.py29197%54
src/mrpro/operators
   CartesianSamplingOp.py89397%118, 157, 280
   ConstraintsOp.py60297%46, 48
   EndomorphOperator.py65297%228, 234
   FiniteDifferenceOp.py27293%40, 105
   FourierOp.py157398%263, 381, 386
   Functional.py71593%20–22, 117, 119
   GridSamplingOp.py136993%72–73, 82–83, 90–91, 94, 96, 98
   LinearOperator.py1711293%55, 91, 190, 220, 261, 270, 278, 287, 295, 320, 418, 423
   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
   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
TOTAL485735493% 

Tests Skipped Failures Errors Time
2250 0 💤 0 ❌ 0 🔥 2m 4s ⏱️

@lrlunin lrlunin added the easy Easy one for people to start with label Oct 18, 2024
Copy link
Contributor

github-actions bot commented Oct 18, 2024

📚 Documentation

📁 Download as zip
🔍 View online

@fzimmermann89
Copy link
Member

fzimmermann89 commented Oct 18, 2024

good idea to make the use of T_1 consistent in the examples -- but in all equations it should be $T_1$.

@lrlunin
Copy link
Collaborator Author

lrlunin commented Oct 18, 2024

good idea to make the use of T_1 consistent in the examples -- but in all equations it should be $T_1$.

Okay, I'll replace the notation in all examples then.

@lrlunin
Copy link
Collaborator Author

lrlunin commented Oct 18, 2024

I also added subscript notations for the graphs. Should be ready to merge so far.

@ckolbPTB
Copy link
Collaborator

maybe not change the title of the notebooks because these titles are used in the docu as doctree entries which does not support latex formatting.

@lrlunin
Copy link
Collaborator Author

lrlunin commented Oct 18, 2024

maybe not change the title of the notebooks because these titles are used in the docu as doctree entries which does not support latex formatting.

They actually kinda do, but not on the top level. I guess there is some option to force the TeX display mode.
In the above level:
image

If you check on of the examples.
image

So I believe there is some page-specific display-/parse-mode which was automatically enabled in the page with the markdown notebook and was not enabled in the examples' table of content. I'll check if there is some magic hint to force the page be displayed as markdown.

@lrlunin
Copy link
Collaborator Author

lrlunin commented Oct 18, 2024

I found a much better solution. With the nbsphinx all works as expected and all converting, running, including as html in the docs.yml can removed. I'll make a commit till monday I guess.

@ckolbPTB
Copy link
Collaborator

I found a much better solution. With the nbsphinx all works as expected and all converting, running, including as html in the docs.yml can removed. I'll make a commit till monday I guess.

They way it is know allows for all the notebooks to be run in parallel. Maybe nbspinx offers this now too?

@lrlunin
Copy link
Collaborator Author

lrlunin commented Oct 18, 2024

I found a much better solution. With the nbsphinx all works as expected and all converting, running, including as html in the docs.yml can removed. I'll make a commit till monday I guess.

They way it is know allows for all the notebooks to be run in parallel. Maybe nbspinx offers this now too?

They promise to allow threads with -j parameter analog to make parameter.

docs/source/conf.py Outdated Show resolved Hide resolved
@fzimmermann89
Copy link
Member

Btw: We will still need a conversion from py to ipynb & commit, as we want to keep the notebooks available in the repo as well.

@lrlunin
Copy link
Collaborator Author

lrlunin commented Oct 19, 2024

I found a much better solution. With the nbsphinx all works as expected and all converting, running, including as html in the docs.yml can removed. I'll make a commit till monday I guess.

They way it is know allows for all the notebooks to be run in parallel. Maybe nbspinx offers this now too?

They promise to allow threads with -j parameter analog to make parameter.

This seems not to be true. The execution of the notebooks is indeed not parallel and lasts approx. 3 minutes on my pc. Then it would be more reasanoble to perform the step with the .py -> .ipynb conversion and further .ipynb evaluation in the action. Then copy and include the evaluated notebooks into the docs with the nbsphinx_execute = 'never' setting in the conf.py.

@fzimmermann89
Copy link
Member

My 2cents:
Sphinx -j option is not the same as parallel jobs.
Both download speed for the example data and CPU should be exhausted by a single example.
The parallel jobs run afaik on separate worker machines.

On your local machine at home, the total time might be dominated by the data download..

@lrlunin
Copy link
Collaborator Author

lrlunin commented Oct 23, 2024

This is done so far and awaits #469 to pass the github action since pandoc is missing

@fzimmermann89
Copy link
Member

For me, the requirement of a non-pip binary is a blocker here. Does the switch to nbshinx really have such advantages that it is worth the hassle?

Can you maybe first fix the issues with the notebooks you noticed (and maybe also change the code to s instead of ms, this would fix and there open issue #462).

And then we can push the overhaul of the action a bit into the future and talk about it and the advantages your approach has first.

@fzimmermann89
Copy link
Member

Try pypandoc-binary

@fzimmermann89
Copy link
Member

Do I understand this correctly that remote builds still use papermill to execute (potentially giving us a way to include non public data), but local builds also work and execute the notebooks using nbshinx?

I would add the pandoc binaries as a requirement instead of apt to the docker. this way building just works after a pip install locally.

@fzimmermann89
Copy link
Member

Still, consider splitting this in two parts:

  • Fixing the notebooks (the fitting and formattin
  • Switching to nbshinx

@fzimmermann89
Copy link
Member

consider adding yourself to the pyproject.toml author list

Copy link
Member

@fzimmermann89 fzimmermann89 left a comment

Choose a reason for hiding this comment

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

looks good!

  • add yourself to the author list in pyproject.toml
  • minor nitpick: in the plots, add a unit to the colorbars for T1 and T2*

@ckolbPTB
Copy link
Collaborator

The T1 mapping using radial golden angle data does not lead to good results anymore.

@ckolbPTB
Copy link
Collaborator

ckolbPTB commented Nov 14, 2024

The other two quantitative notebooks also don't work anymore..

-> wait for #535 to fix this

@lrlunin
Copy link
Collaborator Author

lrlunin commented Nov 14, 2024

add yourself to the author list in pyproject.toml

I don't consider the changes done to worth it. They are primary cosmetic.

minor nitpick: in the plots, add a unit to the colorbars for T1 and T2*

TBD

@fzimmermann89
Copy link
Member

Of course your decison.
I'd say it would be justified.
You can also do it in any future pr if you want to.

@lrlunin lrlunin merged commit 38722bf into main Nov 14, 2024
21 checks passed
@lrlunin lrlunin deleted the examples_typos branch November 14, 2024 17:14
@fzimmermann89
Copy link
Member

@lrlunin:
Small hint for next time: Please use imperative mood and a bit more descriptive name for the commit ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy Easy one for people to start with
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

QMRI notebooks broken Old dataset downloaded from zenodo for T1_mapping_with_grad_acq
3 participants