foamlib 0.6.13__tar.gz → 0.6.14__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.6.13 → foamlib-0.6.14}/PKG-INFO +1 -1
- {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/__init__.py +1 -1
- {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/_files/_parsing.py +101 -71
- {foamlib-0.6.13 → foamlib-0.6.14}/foamlib.egg-info/PKG-INFO +1 -1
- {foamlib-0.6.13 → foamlib-0.6.14}/LICENSE.txt +0 -0
- {foamlib-0.6.13 → foamlib-0.6.14}/README.md +0 -0
- {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/_cases/__init__.py +0 -0
- {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/_cases/_async.py +0 -0
- {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/_cases/_base.py +0 -0
- {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/_cases/_run.py +0 -0
- {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/_cases/_slurm.py +0 -0
- {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/_cases/_subprocess.py +0 -0
- {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/_cases/_sync.py +0 -0
- {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/_cases/_util.py +0 -0
- {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/_files/__init__.py +0 -0
- {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/_files/_base.py +0 -0
- {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/_files/_files.py +0 -0
- {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/_files/_io.py +0 -0
- {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/_files/_serialization.py +0 -0
- {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/_files/_util.py +0 -0
- {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/py.typed +0 -0
- {foamlib-0.6.13 → foamlib-0.6.14}/foamlib.egg-info/SOURCES.txt +0 -0
- {foamlib-0.6.13 → foamlib-0.6.14}/foamlib.egg-info/dependency_links.txt +0 -0
- {foamlib-0.6.13 → foamlib-0.6.14}/foamlib.egg-info/requires.txt +0 -0
- {foamlib-0.6.13 → foamlib-0.6.14}/foamlib.egg-info/top_level.txt +0 -0
- {foamlib-0.6.13 → foamlib-0.6.14}/pyproject.toml +0 -0
- {foamlib-0.6.13 → foamlib-0.6.14}/setup.cfg +0 -0
@@ -29,7 +29,6 @@ from pyparsing import (
|
|
29
29
|
ParseResults,
|
30
30
|
QuotedString,
|
31
31
|
Word,
|
32
|
-
c_style_comment,
|
33
32
|
common,
|
34
33
|
counted_array,
|
35
34
|
cpp_style_comment,
|
@@ -41,9 +40,7 @@ from ._base import FoamFileBase
|
|
41
40
|
|
42
41
|
|
43
42
|
def _list_of(entry: ParserElement) -> ParserElement:
|
44
|
-
return
|
45
|
-
Literal("List") + Literal("<") + common.identifier + Literal(">")
|
46
|
-
).suppress() + (
|
43
|
+
return (
|
47
44
|
(
|
48
45
|
counted_array(entry, common.integer + Literal("(").suppress())
|
49
46
|
+ Literal(")").suppress()
|
@@ -124,7 +121,13 @@ _SWITCH = (
|
|
124
121
|
_DIMENSIONS = (
|
125
122
|
Literal("[").suppress() + common.number[0, 7] + Literal("]").suppress()
|
126
123
|
).set_parse_action(lambda tks: FoamFileBase.DimensionSet(*tks))
|
127
|
-
_TENSOR =
|
124
|
+
_TENSOR = common.ieee_float | (
|
125
|
+
Literal("(").suppress()
|
126
|
+
+ Group(
|
127
|
+
common.ieee_float[9] | common.ieee_float[6] | common.ieee_float[3], aslist=True
|
128
|
+
)
|
129
|
+
+ Literal(")").suppress()
|
130
|
+
)
|
128
131
|
_IDENTIFIER = Combine(
|
129
132
|
Word(_IDENTCHARS, _IDENTBODYCHARS, exclude_chars="()")
|
130
133
|
+ Opt(Literal("(") + Word(_IDENTBODYCHARS, exclude_chars="()") + Literal(")"))
|
@@ -135,87 +138,116 @@ _DIMENSIONED = (Opt(_IDENTIFIER) + _DIMENSIONS + _TENSOR).set_parse_action(
|
|
135
138
|
_FIELD = (Keyword("uniform", _IDENTBODYCHARS).suppress() + _TENSOR) | (
|
136
139
|
Keyword("nonuniform", _IDENTBODYCHARS).suppress()
|
137
140
|
+ (
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
(
|
144
|
-
|
145
|
-
|
146
|
-
|
141
|
+
Literal("List").suppress()
|
142
|
+
+ Literal("<").suppress()
|
143
|
+
+ (
|
144
|
+
(
|
145
|
+
Literal("scalar").suppress()
|
146
|
+
+ Literal(">").suppress()
|
147
|
+
+ (
|
148
|
+
_list_of(common.ieee_float)
|
149
|
+
| (
|
147
150
|
(
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
+
(
|
152
|
+
counted_array(
|
153
|
+
CharsNotIn(exact=8),
|
154
|
+
common.integer + Literal("(").suppress(),
|
155
|
+
)
|
151
156
|
)
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
+
| (
|
158
|
+
counted_array(
|
159
|
+
CharsNotIn(exact=4),
|
160
|
+
common.integer + Literal("(").suppress(),
|
161
|
+
)
|
157
162
|
)
|
158
163
|
)
|
164
|
+
+ Literal(")").suppress()
|
165
|
+
).set_parse_action(_unpack_binary_field)
|
166
|
+
)
|
167
|
+
)
|
168
|
+
| (
|
169
|
+
Literal("vector").suppress()
|
170
|
+
+ Literal(">").suppress()
|
171
|
+
+ (
|
172
|
+
_list_of(
|
173
|
+
Literal("(").suppress()
|
174
|
+
+ Group(common.ieee_float[3], aslist=True)
|
175
|
+
+ Literal(")").suppress()
|
159
176
|
)
|
160
|
-
|
161
|
-
).set_parse_action(_unpack_binary_field)
|
162
|
-
| (
|
163
|
-
Literal("vector").suppress()
|
164
|
-
+ Literal(">").suppress()
|
165
|
-
+ (
|
177
|
+
| (
|
166
178
|
(
|
167
|
-
|
168
|
-
|
169
|
-
|
179
|
+
(
|
180
|
+
counted_array(
|
181
|
+
CharsNotIn(exact=8 * 3),
|
182
|
+
common.integer + Literal("(").suppress(),
|
183
|
+
)
|
170
184
|
)
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
185
|
+
| (
|
186
|
+
counted_array(
|
187
|
+
CharsNotIn(exact=4 * 3),
|
188
|
+
common.integer + Literal("(").suppress(),
|
189
|
+
)
|
176
190
|
)
|
177
191
|
)
|
192
|
+
+ Literal(")").suppress()
|
193
|
+
).set_parse_action(lambda tks: _unpack_binary_field(tks, elsize=3))
|
194
|
+
)
|
195
|
+
)
|
196
|
+
| (
|
197
|
+
Literal("vector").suppress()
|
198
|
+
+ Literal(">").suppress()
|
199
|
+
+ (
|
200
|
+
_list_of(
|
201
|
+
Literal("(").suppress()
|
202
|
+
+ Group(common.ieee_float[6], aslist=True)
|
203
|
+
+ Literal(")").suppress()
|
178
204
|
)
|
179
|
-
|
180
|
-
).set_parse_action(lambda tks: _unpack_binary_field(tks, elsize=3))
|
181
|
-
| (
|
182
|
-
Literal("symmTensor").suppress()
|
183
|
-
+ Literal(">").suppress()
|
184
|
-
+ (
|
205
|
+
| (
|
185
206
|
(
|
186
|
-
|
187
|
-
|
188
|
-
|
207
|
+
(
|
208
|
+
counted_array(
|
209
|
+
CharsNotIn(exact=8 * 6),
|
210
|
+
common.integer + Literal("(").suppress(),
|
211
|
+
)
|
189
212
|
)
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
213
|
+
| (
|
214
|
+
counted_array(
|
215
|
+
CharsNotIn(exact=4 * 6),
|
216
|
+
common.integer + Literal("(").suppress(),
|
217
|
+
)
|
195
218
|
)
|
196
219
|
)
|
220
|
+
+ Literal(")").suppress()
|
221
|
+
).set_parse_action(lambda tks: _unpack_binary_field(tks, elsize=6))
|
222
|
+
)
|
223
|
+
)
|
224
|
+
| (
|
225
|
+
Literal("tensor").suppress()
|
226
|
+
+ Literal(">").suppress()
|
227
|
+
+ (
|
228
|
+
_list_of(
|
229
|
+
Literal("(").suppress()
|
230
|
+
+ Group(common.ieee_float[9], aslist=True)
|
231
|
+
+ Literal(")").suppress()
|
197
232
|
)
|
198
|
-
|
199
|
-
).set_parse_action(lambda tks: _unpack_binary_field(tks, elsize=6))
|
200
|
-
| (
|
201
|
-
Literal("tensor").suppress()
|
202
|
-
+ Literal(">").suppress()
|
203
|
-
+ (
|
233
|
+
| (
|
204
234
|
(
|
205
|
-
|
206
|
-
|
207
|
-
|
235
|
+
(
|
236
|
+
counted_array(
|
237
|
+
CharsNotIn(exact=8 * 9),
|
238
|
+
common.integer + Literal("(").suppress(),
|
239
|
+
)
|
208
240
|
)
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
241
|
+
| (
|
242
|
+
counted_array(
|
243
|
+
CharsNotIn(exact=4 * 9),
|
244
|
+
common.integer + Literal("(").suppress(),
|
245
|
+
)
|
214
246
|
)
|
215
247
|
)
|
216
|
-
|
217
|
-
|
218
|
-
)
|
248
|
+
+ Literal(")").suppress()
|
249
|
+
).set_parse_action(lambda tks: _unpack_binary_field(tks, elsize=9))
|
250
|
+
)
|
219
251
|
)
|
220
252
|
)
|
221
253
|
)
|
@@ -229,9 +261,8 @@ _KEYWORD_ENTRY = Dict(Group(_keyword_entry_of(_KEYWORD, _DATA)), asdict=True)
|
|
229
261
|
_DATA_ENTRY = Forward()
|
230
262
|
_LIST_ENTRY = _KEYWORD_ENTRY | _DATA_ENTRY
|
231
263
|
_LIST = _list_of(_LIST_ENTRY)
|
232
|
-
|
233
|
-
|
234
|
-
)
|
264
|
+
_NUMBER = common.signed_integer ^ common.ieee_float
|
265
|
+
_DATA_ENTRY <<= _FIELD | _LIST | _DIMENSIONED | _DIMENSIONS | _NUMBER | _SWITCH | _TOKEN
|
235
266
|
|
236
267
|
_DATA <<= _DATA_ENTRY[1, ...].set_parse_action(
|
237
268
|
lambda tks: tuple(tks) if len(tks) > 1 else [tks[0]]
|
@@ -251,7 +282,6 @@ _FILE = (
|
|
251
282
|
)
|
252
283
|
+ Group(_keyword_entry_of(_KEYWORD, Opt(_DATA, default=""), located=True))[...]
|
253
284
|
)
|
254
|
-
.ignore(c_style_comment)
|
255
285
|
.ignore(cpp_style_comment)
|
256
286
|
.ignore(Literal("#include") + ... + LineEnd()) # type: ignore [no-untyped-call]
|
257
287
|
.parse_with_tabs()
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|