FourCIPP 1.5.0__tar.gz → 1.6.0__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.
- {fourcipp-1.5.0/src/FourCIPP.egg-info → fourcipp-1.6.0}/PKG-INFO +1 -1
- {fourcipp-1.5.0 → fourcipp-1.6.0/src/FourCIPP.egg-info}/PKG-INFO +1 -1
- {fourcipp-1.5.0 → fourcipp-1.6.0}/src/fourcipp/fourc_input.py +2 -2
- {fourcipp-1.5.0 → fourcipp-1.6.0}/src/fourcipp/utils/yaml_io.py +7 -1
- {fourcipp-1.5.0 → fourcipp-1.6.0}/src/fourcipp/version.py +3 -3
- {fourcipp-1.5.0 → fourcipp-1.6.0}/tests/fourcipp/test_fourc_input.py +2 -2
- {fourcipp-1.5.0 → fourcipp-1.6.0}/tests/fourcipp/utils/test_yaml_io.py +3 -3
- {fourcipp-1.5.0 → fourcipp-1.6.0}/.coveragerc +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/.github/workflows/check_code.yaml +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/.github/workflows/publish_pypi.yaml +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/.github/workflows/run_testsuite.yaml +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/.github/workflows/tag_version.yaml +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/.github/workflows/update_4C_metadata_schema_file.yaml +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/.gitignore +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/.pre-commit-config.yaml +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/LICENSE +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/README.md +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/docs/assets/fourcipp_logo_black.svg +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/docs/assets/fourcipp_logo_white.svg +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/pyproject.toml +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/requirements.in +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/requirements.txt +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/setup.cfg +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/src/FourCIPP.egg-info/SOURCES.txt +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/src/FourCIPP.egg-info/dependency_links.txt +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/src/FourCIPP.egg-info/entry_points.txt +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/src/FourCIPP.egg-info/requires.txt +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/src/FourCIPP.egg-info/top_level.txt +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/src/fourcipp/__init__.py +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/src/fourcipp/config/4C_metadata.yaml +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/src/fourcipp/config/4C_schema.json +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/src/fourcipp/config/config.yaml +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/src/fourcipp/legacy_io/__init__.py +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/src/fourcipp/legacy_io/element.py +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/src/fourcipp/legacy_io/inline_dat.py +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/src/fourcipp/legacy_io/node.py +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/src/fourcipp/legacy_io/node_topology.py +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/src/fourcipp/legacy_io/particle.py +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/src/fourcipp/utils/__init__.py +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/src/fourcipp/utils/cli.py +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/src/fourcipp/utils/configuration.py +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/src/fourcipp/utils/converter.py +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/src/fourcipp/utils/dict_utils.py +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/src/fourcipp/utils/metadata.py +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/src/fourcipp/utils/not_set.py +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/src/fourcipp/utils/typing.py +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/src/fourcipp/utils/validation.py +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/tests/__init__.py +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/tests/conftest.py +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/tests/fourcipp/__init__.py +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/tests/fourcipp/legacy_io/__init__.py +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/tests/fourcipp/legacy_io/test_element.py +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/tests/fourcipp/legacy_io/test_inline_dat.py +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/tests/fourcipp/legacy_io/test_legacy_io.py +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/tests/fourcipp/legacy_io/test_node.py +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/tests/fourcipp/legacy_io/test_node_topology.py +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/tests/fourcipp/legacy_io/test_particle.py +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/tests/fourcipp/legacy_io/utils.py +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/tests/fourcipp/test_readme_quickstart_example.py +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/tests/fourcipp/utils/__init__.py +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/tests/fourcipp/utils/test_configuration.py +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/tests/fourcipp/utils/test_converter.py +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/tests/fourcipp/utils/test_dict_utils.py +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/tests/fourcipp/utils/test_not_set.py +0 -0
- {fourcipp-1.5.0 → fourcipp-1.6.0}/tests/fourcipp/utils/test_validation.py +0 -0
|
@@ -69,7 +69,7 @@ def is_section_known(section_name: str, known_section_names: list[str]) -> bool:
|
|
|
69
69
|
return section_name in known_section_names or section_name.startswith("FUNCT")
|
|
70
70
|
|
|
71
71
|
|
|
72
|
-
def
|
|
72
|
+
def sort_by_section_names(data: dict) -> dict:
|
|
73
73
|
"""Sort a dictionary by its 4C sections.
|
|
74
74
|
|
|
75
75
|
This sorts the dictionary in the following style:
|
|
@@ -495,7 +495,7 @@ class FourCInput:
|
|
|
495
495
|
validate: bool = False,
|
|
496
496
|
validate_sections_only: bool = False,
|
|
497
497
|
convert_to_native_types: bool = True,
|
|
498
|
-
sort_function: Callable[[dict], dict] | None =
|
|
498
|
+
sort_function: Callable[[dict], dict] | None = sort_by_section_names,
|
|
499
499
|
use_fourcipp_yaml_style: bool = True,
|
|
500
500
|
) -> None:
|
|
501
501
|
"""Dump object to yaml.
|
|
@@ -143,7 +143,13 @@ def dict_to_yaml_string(
|
|
|
143
143
|
if tree.has_key(node_id):
|
|
144
144
|
tree.set_key_style(node_id, ryml.NOTYPE)
|
|
145
145
|
|
|
146
|
-
|
|
146
|
+
yaml_string = ryml.emit_yaml(tree)
|
|
147
|
+
|
|
148
|
+
if use_fourcipp_yaml_style:
|
|
149
|
+
# add spaces after commas in vectors
|
|
150
|
+
yaml_string = re.sub(r"(?<=\d),(?=\d)|(?<=\]),(?=\[)", ", ", yaml_string)
|
|
151
|
+
|
|
152
|
+
return yaml_string
|
|
147
153
|
|
|
148
154
|
|
|
149
155
|
def dump_yaml(
|
|
@@ -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.6.0'
|
|
32
|
+
__version_tuple__ = version_tuple = (1, 6, 0)
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'g789740a0d'
|
|
@@ -34,7 +34,7 @@ from fourcipp import CONFIG
|
|
|
34
34
|
from fourcipp.fourc_input import (
|
|
35
35
|
FourCInput,
|
|
36
36
|
UnknownSectionException,
|
|
37
|
-
|
|
37
|
+
sort_by_section_names,
|
|
38
38
|
)
|
|
39
39
|
from fourcipp.utils.cli import modify_input_with_defaults
|
|
40
40
|
from fourcipp.utils.validation import ValidationError
|
|
@@ -593,7 +593,7 @@ def test_sort_by_section_names():
|
|
|
593
593
|
|
|
594
594
|
shuffled_data = {k: 1 for k in shuffled_section_order}
|
|
595
595
|
|
|
596
|
-
sorted_data =
|
|
596
|
+
sorted_data = sort_by_section_names(shuffled_data)
|
|
597
597
|
|
|
598
598
|
assert list(sorted_data.keys()) == correct_section_order
|
|
599
599
|
|
|
@@ -86,8 +86,8 @@ def test_dump_sorted_alphabetically(tmp_path):
|
|
|
86
86
|
(
|
|
87
87
|
True,
|
|
88
88
|
"""SECTION:
|
|
89
|
-
- vector: [1.23,2,3]
|
|
90
|
-
nested_vector: [[1,2.0,3],[4.5,5,2.333]]
|
|
89
|
+
- vector: [1.23, 2, 3]
|
|
90
|
+
nested_vector: [[1, 2.0, 3], [4.5, 5, 2.333]]
|
|
91
91
|
- list_with_bool:
|
|
92
92
|
- 1
|
|
93
93
|
- true
|
|
@@ -101,7 +101,7 @@ def test_dump_sorted_alphabetically(tmp_path):
|
|
|
101
101
|
- "abc"
|
|
102
102
|
- 5
|
|
103
103
|
nested_list_with_string:
|
|
104
|
-
- [1,2.1]
|
|
104
|
+
- [1, 2.1]
|
|
105
105
|
- - 2
|
|
106
106
|
- "def"
|
|
107
107
|
""",
|
|
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
|
|
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
|
|
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
|
|
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
|