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: region border plot #199

Merged
merged 3 commits into from
Sep 20, 2022
Merged

fix: region border plot #199

merged 3 commits into from
Sep 20, 2022

Conversation

pabloitu
Copy link
Collaborator

@pabloitu pabloitu commented Sep 19, 2022

fixes #197. Now uses shapely to merge all cell polygons into one, and extract the borders. Floating point issues with coincident cell edges are sorted out by rounding up to 2 decimals.

pyCSEP Pull Request Checklist

Please check out the contributing guidelines for some tips
on making pull requests to pyCSEP.

Fixes issue #197 #200.

Type of change:

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

…ets the boundary of the total region. Bypasses floating point issues by rounding down to 2 decimals
@wsavran
Copy link
Collaborator

wsavran commented Sep 19, 2022

docs are failing the build with this new function. i also think we need to add shapely to the requirements and the build. it's implicitly provided through cartopy but i think we want to explicitly put it with our distribution.

@pabloitu
Copy link
Collaborator Author

actually good that it failed the docs. For some reason it's failing in CA, which i didnt tested. Need to take a look further. Will put shapely in the reqs also.

fix: tight_bbox has option for precision. It is not necessary for lat_lon, but explicited the argument, in case cartesian coordinates were implemented.
build: added shapely as requirement
@pabloitu
Copy link
Collaborator Author

build fail was because of plot_gridded_forecast tutorial, which loaded helmstetter from ascii. In this func, parsing the file made self-intersecting cell polygons. Fixed #200 and now boundaries can be plotted for NZ, Italy and california without problems.

@codecov-commenter
Copy link

codecov-commenter commented Sep 20, 2022

Codecov Report

Base: 55.73% // Head: 55.73% // Decreases project coverage by -0.00% ⚠️

Coverage data is based on head (392850b) compared to base (74106b9).
Patch coverage: 64.70% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #199      +/-   ##
==========================================
- Coverage   55.73%   55.73%   -0.01%     
==========================================
  Files          20       20              
  Lines        3572     3594      +22     
  Branches      569      580      +11     
==========================================
+ Hits         1991     2003      +12     
- Misses       1460     1466       +6     
- Partials      121      125       +4     
Impacted Files Coverage Δ
csep/core/regions.py 47.04% <54.54%> (+0.29%) ⬆️
csep/core/forecasts.py 57.38% <83.33%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@pabloitu pabloitu linked an issue Sep 20, 2022 that may be closed by this pull request
@wsavran wsavran changed the base branch from master to v0.6.1-release-branch September 20, 2022 16:30
@wsavran wsavran changed the base branch from v0.6.1-release-branch to master September 20, 2022 16:30
@wsavran
Copy link
Collaborator

wsavran commented Sep 20, 2022

reviewed the pull request, everything looks good except for 2 pieces. first we need to add shapely to setup.py and the requirements.yml and i'll merge it.

@pabloitu
Copy link
Collaborator Author

done

@wsavran wsavran merged commit bb299b2 into SCECcode:master Sep 20, 2022
@pabloitu pabloitu deleted the region_plot_fix branch September 21, 2022 08:43
wsavran added a commit that referenced this pull request Dec 12, 2022
* Quadtree csv reader (#186)
* New plotting routines (#190)
* Non poissonian tests (#189, #202, #205, #208, #209)
* Fix region border plot (#199)
* Added support for BSI catalog (#201)
* Fix consistency plots (#206)
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.

forecast load_ascii creates non-valid region polygons region borders misplot for concave regions
3 participants