Skip to content

Commit

Permalink
REF: Handle absence/presence of tzinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
shnizzedy committed Nov 18, 2024
1 parent 68b5913 commit b35aa95
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
11 changes: 5 additions & 6 deletions nipype/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,11 @@ def get_nipype_gitversion():
"""

# versions
NIBABEL_MIN_VERSION = "2.1.0"
NETWORKX_MIN_VERSION = "2.0"
NUMPY_MIN_VERSION = "1.17"
NUMPY_MAX_VERSION = "2.0"
SCIPY_MIN_VERSION = "0.14"
TRAITS_MIN_VERSION = "4.6"
NIBABEL_MIN_VERSION = "3.0"
NETWORKX_MIN_VERSION = "2.5"
NUMPY_MIN_VERSION = "1.21"
SCIPY_MIN_VERSION = "1.8"
TRAITS_MIN_VERSION = "6.2"
DATEUTIL_MIN_VERSION = "2.2"
SIMPLEJSON_MIN_VERSION = "3.8.0"
PROV_MIN_VERSION = "1.5.2"
Expand Down
9 changes: 8 additions & 1 deletion nipype/utils/draw_gantt_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,14 @@ def draw_nodes(start, nodes_list, cores, minute_scale, space_between_minutes, co
# Left
left = 60
for core in range(len(end_times)):
if end_times[core] < node_start:
try:
end_time_condition = end_times[core] < node_start
except TypeError:

Check warning on line 307 in nipype/utils/draw_gantt_chart.py

View check run for this annotation

Codecov / codecov/patch

nipype/utils/draw_gantt_chart.py#L305-L307

Added lines #L305 - L307 were not covered by tests
# if one has a timezone and one does not
end_time_condition = end_times[core].replace(

Check warning on line 309 in nipype/utils/draw_gantt_chart.py

View check run for this annotation

Codecov / codecov/patch

nipype/utils/draw_gantt_chart.py#L309

Added line #L309 was not covered by tests
tzinfo=None
) < node_start.replace(tzinfo=None)
if end_time_condition:

Check warning on line 312 in nipype/utils/draw_gantt_chart.py

View check run for this annotation

Codecov / codecov/patch

nipype/utils/draw_gantt_chart.py#L312

Added line #L312 was not covered by tests
left += core * 30
end_times[core] = datetime.datetime(
node_finish.year,
Expand Down

0 comments on commit b35aa95

Please sign in to comment.