-
Notifications
You must be signed in to change notification settings - Fork 10
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
DM-48600: Add helper function for parsing metadata added by timeMethod #199
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #199 +/- ##
==========================================
+ Coverage 94.19% 94.21% +0.02%
==========================================
Files 47 47
Lines 3463 3476 +13
==========================================
+ Hits 3262 3275 +13
Misses 201 201 ☔ View full report in Codecov by Sentry. |
fda5220
to
6d67ac0
Compare
dae3749
to
37d54e2
Compare
python/lsst/utils/timer.py
Outdated
@@ -480,3 +479,33 @@ def profile(filename: str | None, log: LsstLoggers | None = None) -> Iterator[cP | |||
profile.dump_stats(filename) | |||
if log is not None: | |||
log.info("cProfile stats written to %s", filename) | |||
|
|||
|
|||
def durationFromTimeMethod( |
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.
Please use underscores in names and variables for new functions in this package.
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.
@timj Since this is a helper function that works with the results of timeMethod
, is the name duration_from_timeMethod
OK, or should I just change it to something like calculate_duration
?
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 can live with duration_from_timeMethod
. I should have fixed up the name timeMethod
years ago when I migrated the code to the new location. I've been trying to think of other ways to organize this but we are sort of stymied by the historical baggage of timeMethod not knowing what it's updating and so there not being an obvious class that could have this functionality -- TaskMetadata itself is hamstrung by it having to originally be a PropertySet, whereas if we were doign this now we'd have dedicated facilities in TaskMetadata for task execution metadata.
37d54e2
to
25533b7
Compare
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.
This looks good to me.
Checklist
doc/changes