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

Adopt PEP8 in MONAI/examples/notebooks/ #102

Closed
Warvito opened this issue Apr 23, 2020 · 5 comments · Fixed by Project-MONAI/MONAI#301
Closed

Adopt PEP8 in MONAI/examples/notebooks/ #102

Warvito opened this issue Apr 23, 2020 · 5 comments · Fixed by Project-MONAI/MONAI#301

Comments

@Warvito
Copy link
Contributor

Warvito commented Apr 23, 2020

Is your feature request related to a problem? Please describe.
Some notebooks are not following the PEP8 style guide.

Describe the solution you'd like
Please, consider following the PEP8 style guide in the notebooks from MONAI/examples/notebooks/.
For example, in examples/notebooks/mednist_tutorial.ipynb, cell 4 has variables named using the CamelCase style instead snake_case (https://www.python.org/dev/peps/pep-0008/#id45), for example:

dataDir = './MedNIST/'
classNames = os.listdir(dataDir)
numClass = len(classNames)

Later, in the same notebook, the snake_case is adopted.

train_ds = MedNISTDataset(trainX, trainY, train_transforms)
train_loader = DataLoader(train_ds, batch_size=300, shuffle=True, num_workers=10)

val_ds = MedNISTDataset(valX, valY, val_transforms)
val_loader = DataLoader(val_ds, batch_size=300, num_workers=10)
@Warvito
Copy link
Contributor Author

Warvito commented Apr 23, 2020

Please, also consider make consistent:

@tvercaut
Copy link
Member

tvercaut commented Apr 23, 2020

This could be relevant to run flake8 on the notebooks:
https://stackoverflow.com/questions/26126853/verifying-pep8-in-ipython-notebook-code

@Nic-Ma
Copy link
Contributor

Nic-Ma commented Apr 24, 2020

Hi @Warvito ,

Thanks very much for your bug report!
I already submitted PR Project-MONAI/MONAI#301 to fix the issues in all the examples and notebooks, mainly include:

  1. CamelCase style.
  2. some missing blank space.
  3. unify to use single quote.
  4. unify to use string.format().
  5. some missing dependencies in notebook.

Welcome to review the PR if you have interest.
Thanks.

@wyli
Copy link
Contributor

wyli commented May 6, 2020

this is still an issue and I think we need a more 'systematic' solution... Project-MONAI/MONAI#340 Project-MONAI/MONAI#346 only address those .py files

@wyli wyli reopened this May 6, 2020
@wyli wyli transferred this issue from Project-MONAI/MONAI Jan 11, 2021
@wyli
Copy link
Contributor

wyli commented Jan 27, 2021

addressed by #107

@wyli wyli closed this as completed Jan 27, 2021
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 a pull request may close this issue.

4 participants