-
Notifications
You must be signed in to change notification settings - Fork 700
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
Noninteractive run of notebooks and flake8 checks #107
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
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.
Thanks very much for the huge effort in this PR.
Overall looks good to me, I didn't check every single line as it's really too big...
And put some comments inline.
Thanks.
@@ -138,8 +125,8 @@ | |||
"source": [ | |||
"## Setup data directory\n", | |||
"\n", | |||
"You can specify a directory with the `MONAI_DATA_DIRECTORY` environment variable. \n", |
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 these blanks in Markdown doc are to make the next sentence in a new line, that's Markdown gramma I think.
Thanks.
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.
This is going to be tricky to solve, but thanks for pointing it out.
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.
I've committed a temporary fix f7deb35 pending answer from here: mwouts/jupytext#723.
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.
OK, could you please update the PR to ignore the blanks?
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.
I've done that, but I'll have to revert all these accidental changes manually.
Hi @rijobro , Is this PR OK for review again? Thanks. |
hi @Nic-Ma , yes it is now! |
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.
thank you @rijobro for looking into these, this is a major enhancement
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.
Thanks for your quick update.
Looks good to me.
* start of automatic and update occ. sens. * current progress * current progress * current progress * current progress * vae * models ensemble * layer_wise_learning_rate * gan * 3d_classification * add 3d_segmentation as well as flake * transform speed * autopep8 * update runner * flake8 support added * max_num_epochs->max_epochs * check that max_epochs exists unless not expected * uncomment executing notebook * check pip install * ignore temp files * no noqa for indented import monai * dont check for indented import monai * flake8 changes * magic pip installs * autofixes * use ! instead of % for pip install * so far * current progress. add black, isort, autoflake * current progress * update class lung lesion notebook * class lung lesion * current progress * current progress * finished * finished * remove pip install of pinned pytorch version * = list() to = [] * [DLMED] fix dyunet notebook issue Signed-off-by: Nic Ma <nma@nvidia.com> * correct faulty import * pep8 for dynunet * all working * add missing quotations * remove personal file path * remove NiftiDataset * dont remove EOL whitespace from comments * 2d_classification * re-add spaces * spaces * last spaces * final changes * notification at end * notification on exit * add github action * data subfolder * make folder if necessary * add flake8 to requirements * change test name Co-authored-by: Nic Ma <nma@nvidia.com>
This uses the python package
papermill
to run notebooks.papermill
is used instead ofnbconvert --execute
as it displays a progress bar. Without some sort of progress update, it's impossible to tell if execution is slow or is hanging.Use
sed
to change some variables to 1 to reduce time (e.g.,max_epochs = 180
->max_epochs = 1
).Use jupytext to internally convert from notebook (
*.ipynb
) into script (*.py
). From here,flake8
is used for checking PEP8 compliance, andautopep8
,isort
,black
andautoflake
are used for autofixes.This PR also contains all the changes to make the notebooks PEP8 compliant.
The most important file to review here is the
runner.sh
script. All other files are hopefully only PEP8 changes, but I would be grateful for any checks to make sure I haven't done anything silly.Example usage: