Skip to content

Several fixes and improvements#62

Open
micaeljtoliveira wants to merge 3 commits into
mainfrom
improvements
Open

Several fixes and improvements#62
micaeljtoliveira wants to merge 3 commits into
mainfrom
improvements

Conversation

@micaeljtoliveira

Copy link
Copy Markdown
Member

These fix issues found when updating the ESM1.6 scaling notebook.

@codecov

codecov Bot commented Jun 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (7325277) to head (abeea07).

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #62   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           16        16           
  Lines          948       966   +18     
=========================================
+ Hits           948       966   +18     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@micaeljtoliveira micaeljtoliveira marked this pull request as draft June 2, 2026 01:22

@manodeep manodeep left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

(I know you haven't yet asked for a review - but I did one anyway :D)

Small suggestion to make the test clearer, if you do accept it, the change will need to be applied for the other instances of expected_regions that follow

Comment thread tests/test_experiment.py Outdated
first_dataset = profiling_log.parse()
second_dataset = profiling_log.parse()

expected_regions = ["Region 1", "Region 1_2", "Region 2", "Region 1_3"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
expected_regions = ["Region 1", "Region 1_2", "Region 2", "Region 1_3"]
expected_unique_regions = ["Region 1", "Region 1_2", "Region 2", "Region 1_3"]

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good idea! Done.

@micaeljtoliveira micaeljtoliveira marked this pull request as ready for review June 11, 2026 01:49
@micaeljtoliveira

Copy link
Copy Markdown
Member Author

@manodeep I think this is ready to go, just needs one final review.

@manodeep manodeep left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

With the exception of that one comment, everything else looks good!

For that comment, may be just explain why the double parsing is required

Comment thread tests/test_experiment.py Outdated
Comment on lines +60 to +61
first_dataset = profiling_log.parse()
second_dataset = profiling_log.parse()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why are you parsing twice here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's to increase the odds of catching a non-deterministic relabeling of the regions. Maybe not really worth the trouble though, as those kind of issues are always hard to catch anyway.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ahh right - yeah but I don't think it matters functionally speaking. There are input duplicate region names and those are automatically re-labelled by some algorithm. As long as the region and values don't get separated out, it should be all good. For example, the last "Region 1" could be relabelled as "Region 1_2" but as long as the value corresponding to that remains as "4.0", it should be all fine.

(Thankfully, the existing test would catch such a catastrophic scrambling of the keys and values)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It does matter in some cases, when we aggregate or concatenate data for a given region over different experiments. For example, in a scaling test, it would be problematic if duplicated regions in two different runs would be renamed in a non-deterministic way. Taking the data from the test, if for run 1 the algorithm produced:
["Region 1", "Region 1_2", "Region 2", "Region 1_3"]
and for run 2 it produced:
["Region 1", "Region 1_3", "Region 2", "Region 1_2"]
one would later be concatenating profiling data for regions of code that are not the same.

In any case, I think a test with one dataset is enough. If for some reason the ordering becomes random, the test is bound to fail sooner or later, as the order in the expected values is fixed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@manodeep I've now changed the test to only include one dataset.

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