|
3 | 3 | # This example demonstrates a tentative `attrs`-based object model. |
4 | 4 |
|
5 | 5 | from pathlib import Path |
6 | | -from typing import Any, List, Literal, NamedTuple, Optional |
| 6 | +from typing import List, Literal, Optional |
7 | 7 |
|
8 | 8 | import numpy as np |
9 | | -from attr import asdict, define, field, fields_dict |
| 9 | +from attr import asdict, define, field |
10 | 10 | from cattr import Converter |
11 | 11 | from flopy.discretization import StructuredGrid |
12 | 12 | from numpy.typing import NDArray |
@@ -40,9 +40,7 @@ class Format: |
40 | 40 | digits: int |
41 | 41 | format: Literal["exponential", "fixed", "general", "scientific"] |
42 | 42 |
|
43 | | - periods: List[List[tuple]] = field( |
44 | | - metadata={"block": "perioddata"} |
45 | | - ) |
| 43 | + periods: List[List[tuple]] = field(metadata={"block": "perioddata"}) |
46 | 44 | budget_file: Optional[Path] = field( |
47 | 45 | default=None, metadata={"block": "options"} |
48 | 46 | ) |
@@ -129,7 +127,7 @@ def _check_dims(self, attribute, value): |
129 | 127 |
|
130 | 128 | oc = GwfOc( |
131 | 129 | budget_file="some/file/path.cbc", |
132 | | - periods=[[("print", "budget", "steps", 1, 3, 5)]] |
| 130 | + periods=[[("print", "budget", "steps", 1, 3, 5)]], |
133 | 131 | ) |
134 | 132 | assert isinstance(oc.budget_file, str) # TODO path |
135 | 133 |
|
|
0 commit comments