Skip to content

Commit

Permalink
misc cleanup (#44)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
wpbonelli authored Nov 3, 2024
1 parent 4fb893c commit bd4abfe
Show file tree
Hide file tree
Showing 13 changed files with 189 additions and 605 deletions.
171 changes: 0 additions & 171 deletions flopy4/attrs.py

This file was deleted.

25 changes: 0 additions & 25 deletions flopy4/io/lark.py

This file was deleted.

File renamed without changes.
3 changes: 0 additions & 3 deletions flopy4/mf6/io/converter.py

This file was deleted.

4 changes: 0 additions & 4 deletions flopy4/mf6/io/spec/__init__.py

This file was deleted.

78 changes: 0 additions & 78 deletions flopy4/mf6/io/spec/parser.py

This file was deleted.

63 changes: 0 additions & 63 deletions flopy4/mf6/io/spec/transformer.py

This file was deleted.

30 changes: 23 additions & 7 deletions flopy4/mf6/io/transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,29 @@
import numpy as np
from lark import Transformer

from flopy4.io.lark import (
parse_array,
parse_float,
parse_int,
parse_string,
parse_word,
)

def parse_word(_, w):
(w,) = w
return str(w)


def parse_string(_, s):
return " ".join(s)


def parse_int(_, i):
(i,) = i
return int(i)


def parse_float(_, f):
(f,) = f
return float(f)


def parse_array(_, a):
(a,) = a
return np.array(a)


class MF6Transformer(Transformer):
Expand Down
Loading

0 comments on commit bd4abfe

Please sign in to comment.