diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ab3f4d2f..81926fab 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -64,21 +64,16 @@ repos: - repo: https://github.com/mwouts/jupytext rev: v1.16.4 - # converts (--to ipynb) the .py to the .ipynb and preserves (--update) the assigned - # "clear" cells' ids from the nbstripout hooks: - id: jupytext - name: convert .py to .ipynb - args: [--to, ipynb, --update] - files: '^examples/(.*\.py)$' - - repo: https://github.com/mwouts/jupytext - rev: v1.16.4 - # if user interacted with the .ipynb and changed the kernel name - hooks: - - id: jupytext - name: update .ipynb metadata - args: [--update-metadata, '{"kernelspec": {"display_name": "Python 3 (ipykernel)","language": "python","name": "python3"}}'] - files: '^examples/(.*\.ipynb)$' + name: sync .py and .ipynb + args: + - --sync + - --update-metadata + - '{"kernelspec": {"display_name": "Python 3 (ipykernel)","language": "python","name": "python3"}}' + - --set-formats + - ipynb,py:percent + files: '^examples/(.*\.ipynb|.*\.py)$' ci: autofix_commit_msg: | [pre-commit] auto fixes from pre-commit hooks diff --git a/examples/direct_reconstruction.ipynb b/examples/direct_reconstruction.ipynb index beb54824..8cc5c50e 100644 --- a/examples/direct_reconstruction.ipynb +++ b/examples/direct_reconstruction.ipynb @@ -206,7 +206,8 @@ ], "metadata": { "jupytext": { - "cell_metadata_filter": "-all" + "cell_metadata_filter": "-all", + "formats": "ipynb,py:percent" }, "kernelspec": { "display_name": "Python 3 (ipykernel)", diff --git a/examples/direct_reconstruction.py b/examples/direct_reconstruction.py index 7672aa7e..aa1b8d57 100644 --- a/examples/direct_reconstruction.py +++ b/examples/direct_reconstruction.py @@ -1,3 +1,19 @@ +# --- +# jupyter: +# jupytext: +# cell_metadata_filter: -all +# formats: ipynb,py:percent +# text_representation: +# extension: .py +# format_name: percent +# format_version: '1.3' +# jupytext_version: 1.16.4 +# kernelspec: +# display_name: Python 3 (ipykernel) +# language: python +# name: python3 +# --- + # %% [markdown] # # Direct Reconstruction of 2D golden angle radial data # Here we use the DirectReconstruction class to reconstruct images from ISMRMRD 2D radial data diff --git a/examples/iterative_sense_reconstruction.ipynb b/examples/iterative_sense_reconstruction.ipynb index 2e7ffc11..5a390c17 100644 --- a/examples/iterative_sense_reconstruction.ipynb +++ b/examples/iterative_sense_reconstruction.ipynb @@ -306,7 +306,8 @@ ], "metadata": { "jupytext": { - "cell_metadata_filter": "-all" + "cell_metadata_filter": "-all", + "formats": "ipynb,py:percent" }, "kernelspec": { "display_name": "Python 3 (ipykernel)", diff --git a/examples/iterative_sense_reconstruction.py b/examples/iterative_sense_reconstruction.py index 6d0bc49a..d7e321f3 100644 --- a/examples/iterative_sense_reconstruction.py +++ b/examples/iterative_sense_reconstruction.py @@ -1,3 +1,19 @@ +# --- +# jupyter: +# jupytext: +# cell_metadata_filter: -all +# formats: ipynb,py:percent +# text_representation: +# extension: .py +# format_name: percent +# format_version: '1.3' +# jupytext_version: 1.16.4 +# kernelspec: +# display_name: Python 3 (ipykernel) +# language: python +# name: python3 +# --- + # %% [markdown] # # Iterative SENSE Reconstruction of 2D golden angle radial data # Here we use the IterativeSENSEReconstruction class to reconstruct images from ISMRMRD 2D radial data diff --git a/examples/pulseq_2d_radial_golden_angle.ipynb b/examples/pulseq_2d_radial_golden_angle.ipynb index b1069fff..7c254e7b 100644 --- a/examples/pulseq_2d_radial_golden_angle.ipynb +++ b/examples/pulseq_2d_radial_golden_angle.ipynb @@ -180,7 +180,8 @@ ], "metadata": { "jupytext": { - "cell_metadata_filter": "-all" + "cell_metadata_filter": "-all", + "formats": "ipynb,py:percent" }, "kernelspec": { "display_name": "Python 3 (ipykernel)", diff --git a/examples/pulseq_2d_radial_golden_angle.py b/examples/pulseq_2d_radial_golden_angle.py index 3f857c38..4fff2389 100644 --- a/examples/pulseq_2d_radial_golden_angle.py +++ b/examples/pulseq_2d_radial_golden_angle.py @@ -1,3 +1,19 @@ +# --- +# jupyter: +# jupytext: +# cell_metadata_filter: -all +# formats: ipynb,py:percent +# text_representation: +# extension: .py +# format_name: percent +# format_version: '1.3' +# jupytext_version: 1.16.4 +# kernelspec: +# display_name: Python 3 (ipykernel) +# language: python +# name: python3 +# --- + # %% [markdown] # # Reconstruction of 2D golden angle radial data from pulseq sequence # Here we manually do all steps of a direction reconstruction, i.e. diff --git a/examples/qmri_sg_challenge_2024_t1.ipynb b/examples/qmri_sg_challenge_2024_t1.ipynb index 63271951..e9294318 100644 --- a/examples/qmri_sg_challenge_2024_t1.ipynb +++ b/examples/qmri_sg_challenge_2024_t1.ipynb @@ -328,7 +328,8 @@ ], "metadata": { "jupytext": { - "cell_metadata_filter": "-all" + "cell_metadata_filter": "-all", + "formats": "ipynb,py:percent" }, "kernelspec": { "display_name": "Python 3 (ipykernel)", diff --git a/examples/qmri_sg_challenge_2024_t1.py b/examples/qmri_sg_challenge_2024_t1.py index d0259f26..1b3c0311 100644 --- a/examples/qmri_sg_challenge_2024_t1.py +++ b/examples/qmri_sg_challenge_2024_t1.py @@ -1,3 +1,19 @@ +# --- +# jupyter: +# jupytext: +# cell_metadata_filter: -all +# formats: ipynb,py:percent +# text_representation: +# extension: .py +# format_name: percent +# format_version: '1.3' +# jupytext_version: 1.16.4 +# kernelspec: +# display_name: Python 3 (ipykernel) +# language: python +# name: python3 +# --- + # %% [markdown] # # QMRI Challenge ISMRM 2024 - $T_1$ mapping diff --git a/examples/qmri_sg_challenge_2024_t2_star.ipynb b/examples/qmri_sg_challenge_2024_t2_star.ipynb index 95bf3971..120d86f3 100644 --- a/examples/qmri_sg_challenge_2024_t2_star.ipynb +++ b/examples/qmri_sg_challenge_2024_t2_star.ipynb @@ -285,7 +285,8 @@ ], "metadata": { "jupytext": { - "cell_metadata_filter": "-all" + "cell_metadata_filter": "-all", + "formats": "ipynb,py:percent" }, "kernelspec": { "display_name": "Python 3 (ipykernel)", diff --git a/examples/qmri_sg_challenge_2024_t2_star.py b/examples/qmri_sg_challenge_2024_t2_star.py index a80f4075..e0046b55 100644 --- a/examples/qmri_sg_challenge_2024_t2_star.py +++ b/examples/qmri_sg_challenge_2024_t2_star.py @@ -1,3 +1,19 @@ +# --- +# jupyter: +# jupytext: +# cell_metadata_filter: -all +# formats: ipynb,py:percent +# text_representation: +# extension: .py +# format_name: percent +# format_version: '1.3' +# jupytext_version: 1.16.4 +# kernelspec: +# display_name: Python 3 (ipykernel) +# language: python +# name: python3 +# --- + # %% [markdown] # # QMRI Challenge ISMRM 2024 - $T_2^*$ mapping diff --git a/examples/regularized_iterative_sense_reconstruction.ipynb b/examples/regularized_iterative_sense_reconstruction.ipynb index 3599b8a5..f4840135 100644 --- a/examples/regularized_iterative_sense_reconstruction.ipynb +++ b/examples/regularized_iterative_sense_reconstruction.ipynb @@ -376,7 +376,8 @@ ], "metadata": { "jupytext": { - "cell_metadata_filter": "-all" + "cell_metadata_filter": "-all", + "formats": "ipynb,py:percent" }, "kernelspec": { "display_name": "Python 3 (ipykernel)", diff --git a/examples/regularized_iterative_sense_reconstruction.py b/examples/regularized_iterative_sense_reconstruction.py index e41dc4ac..b92081d4 100644 --- a/examples/regularized_iterative_sense_reconstruction.py +++ b/examples/regularized_iterative_sense_reconstruction.py @@ -1,3 +1,19 @@ +# --- +# jupyter: +# jupytext: +# cell_metadata_filter: -all +# formats: ipynb,py:percent +# text_representation: +# extension: .py +# format_name: percent +# format_version: '1.3' +# jupytext_version: 1.16.4 +# kernelspec: +# display_name: Python 3 (ipykernel) +# language: python +# name: python3 +# --- + # %% [markdown] # # Regularized Iterative SENSE Reconstruction of 2D golden angle radial data # Here we use the RegularizedIterativeSENSEReconstruction class to reconstruct images from ISMRMRD 2D radial data diff --git a/examples/t1_mapping_with_grad_acq.ipynb b/examples/t1_mapping_with_grad_acq.ipynb index 6b5603d5..3f0c29e2 100644 --- a/examples/t1_mapping_with_grad_acq.ipynb +++ b/examples/t1_mapping_with_grad_acq.ipynb @@ -500,7 +500,8 @@ ], "metadata": { "jupytext": { - "cell_metadata_filter": "-all" + "cell_metadata_filter": "-all", + "formats": "ipynb,py:percent" }, "kernelspec": { "display_name": "Python 3 (ipykernel)", diff --git a/examples/t1_mapping_with_grad_acq.py b/examples/t1_mapping_with_grad_acq.py index de8e31c4..f5b6a8b2 100644 --- a/examples/t1_mapping_with_grad_acq.py +++ b/examples/t1_mapping_with_grad_acq.py @@ -1,3 +1,19 @@ +# --- +# jupyter: +# jupytext: +# cell_metadata_filter: -all +# formats: ipynb,py:percent +# text_representation: +# extension: .py +# format_name: percent +# format_version: '1.3' +# jupytext_version: 1.16.4 +# kernelspec: +# display_name: Python 3 (ipykernel) +# language: python +# name: python3 +# --- + # %% [markdown] # # $T_1$ mapping from a continuous Golden radial acquisition