Closed mikekryjak closed 5 months ago
Merging #280 (5391d64) into master (212b407) will decrease coverage by
1.24%
. The diff coverage is4.76%
.
:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.
@@ Coverage Diff @@
## master #280 +/- ##
==========================================
- Coverage 68.94% 67.71% -1.24%
==========================================
Files 15 15
Lines 3214 3277 +63
Branches 792 808 +16
==========================================
+ Hits 2216 2219 +3
- Misses 734 793 +59
- Partials 264 265 +1
Impacted Files | Coverage Δ | |
---|---|---|
xbout/geometries.py | 68.87% <0.00%> (-1.08%) |
:arrow_down: |
xbout/plotting/plotfuncs.py | 16.19% <1.75%> (-2.48%) |
:arrow_down: |
xbout/boutdataarray.py | 78.20% <50.00%> (-0.16%) |
:arrow_down: |
xbout/region.py | 83.59% <100.00%> (+0.03%) |
:arrow_up: |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
Hello @mikekryjak! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
xbout/plotting/plotfuncs.py
:Line 886:89: E501 line too long (90 > 88 characters) Line 894:89: E501 line too long (103 > 88 characters) Line 914:89: E501 line too long (90 > 88 characters) Line 935:23: E711 comparison to None should be 'if cond is None:' Line 938:22: E711 comparison to None should be 'if cond is not None:'
xbout/plotting/utils.py
:Line 124:89: E501 line too long (116 > 88 characters)
xbout/tests/test_against_collect.py
:Line 223:37: E701 multiple statements on one line (colon)
xbout/tests/test_load.py
:Line 475:5: E704 multiple statements on one line (def) Line 625:5: E704 multiple statements on one line (def)
This is ready for review & merge
xBOUT's default pcolormesh() method creates plotting artifacts around the X-point due to having to plot the grid on a per-region basis and not having corner information.
This new method uses a different approach, and is more like what UEDGE, SOLEDGE2D and SOLPS users do. Using coordinates of cell centres and cell corners, a Matplotlib Polygon is created for each cell independently and put into a PatchCollection . With each cell being independently plotted, there are no issues arising from the poloidal ordering of the cells or from the X-point.
The polygon plotting routine was adapted from this PR which was itself based on a UEDGE routine. The cell corners were obtained using this Hypnotoad PR. It adds a new plot method accessed by
da.bout.polygon()
which creates fast, pretty 2D plots without visual artefacts around the X-point.geometry.py
plot2d_polygon
inplotfuncs.py
Decided to not integrate it with
plot2d_wrapper
aspolygon
doesn't plot on a region basis and does not wrap Xarray plot routines.There is an additional improvement where I fixed the colorbar to be always exactly the height of the plot using a hack from https://joseph-long.com/writing/colorbars/.
I also changed the default style - I disabled the targets and limiter hatching and made the separatrix a continuous thin white line. I personally think this is a cleaner look, but I understand this is personal preference. If anyone has strong feelings about this I'm happy to make the previous look the default.
Example output: