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 typing, fix 2D plotting issues #896

Merged
merged 8 commits into from
Jul 23, 2024
Merged

fix typing, fix 2D plotting issues #896

merged 8 commits into from
Jul 23, 2024

Conversation

IAlibay
Copy link
Member

@IAlibay IAlibay commented Jul 21, 2024

TODO:

  • Need to check that the switch to flatten calls do what is expected
  • Add some tests

Checklist

  • Added a news entry

Developers certificate of origin

text=f"{i}",
xy=(i + 0.5, 1),
xytext=(i + 0.5, num_states + 0.5),
xycoords='data',
Copy link
Member Author

Choose a reason for hiding this comment

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

Adding the defaults is a bit much, but thought I might as well be explicit... thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

I like it!

@@ -278,15 +294,15 @@ def plot_2D_rmsd(data: list[list[float]],
fig, axes = plt.subplots(nrows, 4)

for i, (arr, ax) in enumerate(
zip(twod_rmsd_arrs, chain.from_iterable(axes))):
zip(twod_rmsd_arrs, axes.flatten())): # type: ignore
Copy link
Member Author

Choose a reason for hiding this comment

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

for some reason the return type for axes can be Axes | ndarray, but in our use case we always have ndarray (because we set ncols to 4).

Copy link

codecov bot commented Jul 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.36%. Comparing base (cc5ed8c) to head (1b88fd0).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #896      +/-   ##
==========================================
- Coverage   93.98%   92.36%   -1.62%     
==========================================
  Files         134      134              
  Lines        9790     9800      +10     
==========================================
- Hits         9201     9052     -149     
- Misses        589      748     +159     
Flag Coverage Δ
fast-tests 92.36% <100.00%> (?)
slow-tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@IAlibay
Copy link
Member Author

IAlibay commented Jul 23, 2024

The plots aren't great, but at least they work now:

9 states:
image

4 states:
image

Copy link
Contributor

@mikemhenry mikemhenry left a comment

Choose a reason for hiding this comment

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

Looks nicer! I think these changes warrant a change log entry

Copy link
Contributor

@hannahbaumann hannahbaumann left a comment

Choose a reason for hiding this comment

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

The plots look good to me!

@IAlibay
Copy link
Member Author

IAlibay commented Jul 23, 2024

Thanks both!

@mikemhenry changelog entry is done.

@mikemhenry mikemhenry enabled auto-merge (squash) July 23, 2024 23:19
@mikemhenry mikemhenry merged commit 7615ccc into main Jul 23, 2024
12 checks passed
@mikemhenry mikemhenry deleted the fix-mypy branch July 23, 2024 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants