Skip to content

FIX: Consistent treatment of timestamps in Gantt chart visualization #2769

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

Closed
wants to merge 0 commits into from

Conversation

dPys
Copy link

@dPys dPys commented Nov 5, 2018

Timestamps in run_stats.log are saved as strings, but previously these functions directly treated the timestamps as datetime objects. This has now been corrected across all functions.

Summary

Fixes # .

List of changes proposed in this PR (pull-request)

Acknowledgment

  • (Mandatory) I acknowledge that this contribution will be available under the Apache 2 license.

@effigies effigies added this to the 1.1.7 milestone Nov 26, 2018
@effigies effigies modified the milestones: 1.1.7, 1.1.8 Dec 14, 2018
Copy link
Member

@effigies effigies left a comment

Choose a reason for hiding this comment

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

Hi @dPys. Sorry for taking so long to look at this. If you're interested in getting this in for the next release, we'll need to get the tests working. I had a quick read through, and have some comments. Have you tested this locally?

Also, you'll almost certainly want to merge master at this point.

@@ -81,6 +83,9 @@ def create_event_dict(start_time, nodes_list):
events[start_delta] = start_node
events[finish_delta] = finish_node

del node_start
del node_finish
Copy link
Member

Choose a reason for hiding this comment

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

It shouldn't be necessary to delete these objects.

all_res += float(event[resource])
try:
all_res += float(event[resource])
except:
Copy link
Member

Choose a reason for hiding this comment

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

What's the exception-producing case?

'node_start': node_start.strftime("%Y-%m-%d %H:%M:%S"),
'node_finish': node_finish.strftime("%Y-%m-%d %H:%M:%S")
'node_start': node_start,
'node_finish': node_finish
Copy link
Member

Choose a reason for hiding this comment

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

This seems to be replacing a string with a datetime object. Is that intended? It will now be formatted with str(node_start) and str(node_finish) in the format string below:

new_node = "<div class='node' style='left:%(left)spx;top:%(offset)spx;"\
    ...
    "start:%(node_start)s\nend:%(node_finish)s'></div>" %
    node_dict

I'm not sure that's desirable. strftime is insensitive to changes in datetime.__str__ across versions.

@@ -304,6 +316,9 @@ def draw_nodes(start, nodes_list, cores, minute_scale, space_between_minutes,
# Append to output result
result += new_node

del node_start
del node_finish
Copy link
Member

Choose a reason for hiding this comment

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

Again, no real need to delete these that I can see.

'start': ts_start.strftime('%Y-%m-%d %H:%M:%S'),
'finish': ts_end.strftime('%Y-%m-%d %H:%M:%S')
'start': ts_start,
'finish': ts_end
Copy link
Member

Choose a reason for hiding this comment

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

Same as above.

@@ -138,14 +137,20 @@ def log_nodes_cb(node, status):
import logging
import json

# Address nested case
if isinstance(node.result.runtime, (list,)):
resrunlist = node.result.runtime[0]
Copy link
Member

Choose a reason for hiding this comment

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

resrunlist is a single runtime, not a list. Let's just go with result_runtime as variable name.

# Address nested case
if isinstance(node.result.runtime, (list,)):
resrunlist = node.result.runtime[0]
except:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
except:
else:

@effigies effigies changed the title Fix gantt chart viz FIX: Consistent treatment of timestamps in Gantt chart visualization Jan 3, 2019
@effigies
Copy link
Member

Hi, just a reminder that the 1.1.8 release is targeted for January 28. Please let us know if you'd like to try to finish this up for that release.

@effigies effigies mentioned this pull request Jan 25, 2019
16 tasks
@effigies effigies modified the milestones: 1.1.8, future Jan 27, 2019
@dPys dPys closed this Jan 3, 2020
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.

2 participants