|
8 | 8 |
|
9 | 9 | from dataclasses import dataclass |
10 | 10 | from pathlib import Path |
11 | | -from typing import Dict, Optional, Sequence, Union |
| 11 | +from typing import Dict, Sequence, Union |
12 | 12 |
|
13 | 13 | import loam.parsers as lprs |
14 | 14 | from loam.base import ConfigBase, Section, entry |
@@ -53,15 +53,15 @@ class Core(Section): |
53 | 53 | class Plot(Section): |
54 | 54 | """Plotting.""" |
55 | 55 |
|
56 | | - ratio: Optional[float] = MaybeEntry(float).entry( |
| 56 | + ratio: float | None = MaybeEntry(float).entry( |
57 | 57 | doc="force aspect ratio of field plot", in_file=False |
58 | 58 | ) |
59 | 59 | raster: bool = switch_opt(True, None, "rasterize field plots") |
60 | 60 | format: str = entry(val="pdf", doc="figure format (pdf, eps, svg, png)") |
61 | | - vmin: Optional[float] = MaybeEntry(float).entry( |
| 61 | + vmin: float | None = MaybeEntry(float).entry( |
62 | 62 | doc="minimal value on plot", in_file=False |
63 | 63 | ) |
64 | | - vmax: Optional[float] = MaybeEntry(float).entry( |
| 64 | + vmax: float | None = MaybeEntry(float).entry( |
65 | 65 | doc="maximal value on plot", in_file=False |
66 | 66 | ) |
67 | 67 | cminmax: bool = switch_opt(False, "C", "constant min max across plots") |
@@ -97,18 +97,18 @@ class FieldSec(Section): |
97 | 97 | default="T,stream", cli_short="o", doc="variables to plot (see stagpy var)" |
98 | 98 | ) |
99 | 99 | perturbation: bool = switch_opt(False, None, "plot departure from average profile") |
100 | | - shift: Optional[int] = MaybeEntry(int).entry( |
| 100 | + shift: int | None = MaybeEntry(int).entry( |
101 | 101 | doc="shift plot horizontally", in_file=False |
102 | 102 | ) |
103 | 103 | timelabel: bool = switch_opt(False, None, "add label with time") |
104 | 104 | colorbar: bool = switch_opt(True, None, "add color bar to plot") |
105 | | - ix: Optional[int] = MaybeEntry(int).entry( |
| 105 | + ix: int | None = MaybeEntry(int).entry( |
106 | 106 | doc="x-index of slice for 3D fields", in_file=False |
107 | 107 | ) |
108 | | - iy: Optional[int] = MaybeEntry(int).entry( |
| 108 | + iy: int | None = MaybeEntry(int).entry( |
109 | 109 | doc="y-index of slice for 3D fields", in_file=False |
110 | 110 | ) |
111 | | - iz: Optional[int] = MaybeEntry(int).entry( |
| 111 | + iz: int | None = MaybeEntry(int).entry( |
112 | 112 | doc="z-index of slice for 3D fields", in_file=False |
113 | 113 | ) |
114 | 114 | isocolors: Sequence[str] = TupleEntry(str).entry(doc="list of colors for isolines") |
@@ -151,11 +151,9 @@ class Time(Section): |
151 | 151 | compstat: Sequence[str] = TupleEntry(str).entry( |
152 | 152 | doc="compute mean and rms of listed variables", in_file=False |
153 | 153 | ) |
154 | | - tstart: Optional[float] = MaybeEntry(float).entry( |
155 | | - doc="beginning time", in_file=False |
156 | | - ) |
157 | | - tend: Optional[float] = MaybeEntry(float).entry(doc="end time", in_file=False) |
158 | | - fraction: Optional[float] = MaybeEntry(float).entry( |
| 154 | + tstart: float | None = MaybeEntry(float).entry(doc="beginning time", in_file=False) |
| 155 | + tend: float | None = MaybeEntry(float).entry(doc="end time", in_file=False) |
| 156 | + fraction: float | None = MaybeEntry(float).entry( |
159 | 157 | doc="ending fraction of series to process", in_file=False |
160 | 158 | ) |
161 | 159 | marktimes: Sequence[float] = TupleEntry(float).entry( |
@@ -200,7 +198,7 @@ class Plates(Section): |
200 | 198 | False, None, "plot number of plates as function of time" |
201 | 199 | ) |
202 | 200 | distribution: bool = switch_opt(False, None, "plot plate size distribution") |
203 | | - zoom: Optional[float] = MaybeEntry(float).entry( |
| 201 | + zoom: float | None = MaybeEntry(float).entry( |
204 | 202 | doc="zoom around surface", in_file=False |
205 | 203 | ) |
206 | 204 |
|
|
0 commit comments