FourCIPP 1.50.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/__init__.py +34 -0
- fourcipp/config/4C_metadata.yaml +63447 -0
- fourcipp/config/4C_schema.json +402481 -0
- fourcipp/config/config.yaml +12 -0
- fourcipp/fourc_input.py +697 -0
- fourcipp/legacy_io/__init__.py +162 -0
- fourcipp/legacy_io/element.py +135 -0
- fourcipp/legacy_io/inline_dat.py +224 -0
- fourcipp/legacy_io/node.py +114 -0
- fourcipp/legacy_io/node_topology.py +194 -0
- fourcipp/legacy_io/particle.py +71 -0
- fourcipp/utils/__init__.py +22 -0
- fourcipp/utils/cli.py +168 -0
- fourcipp/utils/configuration.py +222 -0
- fourcipp/utils/converter.py +138 -0
- fourcipp/utils/dict_utils.py +407 -0
- fourcipp/utils/metadata.py +1017 -0
- fourcipp/utils/not_set.py +77 -0
- fourcipp/utils/type_hinting.py +44 -0
- fourcipp/utils/validation.py +155 -0
- fourcipp/utils/yaml_io.py +172 -0
- fourcipp/version.py +34 -0
- fourcipp-1.50.0.dist-info/METADATA +225 -0
- fourcipp-1.50.0.dist-info/RECORD +28 -0
- fourcipp-1.50.0.dist-info/WHEEL +5 -0
- fourcipp-1.50.0.dist-info/entry_points.txt +2 -0
- fourcipp-1.50.0.dist-info/licenses/LICENSE +21 -0
- fourcipp-1.50.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: FourCIPP
|
|
3
|
+
Version: 1.50.0
|
|
4
|
+
Summary: A streamlined Python Parser for 4C input files
|
|
5
|
+
Author: FourCIPP Authors
|
|
6
|
+
License: The MIT License (MIT)
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2025 FourCIPP Authors
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in
|
|
18
|
+
all copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
26
|
+
THE SOFTWARE.
|
|
27
|
+
Project-URL: Repository, https://github.com/4C-multiphysics/fourcipp/
|
|
28
|
+
Project-URL: Issues, https://github.com/4C-multiphysics/fourcipp/issues/
|
|
29
|
+
Requires-Python: >=3.10
|
|
30
|
+
Description-Content-Type: text/markdown
|
|
31
|
+
License-File: LICENSE
|
|
32
|
+
Requires-Dist: jsonschema-rs
|
|
33
|
+
Requires-Dist: loguru
|
|
34
|
+
Requires-Dist: numpy
|
|
35
|
+
Requires-Dist: rapidyaml
|
|
36
|
+
Requires-Dist: regex
|
|
37
|
+
Provides-Extra: dev
|
|
38
|
+
Requires-Dist: pre-commit; extra == "dev"
|
|
39
|
+
Requires-Dist: pytest; extra == "dev"
|
|
40
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
41
|
+
Requires-Dist: pip-tools; extra == "dev"
|
|
42
|
+
Requires-Dist: pytest-xdist; extra == "dev"
|
|
43
|
+
Dynamic: license-file
|
|
44
|
+
|
|
45
|
+
<p align="center">
|
|
46
|
+
<picture>
|
|
47
|
+
<source
|
|
48
|
+
srcset="https://raw.githubusercontent.com/4C-multiphysics/fourcipp/refs/heads/main/docs/assets/fourcipp_logo_white.svg"
|
|
49
|
+
media="(prefers-color-scheme: dark)">
|
|
50
|
+
<img
|
|
51
|
+
src="https://raw.githubusercontent.com/4C-multiphysics/fourcipp/refs/heads/main/docs/assets/fourcipp_logo_black.svg"
|
|
52
|
+
width="300"
|
|
53
|
+
title="FourCIPP"
|
|
54
|
+
alt="FourCIPP logo">
|
|
55
|
+
</picture>
|
|
56
|
+
</p>
|
|
57
|
+
|
|
58
|
+
FourCIPP (**FourC** **I**nput **P**ython **P**arser) holds a Python Parser to simply interact with [4C](https://github.com/4C-multiphysics/4C) YAML input files. This tool provides a streamlined approach to data handling for third party tools.
|
|
59
|
+
|
|
60
|
+
## Overview <!-- omit from toc -->
|
|
61
|
+
- [Installation](#installation)
|
|
62
|
+
- [Python Environment](#python-environment)
|
|
63
|
+
- [Installation from PyPI](#installation-from-pypi)
|
|
64
|
+
- [Installation from Github (most recent version)](#installation-from-github-most-recent-version)
|
|
65
|
+
- [Installation from source](#installation-from-source)
|
|
66
|
+
- [Quickstart example](#quickstart-example)
|
|
67
|
+
- [Configuration](#configuration)
|
|
68
|
+
- [Developing FourCIPP](#developing-fourcipp)
|
|
69
|
+
- [Dependency Management](#dependency-management)
|
|
70
|
+
- [License](#license)
|
|
71
|
+
|
|
72
|
+
## Installation
|
|
73
|
+
|
|
74
|
+
### Python Environment
|
|
75
|
+
|
|
76
|
+
FourCIPP is a Python project supporting Python versions 3.10 - 3.13. To use FourCIPP it is recommended to install it into a virtual Python environment such as [Conda](https://anaconda.org/anaconda/conda)/[Miniforge](https://conda-forge.org/download/) or [venv](https://docs.python.org/3/library/venv.html).
|
|
77
|
+
|
|
78
|
+
An exemplary [Conda](https://anaconda.org/anaconda/conda)/[Miniforge](https://conda-forge.org/download/) environment can be created and loaded with
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# Create the environment (this only has to be done once)
|
|
82
|
+
conda create -n fourcipp python=3.13
|
|
83
|
+
# Activate the environment
|
|
84
|
+
conda activate fourcipp
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
To now install FourCIPP different ways exist.
|
|
88
|
+
|
|
89
|
+
### Installation from PyPI
|
|
90
|
+
|
|
91
|
+
FourCIPP is published on [PyPI](https://pypi.org/project/FourCIPP/) as a universal wheel, meaning you can install it on Windows, Linux and macOS with:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
pip install fourcipp
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
or a specific version with:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
pip install fourcipp==0.28.0
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Installation from Github (most recent version)
|
|
104
|
+
|
|
105
|
+
Additionally, the latest `main` version of FourCIPP can be installed directly from Github via:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
pip install git+https://github.com/4C-multiphysics/fourcipp.git@main
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Installation from source
|
|
112
|
+
|
|
113
|
+
If you intend on developing FourCIPP it is crucial to install FourCIPP from source, i.e., cloning the repository from Github. You can then either install it in a non-editable or editable fashion.
|
|
114
|
+
|
|
115
|
+
- Install all requirements without fixed versions in a non-editable fashion via:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
# located at the root of the repository
|
|
119
|
+
pip install .
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
and without fixed versions in an editable fashion via:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
# located at the root of the repository
|
|
126
|
+
pip install -e .
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
> Note: This is the default behavior. This allows to use fourcipp within other projects without version conflicts.
|
|
130
|
+
|
|
131
|
+
- Alternatively, you can install all requirements with fixed versions in a non-editable fashion with:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
pip install .[safe]
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
and with fixed versions in an editable fashion via:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
# located at the root of the repository
|
|
141
|
+
pip install -e .[safe]
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Once installed, FourCIPP is ready to be used 🎉
|
|
145
|
+
|
|
146
|
+
## Quickstart example
|
|
147
|
+
<!--example, do not remove this comment-->
|
|
148
|
+
```python
|
|
149
|
+
from fourcipp.fourc_input import FourCInput
|
|
150
|
+
|
|
151
|
+
# Create a new 4C input via
|
|
152
|
+
input_4C = FourCInput()
|
|
153
|
+
|
|
154
|
+
# Or load an existing input file
|
|
155
|
+
input_4C = FourCInput.from_4C_yaml(input_file_path)
|
|
156
|
+
|
|
157
|
+
# Add or overwrite sections
|
|
158
|
+
input_4C["PROBLEM TYPE"] = {"PROBLEMTYPE": "Structure"}
|
|
159
|
+
input_4C["PROBLEM SIZE"] = {"DIM": 3, "ELEMENTS": 1_000}
|
|
160
|
+
|
|
161
|
+
# Update section parameter
|
|
162
|
+
input_4C["PROBLEM SIZE"]["ELEMENTS"] = 1_000_000
|
|
163
|
+
|
|
164
|
+
# Add new parameter
|
|
165
|
+
input_4C["PROBLEM SIZE"]["NODES"] = 10_000_000
|
|
166
|
+
|
|
167
|
+
# Remove section
|
|
168
|
+
removed_section = input_4C.pop("PROBLEM SIZE")
|
|
169
|
+
|
|
170
|
+
# Dump to file
|
|
171
|
+
input_4C.dump(input_file_path, validate=True)
|
|
172
|
+
```
|
|
173
|
+
<!--example, do not remove this comment-->
|
|
174
|
+
|
|
175
|
+
## Configuration
|
|
176
|
+
FourCIPP utilizes the `4C_metadata.yaml` and `schema.json` files generated during the 4C build to remain up-to-date with your 4C build. By default, the files for the latest 4C input version can be found in `src/fourcipp/config`. You can add custom metadata and schema paths to the configuration file `src/fourcipp/config/config.yaml` by adding a new profile:
|
|
177
|
+
```yaml
|
|
178
|
+
profile: your_custom_files
|
|
179
|
+
profiles:
|
|
180
|
+
your_custom_files:
|
|
181
|
+
4C_metadata_path: /absolute/path/to/your/4C_metadata.yaml
|
|
182
|
+
json_schema_path: /absolute/path/to/your/4C_schema.json
|
|
183
|
+
default:
|
|
184
|
+
4C_metadata_path: 4C_metadata.yaml
|
|
185
|
+
json_schema_path: 4C_schema.json
|
|
186
|
+
description: 4C metadata from the latest successful nightly 4C build
|
|
187
|
+
4C_docker_main:
|
|
188
|
+
4C_metadata_path: /home/user/4C/build/4C_metadata.yaml
|
|
189
|
+
json_schema_path: /home/user/4C/build/4C_schema.json
|
|
190
|
+
description: 4C metadata in the main 4C docker image
|
|
191
|
+
```
|
|
192
|
+
and select it using the `profile` entry.
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
## Developing FourCIPP
|
|
196
|
+
|
|
197
|
+
If you plan on actively developing FourCIPP it is advisable to install in editable mode with the additional developer requirements like
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
pip install -e .[dev]
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
> Note: The developer requirements can also be installed in non-editable installs. Finally, you can install the pre-commit hook with:
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
pre-commit install
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
## Dependency Management
|
|
210
|
+
|
|
211
|
+
To ease the dependency update process [`pip-tools`](https://github.com/jazzband/pip-tools) is utilized. To create the necessary [`requirements.txt`](./requirements.txt) file simply execute
|
|
212
|
+
|
|
213
|
+
```
|
|
214
|
+
pip-compile --all-extras --output-file=requirements.txt requirements.in
|
|
215
|
+
````
|
|
216
|
+
|
|
217
|
+
To upgrade the dependencies simply execute
|
|
218
|
+
|
|
219
|
+
```
|
|
220
|
+
pip-compile --all-extras --output-file=requirements.txt --upgrade requirements.in
|
|
221
|
+
````
|
|
222
|
+
|
|
223
|
+
## License
|
|
224
|
+
|
|
225
|
+
This project is licensed under a MIT license. For further information check [`LICENSE`](./LICENSE).
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
fourcipp/__init__.py,sha256=4pz7DVXErSbUcLqPTaHnQfdJzKkpfZDivBqbHbTgpRE,1388
|
|
2
|
+
fourcipp/fourc_input.py,sha256=U_1b3XtZpXZfRV3ZAWiZzpAKtLWWrdBXow2r3wNPWao,24720
|
|
3
|
+
fourcipp/version.py,sha256=_Pf-vbXKGGS2hP-Yx1JBi6Y-zBGNCXuwL2wRrnt_z_s,706
|
|
4
|
+
fourcipp/config/4C_metadata.yaml,sha256=fH7pvqpAo7aAwAPF-DGylg9MWnGvRspyE70WKePIm38,2610998
|
|
5
|
+
fourcipp/config/4C_schema.json,sha256=Rvi-K3HVOO_Z5TKkuMsPmqscTE7XUiQ85NfctYCun2o,16562584
|
|
6
|
+
fourcipp/config/config.yaml,sha256=n2c2a6E4HKfAdNWOQz1kLUuf5p4NLxIddaAi2t5eM38,460
|
|
7
|
+
fourcipp/legacy_io/__init__.py,sha256=L3MWW-WjPbPAJVX8Z0Uheftn0dRPnqNnSBic3uloFhI,5750
|
|
8
|
+
fourcipp/legacy_io/element.py,sha256=rP8F-m-8ZCwCxtV_OASvvLeNYr01zsmgZsDZSJ_G1gY,3977
|
|
9
|
+
fourcipp/legacy_io/inline_dat.py,sha256=tudLWZlCq6JZgSc1WhzNw233XNWxkmEQ7oGDd2UEgB4,6941
|
|
10
|
+
fourcipp/legacy_io/node.py,sha256=e7m0W7dai_b1XgaqD37k3QS44ySCas3HetmyTLS9_78,3522
|
|
11
|
+
fourcipp/legacy_io/node_topology.py,sha256=hqGGzhyNhFX-BMW8SzztfzM8zoZLLltVScMv-p4hDH0,5394
|
|
12
|
+
fourcipp/legacy_io/particle.py,sha256=8LoRsyKVfhl5Qf_EoO8vLmbH0QSpB_Nho464ifkHAZc,2172
|
|
13
|
+
fourcipp/utils/__init__.py,sha256=ccdlf4taJ0mKLg_ru8ilXEa72PoO9N2UIxHNHDEtQmY,1151
|
|
14
|
+
fourcipp/utils/cli.py,sha256=Tn9jx0KhC421zv-DMpqNU2hpb6fyi4-r4qV17f-ts4Y,5807
|
|
15
|
+
fourcipp/utils/configuration.py,sha256=HZY_dZWjP8Tr7dPAPLRD6xBkZ8LvkQOKVKSKf8ndVJg,7828
|
|
16
|
+
fourcipp/utils/converter.py,sha256=D40YQ96WqPEEpB7fwAB5XC2v-jRki4v1sIJ-ngO08nU,5194
|
|
17
|
+
fourcipp/utils/dict_utils.py,sha256=uC0uaBNP3Wh2v3kFy9JHnAYARMukAN4cl40pmiBT13Y,12891
|
|
18
|
+
fourcipp/utils/metadata.py,sha256=TxKmpx-Mb3VeR6okUUtHDo0TwGcKxpyCtCExzphFEPU,30906
|
|
19
|
+
fourcipp/utils/not_set.py,sha256=NHf0UXDmTuZfvfnIIgkkx4EohxRsN4MVUHUpt7VOnaQ,2433
|
|
20
|
+
fourcipp/utils/type_hinting.py,sha256=izPEhbMdmhrIBamCLqqF_6iDZW-w7a8kplUugbQILyw,1714
|
|
21
|
+
fourcipp/utils/validation.py,sha256=FejHOj1MddaU7gEpMN-f8Mz3rYjflakd1qcsKnctHqA,5292
|
|
22
|
+
fourcipp/utils/yaml_io.py,sha256=jPgVnxE858XTpDC6BVhfbbljQegL58zc3u2VPYCTvGE,5771
|
|
23
|
+
fourcipp-1.50.0.dist-info/licenses/LICENSE,sha256=lkSOHdH9IZ8c3Vnz0fFjqls1cRlmLADBP8QEIwUlH3o,1082
|
|
24
|
+
fourcipp-1.50.0.dist-info/METADATA,sha256=a9fv6RT6tkicDZqjeDFOyxwLV0Uwkd4YA8Z5pq-dkFg,7960
|
|
25
|
+
fourcipp-1.50.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
26
|
+
fourcipp-1.50.0.dist-info/entry_points.txt,sha256=44XBG4bwhuq1EwOZ0U055HYP8_qN6_d30ecVsa5Igng,53
|
|
27
|
+
fourcipp-1.50.0.dist-info/top_level.txt,sha256=oZ6jgFFmvi157VwGUEFuKT3D8oS5mOkpOVx8zZURZrQ,9
|
|
28
|
+
fourcipp-1.50.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 FourCIPP Authors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
fourcipp
|