FourCIPP 1.7.0__py3-none-any.whl → 1.8.0__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.
- fourcipp/utils/yaml_io.py +5 -5
- fourcipp/version.py +2 -2
- {fourcipp-1.7.0.dist-info → fourcipp-1.8.0.dist-info}/METADATA +4 -3
- {fourcipp-1.7.0.dist-info → fourcipp-1.8.0.dist-info}/RECORD +8 -8
- {fourcipp-1.7.0.dist-info → fourcipp-1.8.0.dist-info}/WHEEL +0 -0
- {fourcipp-1.7.0.dist-info → fourcipp-1.8.0.dist-info}/entry_points.txt +0 -0
- {fourcipp-1.7.0.dist-info → fourcipp-1.8.0.dist-info}/licenses/LICENSE +0 -0
- {fourcipp-1.7.0.dist-info → fourcipp-1.8.0.dist-info}/top_level.txt +0 -0
fourcipp/utils/yaml_io.py
CHANGED
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
|
|
24
24
|
import json
|
|
25
25
|
import pathlib
|
|
26
|
-
import re
|
|
27
26
|
from typing import Callable
|
|
28
27
|
|
|
28
|
+
import regex
|
|
29
29
|
import ryml
|
|
30
30
|
|
|
31
31
|
from fourcipp.utils.typing import Path
|
|
@@ -50,12 +50,12 @@ def load_yaml(path_to_yaml_file: Path) -> dict:
|
|
|
50
50
|
)
|
|
51
51
|
|
|
52
52
|
# Convert `inf` to a string to avoid JSON parsing errors, see https://github.com/biojppm/rapidyaml/issues/312
|
|
53
|
-
json_str =
|
|
53
|
+
json_str = regex.sub(r":\s*(-?)inf\b", r': "\1inf"', json_str)
|
|
54
54
|
|
|
55
55
|
# Convert floats that are missing digits on either side of the decimal point
|
|
56
56
|
# so .5 to 0.5 and 5. to 5.0
|
|
57
|
-
json_str =
|
|
58
|
-
json_str =
|
|
57
|
+
json_str = regex.sub(r":\s*(-?)\.([0-9]+)", r": \g<1>0.\2", json_str)
|
|
58
|
+
json_str = regex.sub(r":\s*(-?)([0-9]+)\.(\D)", r": \1\2.0\3", json_str)
|
|
59
59
|
|
|
60
60
|
data = json.loads(json_str)
|
|
61
61
|
|
|
@@ -147,7 +147,7 @@ def dict_to_yaml_string(
|
|
|
147
147
|
|
|
148
148
|
if use_fourcipp_yaml_style:
|
|
149
149
|
# add spaces after commas in vectors
|
|
150
|
-
yaml_string =
|
|
150
|
+
yaml_string = regex.sub(r"(?<=\d),(?=\d)|(?<=\]),(?=\[)", ", ", yaml_string)
|
|
151
151
|
|
|
152
152
|
return yaml_string
|
|
153
153
|
|
fourcipp/version.py
CHANGED
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '1.
|
|
32
|
-
__version_tuple__ = version_tuple = (1,
|
|
31
|
+
__version__ = version = '1.8.0'
|
|
32
|
+
__version_tuple__ = version_tuple = (1, 8, 0)
|
|
33
33
|
|
|
34
34
|
__commit_id__ = commit_id = None
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: FourCIPP
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.8.0
|
|
4
4
|
Summary: A streamlined Python Parser for 4C input files
|
|
5
5
|
Author: FourCIPP Authors
|
|
6
6
|
License: The MIT License (MIT)
|
|
@@ -29,10 +29,11 @@ Project-URL: Issues, https://github.com/4C-multiphysics/fourcipp/issues/
|
|
|
29
29
|
Requires-Python: >=3.10
|
|
30
30
|
Description-Content-Type: text/markdown
|
|
31
31
|
License-File: LICENSE
|
|
32
|
-
Requires-Dist: rapidyaml
|
|
33
|
-
Requires-Dist: loguru
|
|
34
32
|
Requires-Dist: jsonschema-rs
|
|
33
|
+
Requires-Dist: loguru
|
|
35
34
|
Requires-Dist: numpy
|
|
35
|
+
Requires-Dist: rapidyaml
|
|
36
|
+
Requires-Dist: regex
|
|
36
37
|
Provides-Extra: dev
|
|
37
38
|
Requires-Dist: pre-commit; extra == "dev"
|
|
38
39
|
Requires-Dist: pytest; extra == "dev"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
fourcipp/__init__.py,sha256=4pz7DVXErSbUcLqPTaHnQfdJzKkpfZDivBqbHbTgpRE,1388
|
|
2
2
|
fourcipp/fourc_input.py,sha256=ocyxXdu8NFIRM94dc4EG_r8XsBkJajvw1YWHmZh-G6Y,23946
|
|
3
|
-
fourcipp/version.py,sha256=
|
|
3
|
+
fourcipp/version.py,sha256=phQCmpksYlbZjXJhFI2j2KILuWjD0mXWO3Hg8g_EC8c,704
|
|
4
4
|
fourcipp/config/4C_metadata.yaml,sha256=A2cJVUA_PMZ3Y_mGP-M3VhpQhLbSn1a1oh3gfGpJ9GQ,11868923
|
|
5
5
|
fourcipp/config/4C_schema.json,sha256=wDRSORrXQpg8cIhIOxeD2GTqfewUE4ygbPSeluSH7b0,16412271
|
|
6
6
|
fourcipp/config/config.yaml,sha256=n2c2a6E4HKfAdNWOQz1kLUuf5p4NLxIddaAi2t5eM38,460
|
|
@@ -19,10 +19,10 @@ fourcipp/utils/metadata.py,sha256=98jz9Gm8qdvZ-b1jwYObNJTaiMQWwbknvS70Nv6Gwhk,12
|
|
|
19
19
|
fourcipp/utils/not_set.py,sha256=04C_3axe2cupBYgfpgDAcGs1zHVzG3I58UGO58TH05A,2017
|
|
20
20
|
fourcipp/utils/typing.py,sha256=8iX9PuKe8B1WJ3vEjiM5ZfefvgYnaZDiSdB7Nx9SrVw,1625
|
|
21
21
|
fourcipp/utils/validation.py,sha256=FejHOj1MddaU7gEpMN-f8Mz3rYjflakd1qcsKnctHqA,5292
|
|
22
|
-
fourcipp/utils/yaml_io.py,sha256=
|
|
23
|
-
fourcipp-1.
|
|
24
|
-
fourcipp-1.
|
|
25
|
-
fourcipp-1.
|
|
26
|
-
fourcipp-1.
|
|
27
|
-
fourcipp-1.
|
|
28
|
-
fourcipp-1.
|
|
22
|
+
fourcipp/utils/yaml_io.py,sha256=GZtgBn-5OB7xAJmgjo66eG3JwkHnfQFp4VIA2-rVVSg,5765
|
|
23
|
+
fourcipp-1.8.0.dist-info/licenses/LICENSE,sha256=lkSOHdH9IZ8c3Vnz0fFjqls1cRlmLADBP8QEIwUlH3o,1082
|
|
24
|
+
fourcipp-1.8.0.dist-info/METADATA,sha256=zo4mdAtq6OTQ6JdCD7Jt0Qwiwa_tH0xzX6Oz6Sq_Q7A,7915
|
|
25
|
+
fourcipp-1.8.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
26
|
+
fourcipp-1.8.0.dist-info/entry_points.txt,sha256=44XBG4bwhuq1EwOZ0U055HYP8_qN6_d30ecVsa5Igng,53
|
|
27
|
+
fourcipp-1.8.0.dist-info/top_level.txt,sha256=oZ6jgFFmvi157VwGUEFuKT3D8oS5mOkpOVx8zZURZrQ,9
|
|
28
|
+
fourcipp-1.8.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|