foamlib 0.6.13__py3-none-any.whl → 0.6.14__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/_files/_parsing.py +101 -71
- {foamlib-0.6.13.dist-info → foamlib-0.6.14.dist-info}/METADATA +1 -1
- {foamlib-0.6.13.dist-info → foamlib-0.6.14.dist-info}/RECORD +7 -7
- {foamlib-0.6.13.dist-info → foamlib-0.6.14.dist-info}/LICENSE.txt +0 -0
- {foamlib-0.6.13.dist-info → foamlib-0.6.14.dist-info}/WHEEL +0 -0
- {foamlib-0.6.13.dist-info → foamlib-0.6.14.dist-info}/top_level.txt +0 -0
foamlib/__init__.py
CHANGED
foamlib/_files/_parsing.py
CHANGED
@@ -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()
|
@@ -1,4 +1,4 @@
|
|
1
|
-
foamlib/__init__.py,sha256=
|
1
|
+
foamlib/__init__.py,sha256=2TB7NPVimWOf7GSEz5g_Gbguf3RJvD-eOWA0ykCCwLM,487
|
2
2
|
foamlib/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
3
|
foamlib/_cases/__init__.py,sha256=wTUHcUgU1CBgpu0cUMtksQ5VKG6B8CFu9xc3dWwsQuo,358
|
4
4
|
foamlib/_cases/_async.py,sha256=i6g4EBHqvI-1PkdrxsRto2ynW7sxsOga2bSYk1XVG1U,7795
|
@@ -12,11 +12,11 @@ foamlib/_files/__init__.py,sha256=-UqB9YTH6mrJfXCX00kPTAAY20XG64u1MGPw_1ewLVs,14
|
|
12
12
|
foamlib/_files/_base.py,sha256=ZY_6Zxr3LZHVzJEex6SUTi9Pgo7Oi7i3Jo-wre9G3yE,1968
|
13
13
|
foamlib/_files/_files.py,sha256=oYRlMfCUH9oNeu-yf2HAPmLxLHteIe7gHhsWXdn7wU0,15767
|
14
14
|
foamlib/_files/_io.py,sha256=IQLqoqnA1TpHf21NbUho2wsYWevyqC6MKo-wfpaObUU,2226
|
15
|
-
foamlib/_files/_parsing.py,sha256=
|
15
|
+
foamlib/_files/_parsing.py,sha256=sJ7XadWFqmJTaL9TEYyaYEu3r-CQweruwPUNWIZt4i0,14165
|
16
16
|
foamlib/_files/_serialization.py,sha256=p2yRpyyOAOKP7P6T7BLEgRVvORuzQEcv_P6dEsOZ9_8,5981
|
17
17
|
foamlib/_files/_util.py,sha256=VXUTD0B3NbnlaE_KCqWzrFcWvBz_2JfnIWpNp3snX3Y,526
|
18
|
-
foamlib-0.6.
|
19
|
-
foamlib-0.6.
|
20
|
-
foamlib-0.6.
|
21
|
-
foamlib-0.6.
|
22
|
-
foamlib-0.6.
|
18
|
+
foamlib-0.6.14.dist-info/LICENSE.txt,sha256=5Dte9TUnLZzPRs4NQzl-Jc2-Ljd-t_v0ZR5Ng5r0UsY,35131
|
19
|
+
foamlib-0.6.14.dist-info/METADATA,sha256=Um-3D8v1EnQPeX-pAySWkM-SWVBgTPIiLgKd4Ewq3RY,7742
|
20
|
+
foamlib-0.6.14.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
21
|
+
foamlib-0.6.14.dist-info/top_level.txt,sha256=ZdVYtetXGwPwyfL-WhlhbTFQGAwKX5P_gXxtH9JYFPI,8
|
22
|
+
foamlib-0.6.14.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|