Skip to content

Commit a08ee57

Browse files
committed
🚸 Don't restrict nan timestamps to predetermined options
1 parent fa65caf commit a08ee57

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

nipype/utils/draw_gantt_chart.py

+10-5
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,20 @@ def calculate_resource_timeseries(events, resource):
138138
all_res = 0.0
139139

140140
# Iterate through the events
141-
nan = {"Unknown", "N/A"}
142141
for _, event in sorted(events.items()):
143142
if event["event"] == "start":
144-
if resource in event and event[resource] not in nan:
145-
all_res += float(event[resource])
143+
if resource in event:
144+
try:
145+
all_res += float(event[resource])
146+
except ValueError:
147+
next
146148
current_time = event["start"]
147149
elif event["event"] == "finish":
148-
if resource in event and event[resource] not in nan:
149-
all_res -= float(event[resource])
150+
if resource in event:
151+
try:
152+
all_res -= float(event[resource])
153+
except ValueError:
154+
next
150155
current_time = event["finish"]
151156
res[current_time] = all_res
152157

0 commit comments

Comments
 (0)