foamlib 0.1.10__py3-none-any.whl → 0.1.12__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- foamlib/__init__.py +1 -1
- foamlib/_dictionaries.py +10 -24
- {foamlib-0.1.10.dist-info → foamlib-0.1.12.dist-info}/METADATA +1 -1
- foamlib-0.1.12.dist-info/RECORD +10 -0
- foamlib-0.1.10.dist-info/RECORD +0 -10
- {foamlib-0.1.10.dist-info → foamlib-0.1.12.dist-info}/LICENSE.txt +0 -0
- {foamlib-0.1.10.dist-info → foamlib-0.1.12.dist-info}/WHEEL +0 -0
- {foamlib-0.1.10.dist-info → foamlib-0.1.12.dist-info}/top_level.txt +0 -0
foamlib/__init__.py
CHANGED
foamlib/_dictionaries.py
CHANGED
@@ -29,11 +29,8 @@ from pyparsing import (
|
|
29
29
|
Keyword,
|
30
30
|
Literal,
|
31
31
|
Opt,
|
32
|
-
|
33
|
-
Word,
|
32
|
+
ParseException,
|
34
33
|
common,
|
35
|
-
identchars,
|
36
|
-
identbodychars,
|
37
34
|
)
|
38
35
|
|
39
36
|
FoamDimensionSet = namedtuple(
|
@@ -77,10 +74,6 @@ A value that can be stored in an OpenFOAM dictionary.
|
|
77
74
|
|
78
75
|
_YES = Keyword("yes").set_parse_action(lambda s, loc, tks: True)
|
79
76
|
_NO = Keyword("no").set_parse_action(lambda s, loc, tks: False)
|
80
|
-
_WORDS = Word(identchars, identbodychars + "(),")[1, ...].set_parse_action(
|
81
|
-
lambda s, loc, tks: " ".join(tks)
|
82
|
-
)
|
83
|
-
_STRING = QuotedString('"', unquote_results=False)
|
84
77
|
_VALUE = Forward()
|
85
78
|
_LIST = Opt(
|
86
79
|
Literal("List") + Literal("<") + common.identifier + Literal(">")
|
@@ -105,21 +98,14 @@ _DIMENSIONED = (common.identifier + _DIMENSIONS + _VALUE).set_parse_action(
|
|
105
98
|
lambda s, loc, tks: FoamDimensioned(tks[0], tks[1], tks[2].as_list())
|
106
99
|
)
|
107
100
|
|
108
|
-
_VALUE << (
|
109
|
-
_FIELD
|
110
|
-
| _LIST
|
111
|
-
| _DIMENSIONED
|
112
|
-
| _DIMENSIONS
|
113
|
-
| common.number
|
114
|
-
| _YES
|
115
|
-
| _NO
|
116
|
-
| _WORDS
|
117
|
-
| _STRING
|
118
|
-
)
|
101
|
+
_VALUE << (_FIELD | _LIST | _DIMENSIONED | _DIMENSIONS | common.number | _YES | _NO)
|
119
102
|
|
120
103
|
|
121
104
|
def _parse(value: str) -> FoamValue:
|
122
|
-
|
105
|
+
try:
|
106
|
+
return cast(FoamValue, _VALUE.parse_string(value, parse_all=True).as_list()[0])
|
107
|
+
except ParseException:
|
108
|
+
return value
|
123
109
|
|
124
110
|
|
125
111
|
def _serialize_bool(value: Any) -> str:
|
@@ -333,7 +319,7 @@ class FoamBoundaryDictionary(FoamDictionary):
|
|
333
319
|
int,
|
334
320
|
float,
|
335
321
|
Sequence[Union[int, float, Sequence[Union[int, float]]]],
|
336
|
-
NDArray[np.generic],
|
322
|
+
"NDArray[np.generic]",
|
337
323
|
]:
|
338
324
|
"""
|
339
325
|
Alias of `self["value"]`.
|
@@ -350,7 +336,7 @@ class FoamBoundaryDictionary(FoamDictionary):
|
|
350
336
|
int,
|
351
337
|
float,
|
352
338
|
Sequence[Union[int, float, Sequence[Union[int, float]]]],
|
353
|
-
NDArray[np.generic],
|
339
|
+
"NDArray[np.generic]",
|
354
340
|
],
|
355
341
|
) -> None:
|
356
342
|
self["value"] = value
|
@@ -426,7 +412,7 @@ class FoamFieldFile(FoamFile):
|
|
426
412
|
int,
|
427
413
|
float,
|
428
414
|
Sequence[Union[int, float, Sequence[Union[int, float]]]],
|
429
|
-
NDArray[np.generic],
|
415
|
+
"NDArray[np.generic]",
|
430
416
|
]:
|
431
417
|
"""
|
432
418
|
Alias of `self["internalField"]`.
|
@@ -443,7 +429,7 @@ class FoamFieldFile(FoamFile):
|
|
443
429
|
int,
|
444
430
|
float,
|
445
431
|
Sequence[Union[int, float, Sequence[Union[int, float]]]],
|
446
|
-
NDArray[np.generic],
|
432
|
+
"NDArray[np.generic]",
|
447
433
|
],
|
448
434
|
) -> None:
|
449
435
|
self["internalField"] = value
|
@@ -0,0 +1,10 @@
|
|
1
|
+
foamlib/__init__.py,sha256=O3uQOMgYMgmnG59NoWSIDyLpCDZ_oL8gsr4Ks8X2k1s,551
|
2
|
+
foamlib/_cases.py,sha256=Q5c8vPzKT5coOy4q_H6s5gHgEArhLHByh6GSvDVCRdY,20683
|
3
|
+
foamlib/_dictionaries.py,sha256=753mzZOKN81U1MCpec0LjpMqhrBPPfIAl16njLvynWo,12948
|
4
|
+
foamlib/_subprocesses.py,sha256=5vqdQvpN_2v4GgDqxi-s88NGhZ6doFxkh0XY89ZWuHA,1926
|
5
|
+
foamlib/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
+
foamlib-0.1.12.dist-info/LICENSE.txt,sha256=5Dte9TUnLZzPRs4NQzl-Jc2-Ljd-t_v0ZR5Ng5r0UsY,35131
|
7
|
+
foamlib-0.1.12.dist-info/METADATA,sha256=My3jaoCaNIJndzrWTSUiQjE7xyRr44zv-4KAo6SRpto,4527
|
8
|
+
foamlib-0.1.12.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
9
|
+
foamlib-0.1.12.dist-info/top_level.txt,sha256=ZdVYtetXGwPwyfL-WhlhbTFQGAwKX5P_gXxtH9JYFPI,8
|
10
|
+
foamlib-0.1.12.dist-info/RECORD,,
|
foamlib-0.1.10.dist-info/RECORD
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
foamlib/__init__.py,sha256=0TpGKaLpDtb7cxLPIf2B2uVq_03YMUEZCHh4C5z4Pgs,551
|
2
|
-
foamlib/_cases.py,sha256=Q5c8vPzKT5coOy4q_H6s5gHgEArhLHByh6GSvDVCRdY,20683
|
3
|
-
foamlib/_dictionaries.py,sha256=S0bPqEZHG4AKOycoawHc-CTWBLO32PKS0Cev-CYT_-c,13147
|
4
|
-
foamlib/_subprocesses.py,sha256=5vqdQvpN_2v4GgDqxi-s88NGhZ6doFxkh0XY89ZWuHA,1926
|
5
|
-
foamlib/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
-
foamlib-0.1.10.dist-info/LICENSE.txt,sha256=5Dte9TUnLZzPRs4NQzl-Jc2-Ljd-t_v0ZR5Ng5r0UsY,35131
|
7
|
-
foamlib-0.1.10.dist-info/METADATA,sha256=JDpXj29FPr-juOGh4EArzcO4GRDYdZFCcoRdP--Bwnc,4527
|
8
|
-
foamlib-0.1.10.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
9
|
-
foamlib-0.1.10.dist-info/top_level.txt,sha256=ZdVYtetXGwPwyfL-WhlhbTFQGAwKX5P_gXxtH9JYFPI,8
|
10
|
-
foamlib-0.1.10.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|