-
Notifications
You must be signed in to change notification settings - Fork 3
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
Improve documentation #598
Open
fzimmermann89
wants to merge
60
commits into
main
Choose a base branch
from
improvedoc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+5,170
−4,208
Open
Changes from 51 commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
470f1a2
improve doc
fzimmermann89 4398a11
update
fzimmermann89 f3a6e16
update
fzimmermann89 9f500fb
update
fzimmermann89 f1e5d1e
update
fzimmermann89 9d07935
update
fzimmermann89 466ab3c
update
fzimmermann89 3420fc6
update
fzimmermann89 e395218
example
fzimmermann89 e00b6a7
test
fzimmermann89 6606672
test
fzimmermann89 df51ecf
Notebooks updated
github-actions[bot] eab0395
update
fzimmermann89 f6f0502
Squashed commit of the following:
fzimmermann89 a92877b
update
fzimmermann89 47ad68e
update
fzimmermann89 31bf097
update
fzimmermann89 a72d095
Squashed commit of the following:
fzimmermann89 0af3338
update
fzimmermann89 a26a559
update
fzimmermann89 6a5ef6b
test
fzimmermann89 7a3cf18
update
fzimmermann89 cfb20b0
update
fzimmermann89 7caf514
test
fzimmermann89 e51b7c7
update
fzimmermann89 2571ae3
update
fzimmermann89 48e3125
fix
fzimmermann89 132637c
update
fzimmermann89 d4f7fb2
update
fzimmermann89 66a4d4e
update
fzimmermann89 7cc6587
Squashed commit of the following:
fzimmermann89 93ad440
fix
fzimmermann89 f94a177
update
fzimmermann89 5d21424
update
fzimmermann89 8453798
update
fzimmermann89 5311951
update
fzimmermann89 ba5b484
update
fzimmermann89 408022b
update
fzimmermann89 09c6b97
Merge branch 'main' into improvedoc
fzimmermann89 7684724
update
fzimmermann89 871cdd2
update
fzimmermann89 71943e0
update
fzimmermann89 433649e
update
fzimmermann89 df16dd9
update
fzimmermann89 929aa0d
update
fzimmermann89 3dbd1d6
update
fzimmermann89 54114aa
update
fzimmermann89 644cce9
update
fzimmermann89 4d497e7
update
fzimmermann89 688a55c
Apply suggestions from code review
fzimmermann89 457787c
rename
fzimmermann89 d0baf78
update
fzimmermann89 75b7633
svg instead of png
fzimmermann89 2156518
lint
fzimmermann89 ac37591
update
fzimmermann89 2b3faf1
update
fzimmermann89 337a514
update readme
fzimmermann89 e6ab0db
fix
fzimmermann89 b8907ca
fix
fzimmermann89 17b03ea
fix
fzimmermann89 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All changes here are due to basing upon #537 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
"""Add a colab badge and pip install to notebooks.""" | ||
|
||
import sys | ||
from pathlib import Path | ||
|
||
# the filename is the name of temp file created by jupytext, not an original notebook | ||
file = Path(sys.argv[1]) | ||
# the temp filename for "iteratitive_sense_reconstruction.py" is like "iterative_sense_reconstruction-42_5f4kv.py" | ||
basename = file.stem.rpartition('-')[0] | ||
|
||
badge_svg = 'https://colab.research.google.com/assets/colab-badge.svg' | ||
ipynb_link = f'https://colab.research.google.com/github/PTB-MR/mrpro/blob/main/examples/notebooks/{basename}.ipynb' | ||
badge_markdown = f'[![Open In Colab]({badge_svg})]({ipynb_link})' | ||
badge_pyprocent = f'# %% [markdown]\n# {badge_markdown}\n' | ||
import_python = """# %% tags=["remove-cell"] | ||
import importlib | ||
|
||
if not importlib.util.find_spec('mrpro'): | ||
%pip install mrpro[notebook] | ||
""" | ||
|
||
# the temp files of jupytext have the header which looks like: | ||
# --- | ||
# jupyter: | ||
# jupytext: | ||
# multiple lines... | ||
# --- | ||
# we need to insert the #markdown cell after the header | ||
# insert the badge_pyprocent string after the second occurrence of '# ---' | ||
split_sequence = '# ---\n' | ||
old = file.read_text() | ||
split_text = old.split(split_sequence) | ||
new = ''.join( | ||
[split_text[0], split_sequence, split_text[1], split_sequence, badge_pyprocent, import_python, *split_text[2:]] | ||
) | ||
file.write_text(new) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. white line removed. looks a bit cleaner in the docu |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All changes here are due to basing upon #537