Skip to content
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

Fix ICP cutoff badness #2467

Merged
merged 1 commit into from
Nov 2, 2017
Merged

Conversation

matthewrmshin
Copy link
Contributor

Reported via email by @benfitzpatrick. The new test would fail on current master.

@matthewrmshin matthewrmshin added the bug Something is wrong :( label Nov 1, 2017
@matthewrmshin matthewrmshin added this to the next release milestone Nov 1, 2017
@matthewrmshin matthewrmshin self-assigned this Nov 1, 2017
@matthewrmshin
Copy link
Contributor Author

It was broken by one of my recent optimisation refactor changes.

@matthewrmshin
Copy link
Contributor Author

(Test failure related to pycodestyle, see #2465 fix.)

@@ -1562,7 +1562,7 @@ def generate_triggers(self, lexpression, left_nodes, right, seq,
ltaskdef.intercycle_offsets.add((None, seq))
else:
ltaskdef.intercycle_offsets.add(
(str(first_point - last_point), seq))
(str(-(last_point - first_point)), seq))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fix here. It is basically a revert of a recent change.

# There aren't any dependent tasks in other cycles for my_point.
return my_point
# There aren't any dependent tasks in other cycles for point.
return point
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was originally looking at this method for clues of what went wrong, hence the minor refactor. There is actually nothing wrong with this method, apart from the rather awkward interface, which is simplified somewhat in this change.

@hjoliver
Copy link
Member

hjoliver commented Nov 1, 2017

Can you explain exactly what problem was caused by this bug?

@matthewrmshin
Copy link
Contributor Author

Yes. first_point - last_point gave the nonsense answer P-1DT18H. -(last_point - first_point) gives the correct answer -PT6H. I guess this is ultimately a bug (or known badness?) in the isodatetime library.

@benfitzpatrick
Copy link
Contributor

That does sound like a bad bug.

Copy link
Member

@oliver-sanders oliver-sanders left a comment

Choose a reason for hiding this comment

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

Test failure is due to a deprecation notice fixed by #2465.

@benfitzpatrick
Copy link
Contributor

See metomi/isodatetime#82

@hjoliver
Copy link
Member

hjoliver commented Nov 2, 2017

(Travis CI fail is just due to pep8 -> pycodestyle)

@hjoliver hjoliver merged commit b27a323 into cylc:master Nov 2, 2017
@matthewrmshin matthewrmshin deleted the fix-icp-cutoff-badness branch November 2, 2017 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is wrong :(
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants