-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor functions that parse profiling data #44
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #44 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 16 16
Lines 782 791 +9
=========================================
+ Hits 782 791 +9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- replace the parse_profiling_data method with profiling_logs, a method that returns a dict of logs to be parsed - add a _parse_profiling_data_directory helper method to parse all the logs from a given experiment path - ProfilingLogs now have a "optional" property: when parsing optional logs, no error is returned if the file is missing or not data is parsed The PayuManager and CylcRoseManager are updated accordingly.
…nager. These seem generic enough to be move one level up.
f5d374c to
1460245
Compare
…data method. This new method stores the profiling data per experiment, without concatenatng the datasets. The scaling data is then computed on-the-fly when calling plot_scaling_data. - When computing the scaling data on-the-fly when, plot_scaling_data now takes care of filtering the components and regions, and of relabeling the regions. This in turn allows to simplify the plot_scaling_metrics function.
| logger.info(f"Parsing {log_name} profiling log: {log.filepath}. ") | ||
| if log.optional: | ||
| try: | ||
| self.data[exp_name][log_name] = log.parse() |
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.
probably want to include logger.info(" Done.") here for consistency with non-optional logs.
edoyango
left a comment
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.
LGTM!
Some refactoring of the manager code:
profiling_logs, a method that returns a dict of logs to be parsedProfilingLogsnow have a "optional" property: when parsing optional logs, no error is returned if the file is missing or not data is parsedparse_scaling_datawith a more genericparse_profiling_datamethod. This new method parses all the logs from all experiments, then stores the profiling data per experiment, without concatenating the datasets.plot_scaling_data.__init__andparse_ncpusmethods from RAM3Profiling toCylcRoseManager. These seem generic enough to be move one level up.