nipype
                                
                                 nipype copied to clipboard
                                
                                    nipype copied to clipboard
                            
                            
                            
                        generate_gantt_chart fails on logfile
Summary
generate_gantt_chart fails on generating charts based on profiler log file
Actual behavior
Exception occurs:
Traceback (most recent call last): File "./profiler_chart.py", line 2, in
generate_gantt_chart('/mnt/connectomics/profiler.log', cores=4) File "/home/siegfriedwagner/.local/lib/python3.6/site-packages/nipype-1.2.0-py3.6.egg/nipype/utils/draw_gantt_chart.py", line 507, in generate_gantt_chart duration = (last_node['finish'] - start_node['start']).total_seconds() TypeError: unsupported operand type(s) for -: 'str' and 'str' 
Expected behavior
Graph generates flawlessly
How to replicate the behavior
Run script presented bellow on log from https://gist.github.com/SiegfriedWagner/891bb05bff3cb8224f23915634672a83
Script/Workflow details
from nipype.utils.draw_gantt_chart import generate_gantt_chart generate_gantt_chart('profiler.log', cores=4)
Platform details:
{'commit_hash': 'a0f756d1c',
 'commit_source': 'installation',
 'networkx_version': '2.3',
 'nibabel_version': '2.4.1',
 'nipype_version': '1.2.0',
 'numpy_version': '1.17.0',
 'pkg_path': '/home/siegfriedwagner/.local/lib/python3.6/site-packages/nipype-1.2.0-py3.6.egg/nipype',
 'scipy_version': '1.3.0',
 'sys_executable': '/usr/bin/python',
 'sys_platform': 'linux',
 'sys_version': '3.6.8 (default, Jan 14 2019, 11:02:34) \n'
                '[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]]',
 'traits_version': '5.1.2'}
Execution environment
Choose one
- My python environment outside container
I ran into this issue as well and fixed it for my own purpose. I'll put in a PR with the fix.
With the changes in #3290,
from nipype.utils.draw_gantt_chart import generate_gantt_chart
generate_gantt_chart('profiler.log', cores=4)
with profiler.log from this issue results in a chart like this:

In the PR's comments, the issue of the large values in runtime_threads in the logfile is noted.