|
2 | 2 | from typing import Optional |
3 | 3 |
|
4 | 4 | import numpy as np |
5 | | -from attrs import define |
| 5 | +from attrs import Converter, define |
6 | 6 | from numpy.typing import NDArray |
7 | | -from xattree import dict_to_array_converter, xattree |
| 7 | +from xattree import xattree |
8 | 8 |
|
| 9 | +from flopy4.mf6.converters import dict_to_array |
9 | 10 | from flopy4.mf6.package import Package |
10 | 11 | from flopy4.mf6.spec import array, field |
11 | 12 |
|
@@ -50,47 +51,47 @@ class Xt3dOptions: |
50 | 51 | block="griddata", |
51 | 52 | dims=("nnodes",), |
52 | 53 | default=0, |
53 | | - converter=dict_to_array_converter, |
| 54 | + converter=Converter(dict_to_array, takes_self=True, takes_field=True), |
54 | 55 | ) |
55 | 56 | k: NDArray[np.float64] = array( |
56 | 57 | block="griddata", |
57 | 58 | dims=("nnodes",), |
58 | 59 | default=1.0, |
59 | | - converter=dict_to_array_converter, |
| 60 | + converter=Converter(dict_to_array, takes_self=True, takes_field=True), |
60 | 61 | ) |
61 | 62 | k22: Optional[NDArray[np.float64]] = array( |
62 | 63 | block="griddata", |
63 | 64 | dims=("nnodes",), |
64 | 65 | default=None, |
65 | | - converter=dict_to_array_converter, |
| 66 | + converter=Converter(dict_to_array, takes_self=True, takes_field=True), |
66 | 67 | ) |
67 | 68 | k33: Optional[NDArray[np.float64]] = array( |
68 | 69 | block="griddata", |
69 | 70 | dims=("nnodes",), |
70 | 71 | default=None, |
71 | | - converter=dict_to_array_converter, |
| 72 | + converter=Converter(dict_to_array, takes_self=True, takes_field=True), |
72 | 73 | ) |
73 | 74 | angle1: Optional[NDArray[np.float64]] = array( |
74 | 75 | block="griddata", |
75 | 76 | dims=("nnodes",), |
76 | 77 | default=None, |
77 | | - converter=dict_to_array_converter, |
| 78 | + converter=Converter(dict_to_array, takes_self=True, takes_field=True), |
78 | 79 | ) |
79 | 80 | angle2: Optional[NDArray[np.float64]] = array( |
80 | 81 | block="griddata", |
81 | 82 | dims=("nnodes",), |
82 | 83 | default=None, |
83 | | - converter=dict_to_array_converter, |
| 84 | + converter=Converter(dict_to_array, takes_self=True, takes_field=True), |
84 | 85 | ) |
85 | 86 | angle3: Optional[NDArray[np.float64]] = array( |
86 | 87 | block="griddata", |
87 | 88 | dims=("nnodes",), |
88 | 89 | default=None, |
89 | | - converter=dict_to_array_converter, |
| 90 | + converter=Converter(dict_to_array, takes_self=True, takes_field=True), |
90 | 91 | ) |
91 | 92 | wetdry: Optional[NDArray[np.float64]] = array( |
92 | 93 | block="griddata", |
93 | 94 | dims=("nnodes",), |
94 | 95 | default=None, |
95 | | - converter=dict_to_array_converter, |
| 96 | + converter=Converter(dict_to_array, takes_self=True, takes_field=True), |
96 | 97 | ) |
0 commit comments