foamlib 0.3.5__py3-none-any.whl → 0.3.6__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/_serialization.py +9 -7
- {foamlib-0.3.5.dist-info → foamlib-0.3.6.dist-info}/METADATA +1 -1
- {foamlib-0.3.5.dist-info → foamlib-0.3.6.dist-info}/RECORD +7 -7
- {foamlib-0.3.5.dist-info → foamlib-0.3.6.dist-info}/LICENSE.txt +0 -0
- {foamlib-0.3.5.dist-info → foamlib-0.3.6.dist-info}/WHEEL +0 -0
- {foamlib-0.3.5.dist-info → foamlib-0.3.6.dist-info}/top_level.txt +0 -0
foamlib/__init__.py
CHANGED
foamlib/_files/_serialization.py
CHANGED
@@ -21,7 +21,7 @@ except ModuleNotFoundError:
|
|
21
21
|
|
22
22
|
class Kind(Enum):
|
23
23
|
DEFAULT = auto()
|
24
|
-
|
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.
|
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)
|
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.
|
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,4 +1,4 @@
|
|
1
|
-
foamlib/__init__.py,sha256=
|
1
|
+
foamlib/__init__.py,sha256=NDQJMr0B-ctMVlQKNjlUr0ww2_ehQLp6IG9wzxwQ750,431
|
2
2
|
foamlib/_cases.py,sha256=ELwX-Gr3ZB11axG6coHqXDyGh9Xb7kgAfYkhCsEGZy4,20278
|
3
3
|
foamlib/_util.py,sha256=hh5gTJqEvQcqbt0_tA2xMceyqtAIaqNd78jvePdAQ7w,3037
|
4
4
|
foamlib/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -7,9 +7,9 @@ foamlib/_files/_base.py,sha256=YA5a-i5HZuA3JslCD6r-DwZzpSA8r42dqSXef286Ako,2050
|
|
7
7
|
foamlib/_files/_files.py,sha256=JcOVP3eu9QYCOPt_DfobigKsd0VqgJRfEVytMOwES_g,10815
|
8
8
|
foamlib/_files/_io.py,sha256=So9rG6iW77sRK2xFz5KHX6AFtYc2L19voAwn-_NmQow,2075
|
9
9
|
foamlib/_files/_parsing.py,sha256=-zSpEDjuPxzOdsLWaeQl7j6FZHyw2-jXNgOCXkcGskU,7308
|
10
|
-
foamlib/_files/_serialization.py,sha256=
|
11
|
-
foamlib-0.3.
|
12
|
-
foamlib-0.3.
|
13
|
-
foamlib-0.3.
|
14
|
-
foamlib-0.3.
|
15
|
-
foamlib-0.3.
|
10
|
+
foamlib/_files/_serialization.py,sha256=rmZW42Pyn1DIJbGMZqFG_lZ5DcLhPmfUgH24qsu2rIk,3400
|
11
|
+
foamlib-0.3.6.dist-info/LICENSE.txt,sha256=5Dte9TUnLZzPRs4NQzl-Jc2-Ljd-t_v0ZR5Ng5r0UsY,35131
|
12
|
+
foamlib-0.3.6.dist-info/METADATA,sha256=gC_cIiv5sYmOGmN691aO1HT5crThq1lFbVO8hlgUMdI,5037
|
13
|
+
foamlib-0.3.6.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
14
|
+
foamlib-0.3.6.dist-info/top_level.txt,sha256=ZdVYtetXGwPwyfL-WhlhbTFQGAwKX5P_gXxtH9JYFPI,8
|
15
|
+
foamlib-0.3.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|