foamlib 0.7.1__tar.gz → 0.7.2__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.7.1 → foamlib-0.7.2}/PKG-INFO +1 -1
  2. {foamlib-0.7.1 → foamlib-0.7.2}/foamlib/__init__.py +1 -1
  3. {foamlib-0.7.1 → foamlib-0.7.2}/foamlib/_files/_parsing.py +14 -13
  4. {foamlib-0.7.1 → foamlib-0.7.2}/foamlib.egg-info/PKG-INFO +1 -1
  5. {foamlib-0.7.1 → foamlib-0.7.2}/LICENSE.txt +0 -0
  6. {foamlib-0.7.1 → foamlib-0.7.2}/README.md +0 -0
  7. {foamlib-0.7.1 → foamlib-0.7.2}/foamlib/_cases/__init__.py +0 -0
  8. {foamlib-0.7.1 → foamlib-0.7.2}/foamlib/_cases/_async.py +0 -0
  9. {foamlib-0.7.1 → foamlib-0.7.2}/foamlib/_cases/_base.py +0 -0
  10. {foamlib-0.7.1 → foamlib-0.7.2}/foamlib/_cases/_run.py +0 -0
  11. {foamlib-0.7.1 → foamlib-0.7.2}/foamlib/_cases/_slurm.py +0 -0
  12. {foamlib-0.7.1 → foamlib-0.7.2}/foamlib/_cases/_subprocess.py +0 -0
  13. {foamlib-0.7.1 → foamlib-0.7.2}/foamlib/_cases/_sync.py +0 -0
  14. {foamlib-0.7.1 → foamlib-0.7.2}/foamlib/_cases/_util.py +0 -0
  15. {foamlib-0.7.1 → foamlib-0.7.2}/foamlib/_files/__init__.py +0 -0
  16. {foamlib-0.7.1 → foamlib-0.7.2}/foamlib/_files/_files.py +0 -0
  17. {foamlib-0.7.1 → foamlib-0.7.2}/foamlib/_files/_io.py +0 -0
  18. {foamlib-0.7.1 → foamlib-0.7.2}/foamlib/_files/_serialization.py +0 -0
  19. {foamlib-0.7.1 → foamlib-0.7.2}/foamlib/_files/_types.py +0 -0
  20. {foamlib-0.7.1 → foamlib-0.7.2}/foamlib/_files/_util.py +0 -0
  21. {foamlib-0.7.1 → foamlib-0.7.2}/foamlib/py.typed +0 -0
  22. {foamlib-0.7.1 → foamlib-0.7.2}/foamlib.egg-info/SOURCES.txt +0 -0
  23. {foamlib-0.7.1 → foamlib-0.7.2}/foamlib.egg-info/dependency_links.txt +0 -0
  24. {foamlib-0.7.1 → foamlib-0.7.2}/foamlib.egg-info/requires.txt +0 -0
  25. {foamlib-0.7.1 → foamlib-0.7.2}/foamlib.egg-info/top_level.txt +0 -0
  26. {foamlib-0.7.1 → foamlib-0.7.2}/pyproject.toml +0 -0
  27. {foamlib-0.7.1 → foamlib-0.7.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: foamlib
3
- Version: 0.7.1
3
+ Version: 0.7.2
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.7.1"
3
+ __version__ = "0.7.2"
4
4
 
5
5
  from ._cases import (
6
6
  AsyncFoamCase,
@@ -41,7 +41,9 @@ from ._types import DataEntry, Dimensioned, DimensionSet, File
41
41
 
42
42
 
43
43
  def _list_of(entry: ParserElement) -> ParserElement:
44
- return (
44
+ return Opt(
45
+ Literal("List") + Literal("<") + _IDENTIFIER + Literal(">")
46
+ ).suppress() + (
45
47
  (
46
48
  counted_array(entry, common.integer + Literal("(").suppress())
47
49
  + Literal(")").suppress()
@@ -59,7 +61,7 @@ def _list_of(entry: ParserElement) -> ParserElement:
59
61
 
60
62
  def _counted_tensor_list(*, size: int, ignore: Regex) -> ParserElement:
61
63
  float_pattern = r"[+-]?((\d+\.?\d*(e[+-]?\d+)?)|nan|inf(inity)?)"
62
- ignore_pattern = rf"(?:{ignore.re.pattern}|\s)+"
64
+ ignore_pattern = rf"(?:\s|{ignore.re.pattern})+"
63
65
 
64
66
  if size == 1:
65
67
  tensor_pattern = float_pattern
@@ -81,7 +83,7 @@ def _counted_tensor_list(*, size: int, ignore: Regex) -> ParserElement:
81
83
 
82
84
  list_ <<= Regex(
83
85
  rf"\((?:{ignore_pattern})?(?:{tensor_pattern}{ignore_pattern}){{{length - 1}}}{tensor_pattern}(?:{ignore_pattern})?\)",
84
- re.IGNORECASE,
86
+ flags=re.IGNORECASE,
85
87
  )
86
88
 
87
89
  count = common.integer.add_parse_action(count_parse_action)
@@ -89,19 +91,18 @@ def _counted_tensor_list(*, size: int, ignore: Regex) -> ParserElement:
89
91
  def list_parse_action(
90
92
  tks: ParseResults,
91
93
  ) -> list[list[float]] | list[list[list[float]]]:
92
- values = (
93
- re.sub(ignore.re, " ", tks[0]).replace("(", " ").replace(")", " ").split()
94
- )
94
+ values = [
95
+ float(v)
96
+ for v in re.sub(ignore.re, " ", tks[0])
97
+ .replace("(", " ")
98
+ .replace(")", " ")
99
+ .split()
100
+ ]
95
101
 
96
102
  if size == 1:
97
- return [[float(v) for v in values]]
103
+ return [values]
98
104
 
99
- return [
100
- [
101
- [float(v) for v in values[i : i + size]]
102
- for i in range(0, len(values), size)
103
- ]
104
- ]
105
+ return [[values[i : i + size] for i in range(0, len(values), size)]]
105
106
 
106
107
  list_.add_parse_action(list_parse_action)
107
108
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: foamlib
3
- Version: 0.7.1
3
+ Version: 0.7.2
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
File without changes
File without changes
File without changes
File without changes
File without changes