Skip to content

Commit bd4abfe

Browse files
authored
misc cleanup (#44)
* get rid of lark dfn parser (slow and unnecessary, we can just parse dfns by hand for now until switch to structured format) * tidy up c/attrs proof of concept
1 parent 4fb893c commit bd4abfe

File tree

13 files changed

+189
-605
lines changed

13 files changed

+189
-605
lines changed

flopy4/attrs.py

Lines changed: 0 additions & 171 deletions
This file was deleted.

flopy4/io/lark.py

Lines changed: 0 additions & 25 deletions
This file was deleted.
File renamed without changes.

flopy4/mf6/io/converter.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

flopy4/mf6/io/spec/__init__.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

flopy4/mf6/io/spec/parser.py

Lines changed: 0 additions & 78 deletions
This file was deleted.

flopy4/mf6/io/spec/transformer.py

Lines changed: 0 additions & 63 deletions
This file was deleted.

flopy4/mf6/io/transformer.py

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,29 @@
33
import numpy as np
44
from lark import Transformer
55

6-
from flopy4.io.lark import (
7-
parse_array,
8-
parse_float,
9-
parse_int,
10-
parse_string,
11-
parse_word,
12-
)
6+
7+
def parse_word(_, w):
8+
(w,) = w
9+
return str(w)
10+
11+
12+
def parse_string(_, s):
13+
return " ".join(s)
14+
15+
16+
def parse_int(_, i):
17+
(i,) = i
18+
return int(i)
19+
20+
21+
def parse_float(_, f):
22+
(f,) = f
23+
return float(f)
24+
25+
26+
def parse_array(_, a):
27+
(a,) = a
28+
return np.array(a)
1329

1430

1531
class MF6Transformer(Transformer):

0 commit comments

Comments
 (0)