-
Notifications
You must be signed in to change notification settings - Fork 532
[ENH] Sphinx extension to plot workflows #1896
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
Conversation
Example: Also links the resource profile documentation (https://551-17021985-gh.circle-artifacts.com/0/home/ubuntu/work/docs/users/resource_sched_profiler.html) in the user documentation index (#1526) . |
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.
Generally looks fine. In spinxext/plot_workflow.py
, I got as far as run_code
before I found my attention wandering. Can't guarantee there are no problems I missed before that, but nothing glaring.
nipype/utils/filemanip.py
Outdated
""" | ||
Equivalent to bash's mkdir -p | ||
""" | ||
if not os.path.exists(folder): |
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.
You might want to use os.path.isdir
, which will throw an EEXIST
if a non-directory exists.
Codecov Report
@@ Coverage Diff @@
## master #1896 +/- ##
==========================================
- Coverage 72.92% 70.57% -2.35%
==========================================
Files 1061 1059 -2
Lines 53749 53688 -61
Branches 7728 7791 +63
==========================================
- Hits 39194 37888 -1306
- Misses 13341 14416 +1075
- Partials 1214 1384 +170
Continue to review full report at Codecov.
|
nipype/utils/filemanip.py
Outdated
Equivalent to bash's mkdir -p | ||
""" | ||
try: | ||
os.makedirs(folder) |
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.
on py3 we should just use os.makedirs(exist_ok=True)
, (also see bug that was fixed here: https://bugs.python.org/issue21082)
for py2, i'm still worried about race conditions, given that this is something people can start using. how about, just make this a hidden function for the moment and use it in the extension?
Adds a sphinx extension to the nipype installation. After adding
nipype.sphinxext.plot_workflow
to theextensions
list in thedoc/conf.py
, sphinx will parse blocks like:The graph is embedded at the point where the block is placed in the docstring.