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.
Files changed (27) hide show
  1. {foamlib-0.6.13 → foamlib-0.6.14}/PKG-INFO +1 -1
  2. {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/__init__.py +1 -1
  3. {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/_files/_parsing.py +101 -71
  4. {foamlib-0.6.13 → foamlib-0.6.14}/foamlib.egg-info/PKG-INFO +1 -1
  5. {foamlib-0.6.13 → foamlib-0.6.14}/LICENSE.txt +0 -0
  6. {foamlib-0.6.13 → foamlib-0.6.14}/README.md +0 -0
  7. {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/_cases/__init__.py +0 -0
  8. {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/_cases/_async.py +0 -0
  9. {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/_cases/_base.py +0 -0
  10. {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/_cases/_run.py +0 -0
  11. {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/_cases/_slurm.py +0 -0
  12. {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/_cases/_subprocess.py +0 -0
  13. {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/_cases/_sync.py +0 -0
  14. {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/_cases/_util.py +0 -0
  15. {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/_files/__init__.py +0 -0
  16. {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/_files/_base.py +0 -0
  17. {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/_files/_files.py +0 -0
  18. {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/_files/_io.py +0 -0
  19. {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/_files/_serialization.py +0 -0
  20. {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/_files/_util.py +0 -0
  21. {foamlib-0.6.13 → foamlib-0.6.14}/foamlib/py.typed +0 -0
  22. {foamlib-0.6.13 → foamlib-0.6.14}/foamlib.egg-info/SOURCES.txt +0 -0
  23. {foamlib-0.6.13 → foamlib-0.6.14}/foamlib.egg-info/dependency_links.txt +0 -0
  24. {foamlib-0.6.13 → foamlib-0.6.14}/foamlib.egg-info/requires.txt +0 -0
  25. {foamlib-0.6.13 → foamlib-0.6.14}/foamlib.egg-info/top_level.txt +0 -0
  26. {foamlib-0.6.13 → foamlib-0.6.14}/pyproject.toml +0 -0
  27. {foamlib-0.6.13 → foamlib-0.6.14}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: foamlib
3
- Version: 0.6.13
3
+ Version: 0.6.14
4
4
  Summary: A Python interface for interacting with OpenFOAM
5
5
  Author-email: "Gabriel S. Gerlero" <ggerlero@cimec.unl.edu.ar>
6
6
  Project-URL: Homepage, https://github.com/gerlero/foamlib
@@ -1,6 +1,6 @@
1
1
  """A Python interface for interacting with OpenFOAM."""
2
2
 
3
- __version__ = "0.6.13"
3
+ __version__ = "0.6.14"
4
4
 
5
5
  from ._cases import (
6
6
  AsyncFoamCase,
@@ -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 Opt(
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 = _list_of(common.number) | common.number
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
- _list_of(_TENSOR)
139
- | (
140
- Literal("List").suppress()
141
- + Literal("<").suppress()
142
- + (
143
- (
144
- Literal("scalar").suppress()
145
- + Literal(">").suppress()
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
- counted_array(
149
- CharsNotIn(exact=8),
150
- common.integer + Literal("(").suppress(),
151
+ (
152
+ counted_array(
153
+ CharsNotIn(exact=8),
154
+ common.integer + Literal("(").suppress(),
155
+ )
151
156
  )
152
- )
153
- | (
154
- counted_array(
155
- CharsNotIn(exact=4),
156
- common.integer + Literal("(").suppress(),
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
- + Literal(")").suppress()
161
- ).set_parse_action(_unpack_binary_field)
162
- | (
163
- Literal("vector").suppress()
164
- + Literal(">").suppress()
165
- + (
177
+ | (
166
178
  (
167
- counted_array(
168
- CharsNotIn(exact=8 * 3),
169
- common.integer + Literal("(").suppress(),
179
+ (
180
+ counted_array(
181
+ CharsNotIn(exact=8 * 3),
182
+ common.integer + Literal("(").suppress(),
183
+ )
170
184
  )
171
- )
172
- | (
173
- counted_array(
174
- CharsNotIn(exact=4 * 3),
175
- common.integer + Literal("(").suppress(),
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
- + Literal(")").suppress()
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
- counted_array(
187
- CharsNotIn(exact=8 * 6),
188
- common.integer + Literal("(").suppress(),
207
+ (
208
+ counted_array(
209
+ CharsNotIn(exact=8 * 6),
210
+ common.integer + Literal("(").suppress(),
211
+ )
189
212
  )
190
- )
191
- | (
192
- counted_array(
193
- CharsNotIn(exact=4 * 6),
194
- common.integer + Literal("(").suppress(),
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
- + Literal(")").suppress()
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
- counted_array(
206
- CharsNotIn(exact=8 * 9),
207
- common.integer + Literal("(").suppress(),
235
+ (
236
+ counted_array(
237
+ CharsNotIn(exact=8 * 9),
238
+ common.integer + Literal("(").suppress(),
239
+ )
208
240
  )
209
- )
210
- | (
211
- counted_array(
212
- CharsNotIn(exact=4 * 9),
213
- common.integer + Literal("(").suppress(),
241
+ | (
242
+ counted_array(
243
+ CharsNotIn(exact=4 * 9),
244
+ common.integer + Literal("(").suppress(),
245
+ )
214
246
  )
215
247
  )
216
- )
217
- + Literal(")").suppress()
218
- ).set_parse_action(lambda tks: _unpack_binary_field(tks, elsize=9))
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
- _DATA_ENTRY <<= (
233
- _FIELD | _LIST | _DIMENSIONED | _DIMENSIONS | common.number | _SWITCH | _TOKEN
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,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: foamlib
3
- Version: 0.6.13
3
+ Version: 0.6.14
4
4
  Summary: A Python interface for interacting with OpenFOAM
5
5
  Author-email: "Gabriel S. Gerlero" <ggerlero@cimec.unl.edu.ar>
6
6
  Project-URL: Homepage, https://github.com/gerlero/foamlib
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes