gafusion / omas

Ordered Multidimensional Array Structure
http://gafusion.github.io/omas
MIT License
30 stars 15 forks source link

Plot label offsets can be iterable #114

Closed eldond closed 4 years ago

eldond commented 4 years ago
ods = OMFIT['efitviewer']['efitviewer_ods']  # Get an ODS with some slices in it somehow
label_r_shift = [
    0,
    0.25,
    [0.5, 0],
    [0.5, -0.25],
]
axs, axsf = square_subplots(len(label_r_shift), sharex=True, sharey=True)
for i in range(len(label_r_shift)):
    ax = axsf[i]
    ods.plot_equilibrium_CX(time_index=50, ax=ax)  # It doesn't matter which slice; just pick one
    ods.plot_gas_injection_overlay(which_gas=['GASA', 'PFX1'], label_r_shift=label_r_shift[i], ax=ax)
    ax.set_title(label_r_shift[i])

image

orso82 commented 4 years ago

@eldond can you add a figure to this PR that illustrates this new feature. Also as a minor comment and request, in general, could you please add an empty line between each :param ...: in the docstrings.

orso82 commented 4 years ago

@eldond looks good. Let me know if you are done and want it merged.

eldond commented 4 years ago

@orso82 As soon as it passes. Might be slow because I'm on vacation or whatever. Can't resist a spot of coding before the kids wake up, though.

codecov[bot] commented 4 years ago

Codecov Report

Merging #114 into master will decrease coverage by 0.93%. The diff coverage is 96.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #114      +/-   ##
==========================================
- Coverage   77.57%   76.64%   -0.94%     
==========================================
  Files          46       46              
  Lines        8563     9202     +639     
==========================================
+ Hits         6643     7053     +410     
- Misses       1920     2149     +229     
Impacted Files Coverage Δ
omas/omas_plot.py 73.51% <96.29%> (-0.04%) :arrow_down:
omas/omas_sample.py 99.41% <100.00%> (+<0.01%) :arrow_up:
omas/omas_uda.py 12.16% <0.00%> (-0.34%) :arrow_down:
omas/omas_structure.py 14.57% <0.00%> (+0.38%) :arrow_up:
omas/omas_setup.py 87.01% <0.00%> (+1.09%) :arrow_up:
omas/omas_imas.py 24.25% <0.00%> (+3.43%) :arrow_up:
omas/omas_core.py 88.56% <0.00%> (+3.78%) :arrow_up:
omas/examples/save_load_all.py 83.33% <0.00%> (+4.16%) :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 c09acd4...de2095c. Read the comment docs.

eldond commented 4 years ago

@orso82 I'm guessing these coverage changes in files I didn't touch are due to master being updated while I had this open. I recommend either merging master in here if you care about this in detail, or just merging this into master now because I think it's done.