Skip to content

Commit 08c9eb0

Browse files
authored
write floats in scientific notation (#270)
1 parent 6311b73 commit 08c9eb0

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

docs/examples/twri.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def plot_head(head, workspace):
254254

255255
# add array based inputs
256256
# TODO: needs type checking and list consolidation support (see comments in gwf init)
257-
gwf.chd = [chdg]
257+
gwf.chdg = [chdg]
258258
gwf.drng = [drng]
259259
gwf.welg = [welg]
260260
gwf.rcha = [rcha]

flopy4/mf6/codec/reader/grammar/basic.lark

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ block_name: CNAME [INT]
44
_list: line*
55
line: [WS] item+ _NL+
66
item: word | NUMBER
7-
word: /[a-zA-Z0-9._'~,-\\(\\)]+/
7+
word: /[a-zA-Z0-9._'~,+-\\(\\)]+/
88

99
%import common.NEWLINE -> _NL
1010
%import common.WS

flopy4/mf6/codec/reader/grammar/typed.lark

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ filename: ESCAPED_STRING | word
1919
data: double+
2020
record: token+ NEWLINE
2121
token: number | word
22-
word: /(?!(?i:begin|end))[a-zA-Z0-9._'~,-\\(\\)]+/
22+
word: /(?!(?i:begin|end))[a-zA-Z0-9._'~,+-\\(\\)]+/
2323
_token: word | number
2424

2525
%import common.NEWLINE

flopy4/mf6/codec/writer/filters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def array2string(value: NDArray) -> str:
115115
format = (
116116
"%d"
117117
if np.issubdtype(value.dtype, np.integer)
118-
else "%.9f"
118+
else "%.9e"
119119
if np.issubdtype(value.dtype, np.floating)
120120
else "%s"
121121
)

0 commit comments

Comments
 (0)