FourCIPP 1.26.0__tar.gz → 1.27.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.
Files changed (66) hide show
  1. {fourcipp-1.26.0/src/FourCIPP.egg-info → fourcipp-1.27.0}/PKG-INFO +1 -1
  2. {fourcipp-1.26.0 → fourcipp-1.27.0/src/FourCIPP.egg-info}/PKG-INFO +1 -1
  3. {fourcipp-1.26.0 → fourcipp-1.27.0}/src/fourcipp/fourc_input.py +30 -10
  4. {fourcipp-1.26.0 → fourcipp-1.27.0}/src/fourcipp/version.py +3 -3
  5. {fourcipp-1.26.0 → fourcipp-1.27.0}/tests/fourcipp/test_fourc_input.py +14 -13
  6. {fourcipp-1.26.0 → fourcipp-1.27.0}/.coveragerc +0 -0
  7. {fourcipp-1.26.0 → fourcipp-1.27.0}/.github/workflows/check_code.yaml +0 -0
  8. {fourcipp-1.26.0 → fourcipp-1.27.0}/.github/workflows/publish_pypi.yaml +0 -0
  9. {fourcipp-1.26.0 → fourcipp-1.27.0}/.github/workflows/run_testsuite.yaml +0 -0
  10. {fourcipp-1.26.0 → fourcipp-1.27.0}/.github/workflows/tag_version.yaml +0 -0
  11. {fourcipp-1.26.0 → fourcipp-1.27.0}/.github/workflows/update_4C_metadata_schema_file.yaml +0 -0
  12. {fourcipp-1.26.0 → fourcipp-1.27.0}/.gitignore +0 -0
  13. {fourcipp-1.26.0 → fourcipp-1.27.0}/.pre-commit-config.yaml +0 -0
  14. {fourcipp-1.26.0 → fourcipp-1.27.0}/LICENSE +0 -0
  15. {fourcipp-1.26.0 → fourcipp-1.27.0}/README.md +0 -0
  16. {fourcipp-1.26.0 → fourcipp-1.27.0}/docs/assets/fourcipp_logo_black.svg +0 -0
  17. {fourcipp-1.26.0 → fourcipp-1.27.0}/docs/assets/fourcipp_logo_white.svg +0 -0
  18. {fourcipp-1.26.0 → fourcipp-1.27.0}/pyproject.toml +0 -0
  19. {fourcipp-1.26.0 → fourcipp-1.27.0}/requirements.in +0 -0
  20. {fourcipp-1.26.0 → fourcipp-1.27.0}/requirements.txt +0 -0
  21. {fourcipp-1.26.0 → fourcipp-1.27.0}/setup.cfg +0 -0
  22. {fourcipp-1.26.0 → fourcipp-1.27.0}/src/FourCIPP.egg-info/SOURCES.txt +0 -0
  23. {fourcipp-1.26.0 → fourcipp-1.27.0}/src/FourCIPP.egg-info/dependency_links.txt +0 -0
  24. {fourcipp-1.26.0 → fourcipp-1.27.0}/src/FourCIPP.egg-info/entry_points.txt +0 -0
  25. {fourcipp-1.26.0 → fourcipp-1.27.0}/src/FourCIPP.egg-info/requires.txt +0 -0
  26. {fourcipp-1.26.0 → fourcipp-1.27.0}/src/FourCIPP.egg-info/top_level.txt +0 -0
  27. {fourcipp-1.26.0 → fourcipp-1.27.0}/src/fourcipp/__init__.py +0 -0
  28. {fourcipp-1.26.0 → fourcipp-1.27.0}/src/fourcipp/config/4C_metadata.yaml +0 -0
  29. {fourcipp-1.26.0 → fourcipp-1.27.0}/src/fourcipp/config/4C_schema.json +0 -0
  30. {fourcipp-1.26.0 → fourcipp-1.27.0}/src/fourcipp/config/config.yaml +0 -0
  31. {fourcipp-1.26.0 → fourcipp-1.27.0}/src/fourcipp/legacy_io/__init__.py +0 -0
  32. {fourcipp-1.26.0 → fourcipp-1.27.0}/src/fourcipp/legacy_io/element.py +0 -0
  33. {fourcipp-1.26.0 → fourcipp-1.27.0}/src/fourcipp/legacy_io/inline_dat.py +0 -0
  34. {fourcipp-1.26.0 → fourcipp-1.27.0}/src/fourcipp/legacy_io/node.py +0 -0
  35. {fourcipp-1.26.0 → fourcipp-1.27.0}/src/fourcipp/legacy_io/node_topology.py +0 -0
  36. {fourcipp-1.26.0 → fourcipp-1.27.0}/src/fourcipp/legacy_io/particle.py +0 -0
  37. {fourcipp-1.26.0 → fourcipp-1.27.0}/src/fourcipp/utils/__init__.py +0 -0
  38. {fourcipp-1.26.0 → fourcipp-1.27.0}/src/fourcipp/utils/cli.py +0 -0
  39. {fourcipp-1.26.0 → fourcipp-1.27.0}/src/fourcipp/utils/configuration.py +0 -0
  40. {fourcipp-1.26.0 → fourcipp-1.27.0}/src/fourcipp/utils/converter.py +0 -0
  41. {fourcipp-1.26.0 → fourcipp-1.27.0}/src/fourcipp/utils/dict_utils.py +0 -0
  42. {fourcipp-1.26.0 → fourcipp-1.27.0}/src/fourcipp/utils/metadata.py +0 -0
  43. {fourcipp-1.26.0 → fourcipp-1.27.0}/src/fourcipp/utils/not_set.py +0 -0
  44. {fourcipp-1.26.0 → fourcipp-1.27.0}/src/fourcipp/utils/type_hinting.py +0 -0
  45. {fourcipp-1.26.0 → fourcipp-1.27.0}/src/fourcipp/utils/validation.py +0 -0
  46. {fourcipp-1.26.0 → fourcipp-1.27.0}/src/fourcipp/utils/yaml_io.py +0 -0
  47. {fourcipp-1.26.0 → fourcipp-1.27.0}/tests/__init__.py +0 -0
  48. {fourcipp-1.26.0 → fourcipp-1.27.0}/tests/conftest.py +0 -0
  49. {fourcipp-1.26.0 → fourcipp-1.27.0}/tests/fourcipp/__init__.py +0 -0
  50. {fourcipp-1.26.0 → fourcipp-1.27.0}/tests/fourcipp/legacy_io/__init__.py +0 -0
  51. {fourcipp-1.26.0 → fourcipp-1.27.0}/tests/fourcipp/legacy_io/test_element.py +0 -0
  52. {fourcipp-1.26.0 → fourcipp-1.27.0}/tests/fourcipp/legacy_io/test_inline_dat.py +0 -0
  53. {fourcipp-1.26.0 → fourcipp-1.27.0}/tests/fourcipp/legacy_io/test_legacy_io.py +0 -0
  54. {fourcipp-1.26.0 → fourcipp-1.27.0}/tests/fourcipp/legacy_io/test_node.py +0 -0
  55. {fourcipp-1.26.0 → fourcipp-1.27.0}/tests/fourcipp/legacy_io/test_node_topology.py +0 -0
  56. {fourcipp-1.26.0 → fourcipp-1.27.0}/tests/fourcipp/legacy_io/test_particle.py +0 -0
  57. {fourcipp-1.26.0 → fourcipp-1.27.0}/tests/fourcipp/legacy_io/utils.py +0 -0
  58. {fourcipp-1.26.0 → fourcipp-1.27.0}/tests/fourcipp/test_readme_quickstart_example.py +0 -0
  59. {fourcipp-1.26.0 → fourcipp-1.27.0}/tests/fourcipp/utils/__init__.py +0 -0
  60. {fourcipp-1.26.0 → fourcipp-1.27.0}/tests/fourcipp/utils/test_configuration.py +0 -0
  61. {fourcipp-1.26.0 → fourcipp-1.27.0}/tests/fourcipp/utils/test_converter.py +0 -0
  62. {fourcipp-1.26.0 → fourcipp-1.27.0}/tests/fourcipp/utils/test_dict_utils.py +0 -0
  63. {fourcipp-1.26.0 → fourcipp-1.27.0}/tests/fourcipp/utils/test_metadata.py +0 -0
  64. {fourcipp-1.26.0 → fourcipp-1.27.0}/tests/fourcipp/utils/test_not_set.py +0 -0
  65. {fourcipp-1.26.0 → fourcipp-1.27.0}/tests/fourcipp/utils/test_validation.py +0 -0
  66. {fourcipp-1.26.0 → fourcipp-1.27.0}/tests/fourcipp/utils/test_yaml_io.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: FourCIPP
3
- Version: 1.26.0
3
+ Version: 1.27.0
4
4
  Summary: A streamlined Python Parser for 4C input files
5
5
  Author: FourCIPP Authors
6
6
  License: The MIT License (MIT)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: FourCIPP
3
- Version: 1.26.0
3
+ Version: 1.27.0
4
4
  Summary: A streamlined Python Parser for 4C input files
5
5
  Author: FourCIPP Authors
6
6
  License: The MIT License (MIT)
@@ -75,8 +75,12 @@ def sort_by_section_names(data: dict) -> dict:
75
75
  This sorts the dictionary in the following style:
76
76
 
77
77
  1. "TITLE" section
78
- 2. Alphabetically sorted sections
79
- 3. Alphabetically sorted legacy sections
78
+ 2. Required sections (in schema order)
79
+ 3. Typed sections (alphabetically, case-insensitive)
80
+ 3.1 MATERIALS section
81
+ 3.2 'DESIGN *' sections (alphabetically, case-insensitive)
82
+ 4. FUNCT sections (numeric order)
83
+ 5. Legacy sections (alphabetically)
80
84
 
81
85
  Args:
82
86
  data: Dictionary to sort.
@@ -89,10 +93,23 @@ def sort_by_section_names(data: dict) -> dict:
89
93
  required_sections = CONFIG.fourc_json_schema["required"]
90
94
  n_sections_splitter = len(CONFIG.sections.all_sections) * 1000
91
95
 
92
- # collect typed sections + numeric FUNCT sections
93
- typed_and_funct = sorted(
94
- sorted(CONFIG.sections.typed_sections, key=str.lower)
95
- + [s for s in data.keys() if s.startswith("FUNCT") and s[5:].isdigit()],
96
+ # typed sections (sorted alphabetically + case insensitive, 'DESIGN *' + 'MATERIALS' at the end)
97
+ design_sections = [
98
+ s for s in CONFIG.sections.typed_sections if s.startswith("DESIGN")
99
+ ]
100
+ remaining_typed_sections = list(
101
+ set(CONFIG.sections.typed_sections) - set(design_sections) - set(["MATERIALS"])
102
+ )
103
+
104
+ typed_sections = (
105
+ sorted(remaining_typed_sections, key=str.lower)
106
+ + ["MATERIALS"]
107
+ + sorted(design_sections, key=str.lower)
108
+ )
109
+
110
+ # function sections (sorted numerically)
111
+ functions = sorted(
112
+ [s for s in data.keys() if s.startswith("FUNCT") and s[5:].isdigit()],
96
113
  key=lambda s: (
97
114
  s.lower() if not s.startswith("FUNCT") else f"funct{s[5:].zfill(10)}"
98
115
  ),
@@ -115,12 +132,15 @@ def sort_by_section_names(data: dict) -> dict:
115
132
  # Required sections
116
133
  elif section in required_sections:
117
134
  return 1 * n_sections_splitter + required_sections.index(section)
118
- # Typed + FUNCT sections (alphabetical + case insensitive)
119
- elif section in typed_and_funct:
120
- return 2 * n_sections_splitter + typed_and_funct.index(section)
135
+ # Typed sections (alphabetical + case insensitive)
136
+ elif section in typed_sections:
137
+ return 2 * n_sections_splitter + typed_sections.index(section)
138
+ # Function sections (numeric order)
139
+ elif section in functions:
140
+ return 3 * n_sections_splitter + functions.index(section)
121
141
  # Legacy sections
122
142
  elif section in CONFIG.sections.legacy_sections:
123
- return 3 * n_sections_splitter + CONFIG.sections.legacy_sections.index(
143
+ return 4 * n_sections_splitter + CONFIG.sections.legacy_sections.index(
124
144
  section
125
145
  )
126
146
  # Unknown section
@@ -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.26.0'
32
- __version_tuple__ = version_tuple = (1, 26, 0)
31
+ __version__ = version = '1.27.0'
32
+ __version_tuple__ = version_tuple = (1, 27, 0)
33
33
 
34
- __commit_id__ = commit_id = 'g97ad46bb9'
34
+ __commit_id__ = commit_id = 'gba4ffa9e5'
@@ -566,24 +566,25 @@ def test_sort_by_section_names():
566
566
  ]
567
567
 
568
568
  # also use end subset to also add some lowercase sections
569
- typed_and_functions = (
570
- typed_sections[:15]
571
- + typed_sections[-15:]
572
- + [f"FUNCT{i}" for i in [1, 2, 9, 10, 33]]
573
- )
569
+ typed_sections = typed_sections[:15] + typed_sections[-15:]
570
+ typed_sections = sorted(typed_sections, key=str.lower)
574
571
 
575
- # sort with proper key: alphabetically for typed, numerically for FUNCT
576
- typed_and_functions = sorted(
577
- typed_and_functions,
578
- key=lambda s: (
579
- s.lower() if not s.startswith("FUNCT") else f"funct{s[5:].zfill(10)}"
580
- ),
581
- )
572
+ # use first 5 'DESIGN * ' sections
573
+ design_sections = [
574
+ s for s in CONFIG.sections.typed_sections if s.startswith("DESIGN")
575
+ ][:5]
576
+ design_sections = sorted(design_sections, key=str.lower)
577
+
578
+ # create some FUNCT sections
579
+ function_sections = [f"FUNCT{i}" for i in [1, 2, 9, 10, 33]]
582
580
 
583
581
  correct_section_order = (
584
582
  [CONFIG.fourc_metadata["metadata"]["description_section_name"]]
585
583
  + CONFIG.fourc_json_schema["required"]
586
- + typed_and_functions
584
+ + typed_sections
585
+ + ["MATERIALS"]
586
+ + design_sections
587
+ + function_sections
587
588
  + CONFIG.sections.legacy_sections
588
589
  )
589
590
 
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