-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
API Allow HomogUniv.plot to forward kwargs to mpl plots
Closes #424 Passing drawstyle and steps perform the same actions and are supported for now. Only drawstyle will be supported in the future but for now silently raise a pending deprecation notice
- Loading branch information
1 parent
628f81e
commit b9d88a3
Showing
6 changed files
with
72 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import pytest | ||
from serpentTools.settings import rc | ||
from serpentTools.data import readDataFile | ||
|
||
from . import compare_or_update_plot | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
def univ(): | ||
with rc: | ||
rc["serpentVersion"] = "2.1.30" | ||
reader = readDataFile("InnerAssembly_res.m") | ||
yield reader.universes["0", 0, 0, 0] | ||
|
||
|
||
@compare_or_update_plot | ||
def test_homoguniv_single(univ): | ||
univ.plot("infTot", label="Total", legend=True) | ||
|
||
|
||
@compare_or_update_plot | ||
def test_homoguniv_multi(univ): | ||
univ.plot( | ||
["infAbs", "infTot"], | ||
logx=False, | ||
logy=False, | ||
labelFmt="{u} @ {b} MWd/kgU // {d} days // step {i}: {k}", | ||
xlabel="Incident energy (MeV)", | ||
ylabel="Macroscopic cross section (cm$^{-1})$", | ||
# Addtional arguments to pass along to the underlying plot | ||
linestyle="--", | ||
) | ||
|
||
|
||
@compare_or_update_plot | ||
def test_homoguniv_multi_named(univ): | ||
univ.plot( | ||
["infAbs", "infFlx"], | ||
labels=["Absorption", "Flux"], | ||
) |