foamlib 0.1.9__tar.gz → 0.1.10__tar.gz
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-0.1.9 → foamlib-0.1.10}/PKG-INFO +1 -1
- {foamlib-0.1.9 → foamlib-0.1.10}/foamlib/__init__.py +1 -1
- {foamlib-0.1.9 → foamlib-0.1.10}/foamlib/_dictionaries.py +13 -5
- {foamlib-0.1.9 → foamlib-0.1.10}/foamlib.egg-info/PKG-INFO +1 -1
- {foamlib-0.1.9 → foamlib-0.1.10}/tests/test_dictionaries.py +3 -0
- {foamlib-0.1.9 → foamlib-0.1.10}/LICENSE.txt +0 -0
- {foamlib-0.1.9 → foamlib-0.1.10}/README.md +0 -0
- {foamlib-0.1.9 → foamlib-0.1.10}/foamlib/_cases.py +0 -0
- {foamlib-0.1.9 → foamlib-0.1.10}/foamlib/_subprocesses.py +0 -0
- {foamlib-0.1.9 → foamlib-0.1.10}/foamlib/py.typed +0 -0
- {foamlib-0.1.9 → foamlib-0.1.10}/foamlib.egg-info/SOURCES.txt +0 -0
- {foamlib-0.1.9 → foamlib-0.1.10}/foamlib.egg-info/dependency_links.txt +0 -0
- {foamlib-0.1.9 → foamlib-0.1.10}/foamlib.egg-info/requires.txt +0 -0
- {foamlib-0.1.9 → foamlib-0.1.10}/foamlib.egg-info/top_level.txt +0 -0
- {foamlib-0.1.9 → foamlib-0.1.10}/pyproject.toml +0 -0
- {foamlib-0.1.9 → foamlib-0.1.10}/setup.cfg +0 -0
- {foamlib-0.1.9 → foamlib-0.1.10}/tests/test_basic.py +0 -0
- {foamlib-0.1.9 → foamlib-0.1.10}/tests/test_flange.py +0 -0
- {foamlib-0.1.9 → foamlib-0.1.10}/tests/test_flange_async.py +0 -0
- {foamlib-0.1.9 → foamlib-0.1.10}/tests/test_pitz.py +0 -0
- {foamlib-0.1.9 → foamlib-0.1.10}/tests/test_pitz_async.py +0 -0
@@ -28,10 +28,9 @@ from pyparsing import (
|
|
28
28
|
Group,
|
29
29
|
Keyword,
|
30
30
|
Literal,
|
31
|
-
OneOrMore,
|
32
31
|
Opt,
|
32
|
+
QuotedString,
|
33
33
|
Word,
|
34
|
-
ZeroOrMore,
|
35
34
|
common,
|
36
35
|
identchars,
|
37
36
|
identbodychars,
|
@@ -78,9 +77,10 @@ A value that can be stored in an OpenFOAM dictionary.
|
|
78
77
|
|
79
78
|
_YES = Keyword("yes").set_parse_action(lambda s, loc, tks: True)
|
80
79
|
_NO = Keyword("no").set_parse_action(lambda s, loc, tks: False)
|
81
|
-
_WORDS =
|
80
|
+
_WORDS = Word(identchars, identbodychars + "(),")[1, ...].set_parse_action(
|
82
81
|
lambda s, loc, tks: " ".join(tks)
|
83
82
|
)
|
83
|
+
_STRING = QuotedString('"', unquote_results=False)
|
84
84
|
_VALUE = Forward()
|
85
85
|
_LIST = Opt(
|
86
86
|
Literal("List") + Literal("<") + common.identifier + Literal(">")
|
@@ -88,7 +88,7 @@ _LIST = Opt(
|
|
88
88
|
(
|
89
89
|
Opt(common.integer).suppress()
|
90
90
|
+ Literal("(").suppress()
|
91
|
-
+ Group(
|
91
|
+
+ Group(_VALUE[...])
|
92
92
|
+ Literal(")").suppress()
|
93
93
|
)
|
94
94
|
| (
|
@@ -106,7 +106,15 @@ _DIMENSIONED = (common.identifier + _DIMENSIONS + _VALUE).set_parse_action(
|
|
106
106
|
)
|
107
107
|
|
108
108
|
_VALUE << (
|
109
|
-
_FIELD
|
109
|
+
_FIELD
|
110
|
+
| _LIST
|
111
|
+
| _DIMENSIONED
|
112
|
+
| _DIMENSIONS
|
113
|
+
| common.number
|
114
|
+
| _YES
|
115
|
+
| _NO
|
116
|
+
| _WORDS
|
117
|
+
| _STRING
|
110
118
|
)
|
111
119
|
|
112
120
|
|
@@ -16,6 +16,9 @@ def test_parse() -> None:
|
|
16
16
|
assert _parse("1.0e-3") == 1.0e-3
|
17
17
|
assert _parse("yes") is True
|
18
18
|
assert _parse("no") is False
|
19
|
+
assert _parse("word") == "word"
|
20
|
+
assert _parse("word word") == "word word"
|
21
|
+
assert _parse('"a string"') == '"a string"'
|
19
22
|
assert _parse("uniform 1") == 1
|
20
23
|
assert _parse("uniform 1.0") == 1.0
|
21
24
|
assert _parse("uniform 1.0e-3") == 1.0e-3
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|