File tree Expand file tree Collapse file tree 2 files changed +1
-24
lines changed Expand file tree Collapse file tree 2 files changed +1
-24
lines changed Original file line number Diff line number Diff line change 1- // Typed grammar rules for MF6 input files
2- // Named fields use specific types (integer/double) for validation
3- // List/recarray data uses generic 'number' - structuring step handles type conversion
41integer : SIGNED_INT | INT
52double : SIGNED_NUMBER | NUMBER
63number : SIGNED_NUMBER | NUMBER
@@ -20,7 +17,6 @@ iprn: "iprn"i integer
2017binary : " (binary)" i
2118filename : ESCAPED_STRING | word
2219data : double +
23-
2420record : token + NEWLINE
2521token : number | word
2622word : / (?! ( ? i:begin| end) ) [a-zA-Z0-9._'~,- \\ ( \\ ) ]+ /
Original file line number Diff line number Diff line change 1212import numpy as np
1313from attrs import NOTHING , Attribute
1414from modflow_devtools .dfn .schema .block import block_sort_key
15- from modflow_devtools .dfn .schema .v2 import SCALAR_TYPES , FieldType
1615from modflow_devtools .dfn .schema .v2 import Field as FieldV2
16+ from modflow_devtools .dfn .schema .v2 import FieldType
1717
1818from flopy4 .spec import array as flopy_array
1919from flopy4 .spec import coord as flopy_coord
@@ -274,22 +274,3 @@ def to_field(attribute: Attribute) -> FieldV2:
274274 if attribute .metadata .get ("kind" , None ) == "child" # type: ignore
275275 else None , # type: ignore
276276 )
277-
278-
279- def is_array_field (field : FieldV2 ) -> bool :
280- """Check if a field should be provided in MF6 array input format."""
281- return field ["type" ] in SCALAR_TYPES and "shape" in field
282-
283-
284- def is_list_field (field : FieldV2 ) -> bool :
285- """
286- Check if a field should be provided in MF6 list input format.
287- """
288- return field ["type" ] == "list" and "period" in field ["block" ]
289-
290-
291- def is_list_block (block : Block ) -> bool :
292- """
293- Check if a block should be provided in MF6 list input format.
294- """
295- return is_list_field (next (iter (block .values ())))
You can’t perform that action at this time.
0 commit comments