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

jupyter notebooks from examples #1778

Closed
wants to merge 7 commits into from
Closed

Conversation

arokem
Copy link
Contributor

@arokem arokem commented Mar 15, 2019

This continues the work in #1022 and supersedes it.

@pep8speaks
Copy link

pep8speaks commented Mar 15, 2019

Hello @arokem, Thank you for updating !

Line 64:9: E722 do not use bare 'except'

Comment last updated at 2019-05-08 19:43:26 UTC

@arokem
Copy link
Contributor Author

arokem commented Mar 15, 2019

Still needs some more cleaning up. The rendered notebooks will include (for example) figure blocks from the original rst and other crufy, so we need to process the cells even further. Will follow up with that, before marking this as "ready for review"

@skoudoro skoudoro added this to the 1.0 milestone Apr 23, 2019
cells.append(textcells[i])
cells.append(codecells[i])
except:
pass
Copy link
Contributor

Choose a reason for hiding this comment

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

just pass is not best practice... :)

"""

file_path = os.path.join(directory, fname)
f = open(file_path, "r")
Copy link
Contributor

Choose a reason for hiding this comment

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

rather use with statement

with open(file_path, 'r') as fp:
    fdata = fp.read()

"""Get the valid examples to be converted"""
flist_name = pjoin(os.path.dirname(os.getcwd()), 'doc', 'examples',
'valid_examples.txt')
flist = open(flist_name, "r")
Copy link
Contributor

Choose a reason for hiding this comment

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

again, rather use with statement

for example in validated_examples:
fullpath = pjoin(EG_SRC_DIR, example)
if not example.endswith(".py"):
print("%s not a python file, skipping." % example)
Copy link
Contributor

Choose a reason for hiding this comment

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

why not using logging module?

@skoudoro skoudoro removed this from the 1.0 milestone Jul 25, 2019
@skoudoro skoudoro mentioned this pull request Mar 29, 2023
4 tasks
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 this pull request may close these issues.

None yet

4 participants