-
Notifications
You must be signed in to change notification settings - Fork 3
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
Report maps #38
Report maps #38
Conversation
… adding geoplot dependency
… adding test coverage for this bug
… geos dependency issue
… valuerrror to see image diff thresholds
… to activate mamba env
…re distinct, updating expected maps
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.
Approve
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.
Approve
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #38 +/- ##
==========================================
+ Coverage 39.76% 45.04% +5.28%
==========================================
Files 45 47 +2
Lines 3913 4333 +420
Branches 662 697 +35
==========================================
+ Hits 1556 1952 +396
- Misses 2331 2348 +17
- Partials 26 33 +7
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
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.
Excellent work as always Mike, especially with the documentation piece. Huge kudos to you for being thorough with that.
The image comparison functions are fascinating... did you design those on your own? Never thought to do a hash comparison of the images. I guess you'd have to re-generate those test plots if you ever make an update to the plotting functions though... hopefully that won't happen too often.
Some minor comments below, feel free to ignore
…silencing warning
…th option to disable this behavior
…fered extent is in consistent units. adding note in docs about boundaries CRS
Thanks Paul, I appreciate the thorough review! RE: The image comparison - I pieced those together with some trial and error and examples from stack overflow. I did try to research the "proper" way to test plotting functions. Interestingly, the prevailing advice seems to be NOT to test their outputs at all, due to the imprecisions introduced by different OSes, etc. Instead, most people advise to just assume the plotting is working right and test that the correct functions are being called. I wasn't thrilled about skipping these tests though, and I'd already worked out the logic, so I decided to leave it in. For what it's worth, it does require regenerating the images every now and then, which is annoying but not that tedious. Also, the image hash comparisons due take some tweaking to get them to work across the os matrix in the github workflows. |
I see. Good to know about the general opinions and why you decided to keep it anyways. I think it's perfectly fine the way it is for now. If there are any annoyances with it in the future, we can deal with it then. Good stuff! |
…pi on test_plots images for smaller file size and less sensitive tests
This PR adds functionality for creating report/presentation quality maps for supply curves. It includes the addition of two new CLI commands:
make-maps
andmap-column
which enable simple map generation from a supply curve. The underlyingreView.utils.plots.map_geodataframe_column
can also be used for producing more bespoke or customized maps. TheUSAGE.md
has been updated with details on all of this.In addition to the new functionality, I also had to make some changes to the github workflows to support adding
cartopy
(viageoplot
) as a dependency. Unfortunately,cartopy
has a dependency onGEOS
, but unlike other libraries, likeshapely
, it does not have wheels pre-built withGEOS
binaries included. This means that for the test workflows to run,GEOS
must be installed separately ahead of the Python installation, and for each OS, the way to do this differed. In addition to these necessary changes, I also changed the linting and codecov workflows so they only run on PRs, since doing them for each push seems overkill and potentially quite resource consuming.The
tests
folder also includes a lot of changes since I added several "expected" output images for the various tests related to the new mapping functionality.