|
6 | 6 |
|
7 | 7 | import matplotlib.pyplot as plt |
8 | 8 |
|
9 | | -from . import _helpers, conf |
| 9 | +from . import _helpers |
| 10 | +from .config import Config |
10 | 11 | from .stagyydata import StagyyData |
11 | 12 |
|
12 | 13 | if typing.TYPE_CHECKING: |
13 | | - from typing import Sequence |
| 14 | + from typing import Optional, Sequence |
14 | 15 |
|
15 | 16 | from ._step import Step, _Rprofs |
16 | 17 |
|
17 | 18 |
|
18 | | -def plot_rprofs(rprofs: _Rprofs, names: Sequence[Sequence[Sequence[str]]]) -> None: |
| 19 | +def plot_rprofs( |
| 20 | + rprofs: _Rprofs, |
| 21 | + names: Sequence[Sequence[Sequence[str]]], |
| 22 | + conf: Optional[Config] = None, |
| 23 | +) -> None: |
19 | 24 | """Plot requested radial profiles. |
20 | 25 |
|
21 | 26 | Args: |
22 | 27 | rprofs: a radial profile collection, such as :attr:`Step.rprofs` or |
23 | 28 | :attr:`_StepsView.rprofs_averaged`. |
24 | 29 | names: profile names organized by figures, plots and subplots. |
25 | 30 | """ |
| 31 | + if conf is None: |
| 32 | + conf = Config.default_() |
26 | 33 | stepstr = rprofs.stepstr |
27 | 34 | sdat = rprofs.step.sdat |
28 | 35 |
|
@@ -97,14 +104,16 @@ def cmd() -> None: |
97 | 104 | conf.rprof |
98 | 105 | conf.core |
99 | 106 | """ |
| 107 | + from . import conf |
| 108 | + |
100 | 109 | sdat = StagyyData(conf.core.path) |
101 | 110 |
|
102 | 111 | if conf.rprof.grid: |
103 | 112 | for step in sdat.walk.filter(rprofs=True): |
104 | 113 | plot_grid(step) |
105 | 114 |
|
106 | 115 | if conf.rprof.average: |
107 | | - plot_rprofs(sdat.walk.rprofs_averaged, conf.rprof.plot) |
| 116 | + plot_rprofs(sdat.walk.rprofs_averaged, conf.rprof.plot, conf) |
108 | 117 | else: |
109 | 118 | for step in sdat.walk.filter(rprofs=True): |
110 | | - plot_rprofs(step.rprofs, conf.rprof.plot) |
| 119 | + plot_rprofs(step.rprofs, conf.rprof.plot, conf) |
0 commit comments