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

FCI geometry: basic test #228

Merged
merged 4 commits into from
Nov 25, 2021
Merged

FCI geometry: basic test #228

merged 4 commits into from
Nov 25, 2021

Conversation

dschwoerer
Copy link
Contributor

The test is failing, but with a slighly different error ... but I think this is related to dask ...

Make it a bit easier to change the shape consistently for FCI. Also
include guards.
@dschwoerer
Copy link
Contributor Author

# 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?

@codecov-commenter
Copy link

codecov-commenter commented Oct 25, 2021

Codecov Report

Merging #228 (e1b1e1c) into fci-geometry (d6fbeaa) will increase coverage by 0.55%.
The diff coverage is 66.66%.

Impacted file tree graph

@@               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%) ⬆️
xbout/geometries.py 72.67% <66.66%> (+2.90%) ⬆️

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.

@johnomotani
Copy link
Collaborator

@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...

@johnomotani
Copy link
Collaborator

Ah, actually I think I might know what the problem was. plot2d_wrapper()

def plot2d_wrapper(

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")

@johnomotani
Copy link
Collaborator

...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.

@johnomotani johnomotani merged commit 02f3b94 into fci-geometry Nov 25, 2021
@johnomotani johnomotani deleted the fci-geometry-new branch November 25, 2021 17:18
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.

3 participants