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 pl plotting #55

Merged
merged 16 commits into from
Feb 11, 2024
Merged

Fix pl plotting #55

merged 16 commits into from
Feb 11, 2024

Conversation

catanzaromj
Copy link
Contributor

This PR fixes numerous bugs with plotting persistence landscapes. In particular

  • user specified labels for coordinate axes now work,
  • doc strings are cleaned up and now on publicly accessible methods,
  • added a depth_range parameter so a subset of landscape functions can be plotted,
  • padding previously incorrectly changed landscape function values,
  • updated 3d axes call to remove deprecation error.

A max_depth attribute has also been added to PersLandscapeApprox and the notebooks were updated.

Please pass along any comments you have. Thanks.

The previous label keyword had no effect; this fixes that and adds doc string entries for labels.
The tick marks on the y-axis (corresponding to depth of the landscapes) were completely off and mislabeled.
The new 'depth_range' parameter allows the user to specify a range of depths to be plotted.
Omitting it plots all depths.
The doc strings were previously in the helper functions, which were not
publicly accessible. Move the docstrings into the two main plotting functions
and clean up the signatures of the plotting functions.
The previous way of padding the figures changed their values slightly. The 'padding' parameter now
adds a slight margin to the plot, especially useful for 2-d 'simple' plots.
`depth_spacing` caused overcrowding issues with labelling. If it needs to be modified, it should be
done on a case by case basis by passing an axis.
@codecov
Copy link

codecov bot commented Jan 16, 2022

Codecov Report

Attention: 46 lines in your changes are missing coverage. Please review.

Comparison is base (e1fb188) 75.84% compared to head (7da61f4) 74.52%.

Files Patch % Lines
persim/landscapes/visuals.py 0.00% 46 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #55      +/-   ##
==========================================
- Coverage   75.84%   74.52%   -1.32%     
==========================================
  Files          20       20              
  Lines        1453     1480      +27     
  Branches      315      327      +12     
==========================================
+ Hits         1102     1103       +1     
- Misses        293      319      +26     
  Partials       58       58              

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

@sauln
Copy link
Member

sauln commented Jan 30, 2022

Hi @catanzaromj, these changes look great. Once the tests are passing we can merge. Though it looks like the test failure might be unrelated, you should be able to fix it using numpy.testing.assert_almost_equal.

Thank you!

Fix failed `test_repeated`, add test for new `max_depth` attribute.
@catanzaromj
Copy link
Contributor Author

catanzaromj commented Feb 2, 2022

@sauln No problem. Let me know if there's anything else. Thanks!

@catanzaromj
Copy link
Contributor Author

@sauln Is there anything else needed?

@catanzaromj
Copy link
Contributor Author

The test coverage dropping will be covered in a future PR.

@catanzaromj catanzaromj merged commit f58729c into scikit-tda:master Feb 11, 2024
7 of 9 checks passed
@catanzaromj catanzaromj deleted the fix_pl_plotting branch March 6, 2024 13:11
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