Closed dschwoerer closed 3 years ago
# Works (no coordinates)
ds["Ne"].isel(y=0,t=-1).plot.pcolormesh()
# raises: ValueError: Dimensions {'y'} do not exist. Expected one or more of ('x', 'z')
ds["Ne"].isel(y=0,t=-1).bout.pcolormesh()
Is that expected? Any hints what I need to change to fix it?
Merging #228 (e1b1e1c) into fci-geometry (d6fbeaa) will increase coverage by
0.55%
. The diff coverage is66.66%
.
@@ Coverage Diff @@
## fci-geometry #228 +/- ##
================================================
+ Coverage 75.31% 75.86% +0.55%
================================================
Files 15 15
Lines 2702 2702
Branches 631 631
================================================
+ Hits 2035 2050 +15
+ Misses 435 420 -15
Partials 232 232
Impacted Files | Coverage Δ | |
---|---|---|
xbout/region.py | 85.88% <ø> (+1.98%) |
:arrow_up: |
xbout/geometries.py | 72.67% <66.66%> (+2.90%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update d6fbeaa...e1b1e1c. Read the comment docs.
@dschwoerer the PR looks good to me. Error seems a bit odd - can you post a back-trace please? I can't see where the exception is coming from, doesn't seem to actually be in xBOUT...
Ah, actually I think I might know what the problem was. plot2d_wrapper()
https://github.com/boutproject/xBOUT/blob/e1b1e1c6e1abcac20266db83965dde49fb9af164/xbout/plotting/plotfuncs.py#L79
was written to make 'poloidal plane' plots, assuming that the dimensions would be bout_xdim
and bout_ydim
. Actually plot2d_wrapper
is most useful for that case, because it's only when we have an x-y plane that we might need to split up into different regions to plot. The best fix for this error might actually be to fix #167, so we can turn of poloidal_plot
(which should get rid of the error), and check that when poloidal_plot=True
the dimensions are actually bout_xdim
and bout_ydim
.
A workaround, since FCI doesn't use regions, is to just not use the xBOUT method, and instead do something like
ds["Ne"].isel(y=0,t=-1).plot.pcolormesh(x="R", y="Z")
...merging this on the assumption that my previous comment was the cause of the error @dschwoerer reported. We can fix that issue in a future PR.
The test is failing, but with a slighly different error ... but I think this is related to dask ...