foamlib 0.3.5__tar.gz → 0.3.7__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.
- {foamlib-0.3.5 → foamlib-0.3.7}/PKG-INFO +1 -1
- {foamlib-0.3.5 → foamlib-0.3.7}/foamlib/__init__.py +1 -1
- {foamlib-0.3.5 → foamlib-0.3.7}/foamlib/_files/_serialization.py +9 -7
- {foamlib-0.3.5 → foamlib-0.3.7}/foamlib/_util.py +2 -3
- {foamlib-0.3.5 → foamlib-0.3.7}/foamlib.egg-info/PKG-INFO +1 -1
- {foamlib-0.3.5 → foamlib-0.3.7}/LICENSE.txt +0 -0
- {foamlib-0.3.5 → foamlib-0.3.7}/README.md +0 -0
- {foamlib-0.3.5 → foamlib-0.3.7}/foamlib/_cases.py +0 -0
- {foamlib-0.3.5 → foamlib-0.3.7}/foamlib/_files/__init__.py +0 -0
- {foamlib-0.3.5 → foamlib-0.3.7}/foamlib/_files/_base.py +0 -0
- {foamlib-0.3.5 → foamlib-0.3.7}/foamlib/_files/_files.py +0 -0
- {foamlib-0.3.5 → foamlib-0.3.7}/foamlib/_files/_io.py +0 -0
- {foamlib-0.3.5 → foamlib-0.3.7}/foamlib/_files/_parsing.py +0 -0
- {foamlib-0.3.5 → foamlib-0.3.7}/foamlib/py.typed +0 -0
- {foamlib-0.3.5 → foamlib-0.3.7}/foamlib.egg-info/SOURCES.txt +0 -0
- {foamlib-0.3.5 → foamlib-0.3.7}/foamlib.egg-info/dependency_links.txt +0 -0
- {foamlib-0.3.5 → foamlib-0.3.7}/foamlib.egg-info/requires.txt +0 -0
- {foamlib-0.3.5 → foamlib-0.3.7}/foamlib.egg-info/top_level.txt +0 -0
- {foamlib-0.3.5 → foamlib-0.3.7}/pyproject.toml +0 -0
- {foamlib-0.3.5 → foamlib-0.3.7}/setup.cfg +0 -0
@@ -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"
|
@@ -74,8 +74,8 @@ def run_process(
|
|
74
74
|
proc = subprocess.run(
|
75
75
|
cmd,
|
76
76
|
cwd=cwd,
|
77
|
-
env=_env(cwd),
|
78
|
-
stdout=
|
77
|
+
env=_env(cwd) if not shell else None,
|
78
|
+
stdout=subprocess.DEVNULL,
|
79
79
|
stderr=subprocess.PIPE if check else subprocess.DEVNULL,
|
80
80
|
text=True,
|
81
81
|
shell=shell,
|
@@ -95,7 +95,6 @@ async def run_process_async(
|
|
95
95
|
proc = await asyncio.create_subprocess_shell(
|
96
96
|
str(cmd),
|
97
97
|
cwd=cwd,
|
98
|
-
env=_env(cwd),
|
99
98
|
stdout=asyncio.subprocess.DEVNULL,
|
100
99
|
stderr=asyncio.subprocess.PIPE if check else asyncio.subprocess.DEVNULL,
|
101
100
|
)
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|