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

Extra options for poloidal plots #71

Merged
merged 8 commits into from
Dec 10, 2019
Merged

Conversation

johnomotani
Copy link
Collaborator

Split out 2d-plot changes from #38.

Also specify in docstring what happens if a dict is passed.
'norm' option allows any matplotlib.colors.Normalize instance to be
passed, for general control of the color-scale.

For convenience, also adds a 'logscale' option which can be set to True
to create a standard log-scale if vmin and vmax are both positive or
both negative, and a symmetric log-scale with a linear threshold of
min(abs(vmin),abs(vmax))*1.e-5 if vmin and vmax have opposite signs. If
a float is passed for 'logscale' and vmin and vmax have opposite signs
then the value of 'logscale' is used instead of the default 1.e-5 to set
the linear threshold.
@pep8speaks
Copy link

pep8speaks commented Dec 10, 2019

Hello @johnomotani! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 228:90: E501 line too long (90 > 89 characters)
Line 232:90: E501 line too long (96 > 89 characters)

Comment last updated at 2019-12-10 19:39:19 UTC

xbout/plotting/plotfuncs.py Outdated Show resolved Hide resolved
xbout/plotting/plotfuncs.py Outdated Show resolved Hide resolved
xbout/plotting/plotfuncs.py Outdated Show resolved Hide resolved
@johnomotani
Copy link
Collaborator Author

sorry, gridlines doesn't work at the moment. will debug after the meeting

When setting torodial coordinates, a 'psi_poloidal' coordinate is added,
but the x-dimension is not renamed (as psixy is a 2d array, although its
values only vary in x). Therefore 'bout_xdim' should be 'x' (the name of
the dimension), not 'psi_poloidal'.
@johnomotani johnomotani force-pushed the extra-poloidal-plot-options branch from 7fa6411 to 0f4f7b5 Compare December 10, 2019 14:42
@codecov-io
Copy link

codecov-io commented Dec 10, 2019

Codecov Report

Merging #71 into master will decrease coverage by 1.42%.
The diff coverage is 8.92%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #71      +/-   ##
==========================================
- Coverage   45.15%   43.73%   -1.43%     
==========================================
  Files           8        8              
  Lines         795      862      +67     
  Branches      152      177      +25     
==========================================
+ Hits          359      377      +18     
- Misses        380      429      +49     
  Partials       56       56
Impacted Files Coverage Δ
xbout/geometries.py 74.44% <100%> (ø) ⬆️
xbout/plotting/utils.py 5.43% <13.33%> (+0.52%) ⬆️
xbout/plotting/plotfuncs.py 7.14% <5%> (-2.2%) ⬇️
xbout/plotting/animate.py 61.85% <0%> (+6.97%) ⬆️

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 010274a...d265127. Read the comment docs.

Copy link
Collaborator

@TomNicholas TomNicholas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added one small unimportant comment, otherwise looks good

# Small regions around X-point do not have segments in x- or y-directions,
# so skip
continue
if 'x' in gridlines and gridlines['x'] is not None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just do if gridlines.get('x'): if you want, the default return value of .get() if the key isn't found is None.

@TomNicholas TomNicholas merged commit 00f527d into master Dec 10, 2019
@johnomotani johnomotani deleted the extra-poloidal-plot-options branch December 10, 2019 21:15
johnomotani pushed a commit that referenced this pull request Dec 11, 2019
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.

4 participants