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

Remove base plot #38

Merged
merged 18 commits into from
Jun 22, 2022
Merged

Remove base plot #38

merged 18 commits into from
Jun 22, 2022

Conversation

RemDelaporteMathurin
Copy link
Member

Fixes #34

Currently, the functions return a module, which is kinda weird... and a new figure is created at each call, making it impossible to make subplots.

Instead, the functions shouldn't return anything (or maybe the current figure via plt.gcf()?).

The workflow would then be:

import regular_mesh_plotter as rmp
import matplotlib.pyplot as plt

rmp.plot_regular_mesh_tally(
    tally=my_tally,
    std_dev_or_tally_value="tally_value",
)
plt.ylabel("my custom Y label")
plt.plot([1, 2, 3], [1, 2, 3])  # add another plot on top of it
plt.savefig('openmc_mesh_tally_plot.png')

A subplot could be created by:

import regular_mesh_plotter as rmp
import matplotlib.pyplot as plt

fig, axs = plt.subplots(nrows=2, ncols=1)

plt.sca(axs[0])  # set first axis active
rmp.plot_regular_mesh_tally(
    tally=my_tally,
    std_dev_or_tally_value="tally_value",
)

plt.sca(axs[1])  # set second axis active
rmp.plot_regular_mesh_tally(
    tally=my_other_tally,
    std_dev_or_tally_value="tally_value",
)

plt.savefig('openmc_mesh_tally_plot.png')

This workflow is more standard

@shimwell
Copy link
Member

@RemDelaporteMathurin this failing CI is due to a conda bug that has been reported elsewhere. We could fix the CI by using mamba install. I can do this on a new PR

@shimwell
Copy link
Member

Any chance we could branch from develop and merge to develop

@RemDelaporteMathurin RemDelaporteMathurin changed the base branch from main to develop June 22, 2022 08:34
@codecov
Copy link

codecov bot commented Jun 22, 2022

Codecov Report

Merging #38 (3b27fbe) into develop (c5293d7) will not change coverage.
The diff coverage is 0.00%.

@@           Coverage Diff           @@
##           develop     #38   +/-   ##
=======================================
  Coverage     0.00%   0.00%           
=======================================
  Files            3       3           
  Lines          136     126   -10     
=======================================
+ Misses         136     126   -10     
Impacted Files Coverage Δ
regular_mesh_plotter/core.py 0.00% <0.00%> (ø)

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 4a452ef...3b27fbe. Read the comment docs.

@RemDelaporteMathurin RemDelaporteMathurin linked an issue Jun 22, 2022 that may be closed by this pull request
@RemDelaporteMathurin RemDelaporteMathurin merged commit 4556e0a into develop Jun 22, 2022
@RemDelaporteMathurin RemDelaporteMathurin deleted the remove_base_plot branch June 22, 2022 09:08
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.

Bug in README Remove base_plt
2 participants