foamlib 0.3.5__tar.gz → 0.3.6__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: foamlib
3
- Version: 0.3.5
3
+ Version: 0.3.6
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.3.5"
3
+ __version__ = "0.3.6"
4
4
 
5
5
  from ._cases import AsyncFoamCase, FoamCase, FoamCaseBase
6
6
  from ._files import FoamDict, FoamFieldFile, FoamFile
@@ -21,7 +21,7 @@ except ModuleNotFoundError:
21
21
 
22
22
  class Kind(Enum):
23
23
  DEFAULT = auto()
24
- LIST_ENTRY = auto()
24
+ SINGLE_ENTRY = auto()
25
25
  FIELD = auto()
26
26
  BINARY_FIELD = auto()
27
27
  DIMENSIONS = auto()
@@ -60,7 +60,7 @@ def dumpb(
60
60
  and isinstance(data[0], (int, float))
61
61
  and len(data) in (3, 6, 9)
62
62
  ):
63
- return b"uniform " + dumpb(data)
63
+ return b"uniform " + dumpb(data, kind=Kind.SINGLE_ENTRY)
64
64
 
65
65
  elif (kind == Kind.FIELD or kind == Kind.BINARY_FIELD) and is_sequence(data):
66
66
  if isinstance(data[0], (int, float)):
@@ -84,11 +84,11 @@ def dumpb(
84
84
  + b")"
85
85
  )
86
86
  else:
87
- contents = dumpb(data)
87
+ contents = dumpb(data, kind=Kind.SINGLE_ENTRY)
88
88
 
89
89
  return b"nonuniform List<" + tensor_kind + b"> " + dumpb(len(data)) + contents
90
90
 
91
- elif kind != Kind.LIST_ENTRY and isinstance(data, tuple):
91
+ elif kind != Kind.SINGLE_ENTRY and isinstance(data, tuple):
92
92
  return b" ".join(dumpb(v) for v in data)
93
93
 
94
94
  elif isinstance(data, FoamDict.Dimensioned):
@@ -98,15 +98,17 @@ def dumpb(
98
98
  + b" "
99
99
  + dumpb(data.dimensions, kind=Kind.DIMENSIONS)
100
100
  + b" "
101
- + dumpb(data.value)
101
+ + dumpb(data.value, kind=Kind.SINGLE_ENTRY)
102
102
  )
103
103
  else:
104
104
  return (
105
- dumpb(data.dimensions, kind=Kind.DIMENSIONS) + b" " + dumpb(data.value)
105
+ dumpb(data.dimensions, kind=Kind.DIMENSIONS)
106
+ + b" "
107
+ + dumpb(data.value, kind=Kind.SINGLE_ENTRY)
106
108
  )
107
109
 
108
110
  elif is_sequence(data):
109
- return b"(" + b" ".join(dumpb(v, kind=Kind.LIST_ENTRY) for v in data) + b")"
111
+ return b"(" + b" ".join(dumpb(v, kind=Kind.SINGLE_ENTRY) for v in data) + b")"
110
112
 
111
113
  elif data is True:
112
114
  return b"yes"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: foamlib
3
- Version: 0.3.5
3
+ Version: 0.3.6
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