-
Notifications
You must be signed in to change notification settings - Fork 110
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
Log when duration of forward model step is negative #10264
Conversation
CodSpeed Performance ReportMerging #10264 will not alter performanceComparing Summary
|
logger.warning( | ||
"Negative duration in snapshot encountered. " | ||
f"start_time={start_time} end_time={node.data.get(ids.END_TIME)} " | ||
f"delta={delta}" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xjules showed me a trick in 2023, and now I am showing it to you =)
logger.warning( | |
"Negative duration in snapshot encountered. " | |
f"start_time={start_time} end_time={node.data.get(ids.END_TIME)} " | |
f"delta={delta}" | |
) | |
end_time = node.data.get(ids.END_TIME) | |
logger.warning( | |
"Negative duration in snapshot encountered. " | |
f"{start_time=} {end_time=} {delta=}" | |
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in this instance it is not that useful. f"{object=} gives object.__repr__ while I want object.__str__
__str__ '2025-01-01 00:00:00'
__repr__ 'datetime.datetime(2025, 1, 1, 0, 0)'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get why this shouldn't work @JHolba ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it works, but you get different text. I want this representation: '2025-01-01 00:00:00'
.
you can try this in a repl
from datetime import datetime
start = datetime.now()
print("print using {start=}: " f"{start=}")
print("print using start={start}: " f"start={start}")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good, but let's wait for @eivindjahren
Will also log warnings when encountering these issues.
f4d3ce6
to
ef6b6ac
Compare
Set negative durations to 0 in simulation status
Will also log warnings when encountering these issues.
Issue
Resolves #10150
Approach
git rebase -i main --exec 'just rapid-tests'
)When applicable