cubitpy 0.2.2__tar.gz → 0.2.4__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.
- {cubitpy-0.2.2 → cubitpy-0.2.4}/.github/workflows/cubitpy_test_suite_with_secrets.yml +6 -3
- {cubitpy-0.2.2 → cubitpy-0.2.4}/.pre-commit-config.yaml +2 -7
- {cubitpy-0.2.2/src/cubitpy.egg-info → cubitpy-0.2.4}/PKG-INFO +3 -2
- {cubitpy-0.2.2 → cubitpy-0.2.4}/README.md +1 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/pyproject.toml +1 -1
- {cubitpy-0.2.2 → cubitpy-0.2.4}/src/cubitpy/conf.py +30 -10
- {cubitpy-0.2.2 → cubitpy-0.2.4}/src/cubitpy/cubit_wrapper/cubit_wrapper_host.py +10 -3
- {cubitpy-0.2.2 → cubitpy-0.2.4}/src/cubitpy/version.py +3 -3
- {cubitpy-0.2.2 → cubitpy-0.2.4/src/cubitpy.egg-info}/PKG-INFO +3 -2
- {cubitpy-0.2.2 → cubitpy-0.2.4}/src/cubitpy.egg-info/SOURCES.txt +2 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/src/cubitpy.egg-info/requires.txt +1 -1
- cubitpy-0.2.4/src/cubitpy.egg-info/scm_file_list.json +83 -0
- cubitpy-0.2.4/src/cubitpy.egg-info/scm_version.json +8 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/test_cubitpy.py +31 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/.coveragerc +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/.github/workflows/code_checks.yml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/.gitignore +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/CONTRIBUTORS +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/LICENSE +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/setup.cfg +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/src/cubitpy/__init__.py +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/src/cubitpy/cubit_group.py +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/src/cubitpy/cubit_to_fourc_input.py +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/src/cubitpy/cubit_utility.py +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/src/cubitpy/cubit_wrapper/__init__.py +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/src/cubitpy/cubit_wrapper/cubit_wrapper_client.py +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/src/cubitpy/cubit_wrapper/cubit_wrapper_file_transfer.py +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/src/cubitpy/cubit_wrapper/cubit_wrapper_utility.py +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/src/cubitpy/cubitpy.py +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/src/cubitpy/cubitpy_types.py +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/src/cubitpy/exodus_utility.py +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/src/cubitpy/geometry_creation_functions.py +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/src/cubitpy/mesh_creation_functions.py +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/src/cubitpy.egg-info/dependency_links.txt +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/src/cubitpy.egg-info/top_level.txt +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/src/tutorial/__init__.py +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/src/tutorial/tutorial.py +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/coverage.config +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/external-geometry/fluent_aneurysm.msh +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_block_function.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_contact_condition_beam_to_surface.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_contact_condition_curve_to_curve.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_contact_condition_surface_to_surface.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_create_block.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_create_block_unaltered_element_dict.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_create_block_unaltered_element_dict_exo.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_create_block_unaltered_element_dict_exo.exo +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_create_brick_by_corner_points.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_create_wedge6.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_cubit_tutorial_coreform.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_cubit_tutorial_cubit15.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_dump_numpy_array.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_element_types_hex.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_element_types_quad_yplane.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_element_types_quad_zplane.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_element_types_tet_coreform.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_element_types_tet_cubit15.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_element_types_tet_single_element_with_exo.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_element_types_tet_single_element_with_exo.exo +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_element_types_tet_single_element_without_exo.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_extrude_mesh_function.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_extrude_mesh_function_average_normals_block.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_extrude_mesh_function_average_normals_for_cylinder_and_sphere.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_fluid_functionality_coreform.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_fluid_functionality_cubit15.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_fsi_functionality.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_group_of_surfaces.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_groups.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_groups_multiple_sets.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_mesh_import.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_node_set_geometry_type.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_node_sets_without_boundary_condition_with_exo.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_node_sets_without_boundary_condition_with_exo.exo +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_node_sets_without_boundary_condition_without_exo.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_point_coupling.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_reset_block_1.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_reset_block_2.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_scatra_functionality.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_serialize_nested_lists.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_thermo_functionality.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_user_defined_node_set_and_block_ids_with_exo.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_user_defined_node_set_and_block_ids_with_exo.exo +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_user_defined_node_set_and_block_ids_without_exo.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_yaml_with_exo_export_fsi.4C.yaml +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_yaml_with_exo_export_fsi.exo +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/run_delete_test.py +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/test_configurations.sh +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/test_cubitpy_performance.py +0 -0
- {cubitpy-0.2.2 → cubitpy-0.2.4}/tests/test_tutorial.py +0 -0
|
@@ -14,7 +14,7 @@ on:
|
|
|
14
14
|
workflow_dispatch:
|
|
15
15
|
|
|
16
16
|
env:
|
|
17
|
-
CUBIT_DOWNLOAD_URL: https://f002.backblazeb2.com/file/cubit-downloads/Coreform-Cubit/Releases/Linux/Coreform-Cubit-
|
|
17
|
+
CUBIT_DOWNLOAD_URL: https://f002.backblazeb2.com/file/cubit-downloads/Coreform-Cubit/Releases/Linux/Coreform-Cubit-2026.6%2B67683-Lin64.tar.gz
|
|
18
18
|
|
|
19
19
|
jobs:
|
|
20
20
|
testing_coreform:
|
|
@@ -28,14 +28,16 @@ jobs:
|
|
|
28
28
|
PYTHON_VENV: python-testing-environment
|
|
29
29
|
steps:
|
|
30
30
|
- name: Checkout PR code
|
|
31
|
-
uses: actions/checkout@
|
|
31
|
+
uses: actions/checkout@v7
|
|
32
32
|
with:
|
|
33
33
|
submodules: true
|
|
34
34
|
# For PR runs, checkout PR code; otherwise fallback to default branch or ref
|
|
35
35
|
ref: ${{ github.event.pull_request.head.ref || github.ref }}
|
|
36
36
|
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
|
|
37
|
+
allow-unsafe-pr-checkout: true # required to checkout PR code from forks, PRs from external people need to be approved anyways
|
|
38
|
+
persist-credentials: false
|
|
37
39
|
- name: Set up Python
|
|
38
|
-
uses: actions/setup-python@
|
|
40
|
+
uses: actions/setup-python@v6
|
|
39
41
|
with:
|
|
40
42
|
python-version: 3.13
|
|
41
43
|
- name: Install CubitPy
|
|
@@ -43,6 +45,7 @@ jobs:
|
|
|
43
45
|
whoami
|
|
44
46
|
pwd
|
|
45
47
|
# Install dependencies
|
|
48
|
+
sudo apt update
|
|
46
49
|
sudo apt install libhdf5-dev libnetcdf-dev build-essential
|
|
47
50
|
|
|
48
51
|
# Install cubitpy
|
|
@@ -73,17 +73,12 @@ repos:
|
|
|
73
73
|
- --comment-style
|
|
74
74
|
- '#'
|
|
75
75
|
- --no-extra-eol
|
|
76
|
-
- repo: https://github.com/asmeurer/removestar
|
|
77
|
-
rev: "1.5.2"
|
|
78
|
-
hooks:
|
|
79
|
-
- id: removestar
|
|
80
|
-
name: Run removestar (remove wildcard imports)
|
|
81
76
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
82
|
-
rev: v0.
|
|
77
|
+
rev: v0.15.20
|
|
83
78
|
hooks:
|
|
84
79
|
- id: ruff # linter
|
|
85
80
|
name: Run ruff (linter for Python)
|
|
86
|
-
args: ["--fix", "--select", "I,TID252,F401"] #
|
|
81
|
+
args: ["--fix", "--select", "I,TID252,F401,F403"] # I => sort imports, TID252 => ban relative imports, F401 => unused imports, F403 => no wildcard imports
|
|
87
82
|
- id: ruff-format # formatter
|
|
88
83
|
name: Run ruff (formatter for Python)
|
|
89
84
|
- repo: https://github.com/crate-ci/typos
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cubitpy
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
4
4
|
Summary: CubitPy: Utility functions and 4C related functionality for the Cubit and Coreform python interface
|
|
5
5
|
Author-email: Ivo Steinbrecher <ivo.steinbrecher@unibw.de>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -14,7 +14,7 @@ Requires-Dist: numpy
|
|
|
14
14
|
Requires-Dist: fourcipp
|
|
15
15
|
Provides-Extra: dev
|
|
16
16
|
Requires-Dist: pre-commit; extra == "dev"
|
|
17
|
-
Requires-Dist: pytest; extra == "dev"
|
|
17
|
+
Requires-Dist: pytest<9.2; extra == "dev"
|
|
18
18
|
Requires-Dist: pytest-benchmark; extra == "dev"
|
|
19
19
|
Requires-Dist: pytest-cov; extra == "dev"
|
|
20
20
|
Requires-Dist: deepdiff; extra == "dev"
|
|
@@ -95,6 +95,7 @@ remote_config:
|
|
|
95
95
|
host: "hostname"
|
|
96
96
|
platform: "windows"
|
|
97
97
|
cubit_path: "C:\\Coreform_Cubit_2025.8"
|
|
98
|
+
on_cubit_error: "raise" # optional: "raise" (default), "warn" or "ignore"
|
|
98
99
|
```
|
|
99
100
|
To run CubitPy one can either provide the configuration file then initializing CubitPy, or set an environment variable with the path to the configuration file.
|
|
100
101
|
```bash
|
|
@@ -73,6 +73,7 @@ remote_config:
|
|
|
73
73
|
host: "hostname"
|
|
74
74
|
platform: "windows"
|
|
75
75
|
cubit_path: "C:\\Coreform_Cubit_2025.8"
|
|
76
|
+
on_cubit_error: "raise" # optional: "raise" (default), "warn" or "ignore"
|
|
76
77
|
```
|
|
77
78
|
To run CubitPy one can either provide the configuration file then initializing CubitPy, or set an environment variable with the path to the configuration file.
|
|
78
79
|
```bash
|
|
@@ -31,7 +31,7 @@ Issues = "https://github.com/imcs-compsim/cubitpy/issues/"
|
|
|
31
31
|
[project.optional-dependencies]
|
|
32
32
|
dev = [
|
|
33
33
|
"pre-commit",
|
|
34
|
-
"pytest",
|
|
34
|
+
"pytest<9.2", # TODO: This fixes an incompatibility issue with pytest-benchmark, but should be removed once the issue is fixed upstream
|
|
35
35
|
"pytest-benchmark",
|
|
36
36
|
"pytest-cov",
|
|
37
37
|
"deepdiff",
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
cubitpy."""
|
|
24
24
|
|
|
25
25
|
import getpass
|
|
26
|
-
import glob
|
|
27
26
|
import os
|
|
28
27
|
import shutil
|
|
29
28
|
import sys
|
|
@@ -108,6 +107,17 @@ class CubitOptions(object):
|
|
|
108
107
|
# Tolerance for geometry.
|
|
109
108
|
self.eps_pos = 1e-10
|
|
110
109
|
|
|
110
|
+
@property
|
|
111
|
+
def on_cubit_error(self) -> str:
|
|
112
|
+
"""How to react when a cubit command reports an error.
|
|
113
|
+
|
|
114
|
+
One of "raise" (default, raise a RuntimeError), "warn" (emit a
|
|
115
|
+
CubitPyWarning and continue) or "ignore" (silently continue),
|
|
116
|
+
set via the optional top-level 'on_cubit_error' key in the
|
|
117
|
+
config file.
|
|
118
|
+
"""
|
|
119
|
+
return self._get_config().get("on_cubit_error", "raise")
|
|
120
|
+
|
|
111
121
|
def _get_config(self) -> Dict[str, Any]:
|
|
112
122
|
"""Get the config dict or raise an error if not loaded."""
|
|
113
123
|
if self._config is None:
|
|
@@ -134,6 +144,8 @@ class CubitOptions(object):
|
|
|
134
144
|
"\n"
|
|
135
145
|
"local_config:\n"
|
|
136
146
|
' cubit_path: "<local_cubit_install_path>"\n'
|
|
147
|
+
"\n"
|
|
148
|
+
'on_cubit_error: "raise" # optional: "raise" (default), "warn" or "ignore"\n'
|
|
137
149
|
"----------------------------------------\n"
|
|
138
150
|
"- If mode = 'remote': remote_config MUST exist and contain user, host, platform, cubit_path.\n"
|
|
139
151
|
"- If mode = 'local' : local_config MUST exist and contain cubit_path.\n"
|
|
@@ -153,6 +165,12 @@ class CubitOptions(object):
|
|
|
153
165
|
if mode not in ("remote", "local"):
|
|
154
166
|
fail(f"Invalid cubitpy_mode '{mode}'. Expected 'remote' or 'local'.")
|
|
155
167
|
|
|
168
|
+
if config.get("on_cubit_error", "raise") not in ("raise", "warn", "ignore"):
|
|
169
|
+
fail(
|
|
170
|
+
f"Invalid on_cubit_error '{config['on_cubit_error']}'. "
|
|
171
|
+
"Expected 'raise', 'warn' or 'ignore'."
|
|
172
|
+
)
|
|
173
|
+
|
|
156
174
|
if mode == "remote":
|
|
157
175
|
if "remote_config" not in config:
|
|
158
176
|
fail("cubitpy_mode='remote' requires a 'remote_config' section.")
|
|
@@ -285,18 +303,20 @@ class CubitOptions(object):
|
|
|
285
303
|
|
|
286
304
|
if cubit_platform == "linux" or cubit_platform == "macos":
|
|
287
305
|
if self.is_coreform():
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
306
|
+
python_prefix = "python3."
|
|
307
|
+
python_files = [
|
|
308
|
+
path
|
|
309
|
+
for path in cubit_path.rglob(f"{python_prefix}*")
|
|
310
|
+
if path.is_file()
|
|
311
|
+
and path.name.removeprefix(python_prefix).isdigit()
|
|
293
312
|
]
|
|
294
|
-
if
|
|
313
|
+
if len(python_files) != 1:
|
|
295
314
|
raise ValueError(
|
|
296
|
-
"Could not
|
|
315
|
+
"Could not uniquely determine the path to the Cubit Python "
|
|
316
|
+
f"interpreter. Expected exactly one 'python3.x' executable "
|
|
317
|
+
f"under '{cubit_path}', but found {len(python_files)}: {python_files}"
|
|
297
318
|
)
|
|
298
|
-
|
|
299
|
-
return cubit_python_interpreter
|
|
319
|
+
return str(python_files[0])
|
|
300
320
|
else:
|
|
301
321
|
python2_path_env = get_path(
|
|
302
322
|
"CUBITPY_PYTHON2", os.path.isfile, throw_error=False
|
|
@@ -129,9 +129,16 @@ class CubitConnect(object):
|
|
|
129
129
|
stacklevel=3,
|
|
130
130
|
)
|
|
131
131
|
if len(return_value["errors"]) > 0:
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
132
|
+
error_string = get_log_string(return_value["errors"], "error(s)")
|
|
133
|
+
if cupy.on_cubit_error == "raise":
|
|
134
|
+
raise RuntimeError(error_string)
|
|
135
|
+
elif cupy.on_cubit_error == "warn":
|
|
136
|
+
warnings.warn(
|
|
137
|
+
error_string,
|
|
138
|
+
category=CubitPyWarning,
|
|
139
|
+
stacklevel=3,
|
|
140
|
+
)
|
|
141
|
+
# "ignore": silently continue
|
|
135
142
|
return return_value["return_value"]
|
|
136
143
|
else:
|
|
137
144
|
return return_value
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '0.2.
|
|
22
|
-
__version_tuple__ = version_tuple = (0, 2,
|
|
21
|
+
__version__ = version = '0.2.4'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 2, 4)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'g6fa66acbd'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cubitpy
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
4
4
|
Summary: CubitPy: Utility functions and 4C related functionality for the Cubit and Coreform python interface
|
|
5
5
|
Author-email: Ivo Steinbrecher <ivo.steinbrecher@unibw.de>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -14,7 +14,7 @@ Requires-Dist: numpy
|
|
|
14
14
|
Requires-Dist: fourcipp
|
|
15
15
|
Provides-Extra: dev
|
|
16
16
|
Requires-Dist: pre-commit; extra == "dev"
|
|
17
|
-
Requires-Dist: pytest; extra == "dev"
|
|
17
|
+
Requires-Dist: pytest<9.2; extra == "dev"
|
|
18
18
|
Requires-Dist: pytest-benchmark; extra == "dev"
|
|
19
19
|
Requires-Dist: pytest-cov; extra == "dev"
|
|
20
20
|
Requires-Dist: deepdiff; extra == "dev"
|
|
@@ -95,6 +95,7 @@ remote_config:
|
|
|
95
95
|
host: "hostname"
|
|
96
96
|
platform: "windows"
|
|
97
97
|
cubit_path: "C:\\Coreform_Cubit_2025.8"
|
|
98
|
+
on_cubit_error: "raise" # optional: "raise" (default), "warn" or "ignore"
|
|
98
99
|
```
|
|
99
100
|
To run CubitPy one can either provide the configuration file then initializing CubitPy, or set an environment variable with the path to the configuration file.
|
|
100
101
|
```bash
|
|
@@ -22,6 +22,8 @@ src/cubitpy.egg-info/PKG-INFO
|
|
|
22
22
|
src/cubitpy.egg-info/SOURCES.txt
|
|
23
23
|
src/cubitpy.egg-info/dependency_links.txt
|
|
24
24
|
src/cubitpy.egg-info/requires.txt
|
|
25
|
+
src/cubitpy.egg-info/scm_file_list.json
|
|
26
|
+
src/cubitpy.egg-info/scm_version.json
|
|
25
27
|
src/cubitpy.egg-info/top_level.txt
|
|
26
28
|
src/cubitpy/cubit_wrapper/__init__.py
|
|
27
29
|
src/cubitpy/cubit_wrapper/cubit_wrapper_client.py
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"files": [
|
|
3
|
+
".coveragerc",
|
|
4
|
+
".github/workflows/code_checks.yml",
|
|
5
|
+
".github/workflows/cubitpy_test_suite_with_secrets.yml",
|
|
6
|
+
".gitignore",
|
|
7
|
+
".pre-commit-config.yaml",
|
|
8
|
+
"CONTRIBUTORS",
|
|
9
|
+
"LICENSE",
|
|
10
|
+
"README.md",
|
|
11
|
+
"pyproject.toml",
|
|
12
|
+
"src/cubitpy/__init__.py",
|
|
13
|
+
"src/cubitpy/conf.py",
|
|
14
|
+
"src/cubitpy/cubit_group.py",
|
|
15
|
+
"src/cubitpy/cubit_to_fourc_input.py",
|
|
16
|
+
"src/cubitpy/cubit_utility.py",
|
|
17
|
+
"src/cubitpy/cubit_wrapper/__init__.py",
|
|
18
|
+
"src/cubitpy/cubit_wrapper/cubit_wrapper_client.py",
|
|
19
|
+
"src/cubitpy/cubit_wrapper/cubit_wrapper_file_transfer.py",
|
|
20
|
+
"src/cubitpy/cubit_wrapper/cubit_wrapper_host.py",
|
|
21
|
+
"src/cubitpy/cubit_wrapper/cubit_wrapper_utility.py",
|
|
22
|
+
"src/cubitpy/cubitpy.py",
|
|
23
|
+
"src/cubitpy/cubitpy_types.py",
|
|
24
|
+
"src/cubitpy/exodus_utility.py",
|
|
25
|
+
"src/cubitpy/geometry_creation_functions.py",
|
|
26
|
+
"src/cubitpy/mesh_creation_functions.py",
|
|
27
|
+
"src/tutorial/__init__.py",
|
|
28
|
+
"src/tutorial/tutorial.py",
|
|
29
|
+
"tests/coverage.config",
|
|
30
|
+
"tests/external-geometry/fluent_aneurysm.msh",
|
|
31
|
+
"tests/input-files-ref/test_block_function.4C.yaml",
|
|
32
|
+
"tests/input-files-ref/test_contact_condition_beam_to_surface.4C.yaml",
|
|
33
|
+
"tests/input-files-ref/test_contact_condition_curve_to_curve.4C.yaml",
|
|
34
|
+
"tests/input-files-ref/test_contact_condition_surface_to_surface.4C.yaml",
|
|
35
|
+
"tests/input-files-ref/test_create_block.4C.yaml",
|
|
36
|
+
"tests/input-files-ref/test_create_block_unaltered_element_dict.4C.yaml",
|
|
37
|
+
"tests/input-files-ref/test_create_block_unaltered_element_dict_exo.4C.yaml",
|
|
38
|
+
"tests/input-files-ref/test_create_block_unaltered_element_dict_exo.exo",
|
|
39
|
+
"tests/input-files-ref/test_create_brick_by_corner_points.4C.yaml",
|
|
40
|
+
"tests/input-files-ref/test_create_wedge6.4C.yaml",
|
|
41
|
+
"tests/input-files-ref/test_cubit_tutorial_coreform.4C.yaml",
|
|
42
|
+
"tests/input-files-ref/test_cubit_tutorial_cubit15.4C.yaml",
|
|
43
|
+
"tests/input-files-ref/test_dump_numpy_array.4C.yaml",
|
|
44
|
+
"tests/input-files-ref/test_element_types_hex.4C.yaml",
|
|
45
|
+
"tests/input-files-ref/test_element_types_quad_yplane.4C.yaml",
|
|
46
|
+
"tests/input-files-ref/test_element_types_quad_zplane.4C.yaml",
|
|
47
|
+
"tests/input-files-ref/test_element_types_tet_coreform.4C.yaml",
|
|
48
|
+
"tests/input-files-ref/test_element_types_tet_cubit15.4C.yaml",
|
|
49
|
+
"tests/input-files-ref/test_element_types_tet_single_element_with_exo.4C.yaml",
|
|
50
|
+
"tests/input-files-ref/test_element_types_tet_single_element_with_exo.exo",
|
|
51
|
+
"tests/input-files-ref/test_element_types_tet_single_element_without_exo.4C.yaml",
|
|
52
|
+
"tests/input-files-ref/test_extrude_mesh_function.4C.yaml",
|
|
53
|
+
"tests/input-files-ref/test_extrude_mesh_function_average_normals_block.4C.yaml",
|
|
54
|
+
"tests/input-files-ref/test_extrude_mesh_function_average_normals_for_cylinder_and_sphere.4C.yaml",
|
|
55
|
+
"tests/input-files-ref/test_fluid_functionality_coreform.4C.yaml",
|
|
56
|
+
"tests/input-files-ref/test_fluid_functionality_cubit15.4C.yaml",
|
|
57
|
+
"tests/input-files-ref/test_fsi_functionality.4C.yaml",
|
|
58
|
+
"tests/input-files-ref/test_group_of_surfaces.4C.yaml",
|
|
59
|
+
"tests/input-files-ref/test_groups.4C.yaml",
|
|
60
|
+
"tests/input-files-ref/test_groups_multiple_sets.4C.yaml",
|
|
61
|
+
"tests/input-files-ref/test_mesh_import.4C.yaml",
|
|
62
|
+
"tests/input-files-ref/test_node_set_geometry_type.4C.yaml",
|
|
63
|
+
"tests/input-files-ref/test_node_sets_without_boundary_condition_with_exo.4C.yaml",
|
|
64
|
+
"tests/input-files-ref/test_node_sets_without_boundary_condition_with_exo.exo",
|
|
65
|
+
"tests/input-files-ref/test_node_sets_without_boundary_condition_without_exo.4C.yaml",
|
|
66
|
+
"tests/input-files-ref/test_point_coupling.4C.yaml",
|
|
67
|
+
"tests/input-files-ref/test_reset_block_1.4C.yaml",
|
|
68
|
+
"tests/input-files-ref/test_reset_block_2.4C.yaml",
|
|
69
|
+
"tests/input-files-ref/test_scatra_functionality.4C.yaml",
|
|
70
|
+
"tests/input-files-ref/test_serialize_nested_lists.4C.yaml",
|
|
71
|
+
"tests/input-files-ref/test_thermo_functionality.4C.yaml",
|
|
72
|
+
"tests/input-files-ref/test_user_defined_node_set_and_block_ids_with_exo.4C.yaml",
|
|
73
|
+
"tests/input-files-ref/test_user_defined_node_set_and_block_ids_with_exo.exo",
|
|
74
|
+
"tests/input-files-ref/test_user_defined_node_set_and_block_ids_without_exo.4C.yaml",
|
|
75
|
+
"tests/input-files-ref/test_yaml_with_exo_export_fsi.4C.yaml",
|
|
76
|
+
"tests/input-files-ref/test_yaml_with_exo_export_fsi.exo",
|
|
77
|
+
"tests/run_delete_test.py",
|
|
78
|
+
"tests/test_configurations.sh",
|
|
79
|
+
"tests/test_cubitpy.py",
|
|
80
|
+
"tests/test_cubitpy_performance.py",
|
|
81
|
+
"tests/test_tutorial.py"
|
|
82
|
+
]
|
|
83
|
+
}
|
|
@@ -2561,3 +2561,34 @@ def test_exodus_to_dict():
|
|
|
2561
2561
|
}
|
|
2562
2562
|
|
|
2563
2563
|
compare_nested_dicts_or_lists(exo_dict, reference_exo_dict)
|
|
2564
|
+
|
|
2565
|
+
|
|
2566
|
+
def test_on_cubit_error_config(tmp_path):
|
|
2567
|
+
"""The optional 'on_cubit_error' config key sets the error reaction."""
|
|
2568
|
+
|
|
2569
|
+
def write_config(extra=""):
|
|
2570
|
+
"""Write a minimal remote config, optionally with an extra line."""
|
|
2571
|
+
path = tmp_path / "cubitpy_config.yaml"
|
|
2572
|
+
path.write_text(
|
|
2573
|
+
'cubitpy_mode: "remote"\n'
|
|
2574
|
+
f"{extra}"
|
|
2575
|
+
"remote_config:\n"
|
|
2576
|
+
' user: "user"\n'
|
|
2577
|
+
' host: "host"\n'
|
|
2578
|
+
' platform: "linux"\n'
|
|
2579
|
+
' cubit_path: "/cubit"\n'
|
|
2580
|
+
)
|
|
2581
|
+
return path
|
|
2582
|
+
|
|
2583
|
+
saved_config = cupy._config
|
|
2584
|
+
try:
|
|
2585
|
+
cupy.load_cubit_config(write_config())
|
|
2586
|
+
assert cupy.on_cubit_error == "raise" # default when the key is absent
|
|
2587
|
+
|
|
2588
|
+
cupy.load_cubit_config(write_config('on_cubit_error: "warn"\n'))
|
|
2589
|
+
assert cupy.on_cubit_error == "warn"
|
|
2590
|
+
|
|
2591
|
+
with pytest.raises(RuntimeError, match="Invalid on_cubit_error"):
|
|
2592
|
+
cupy.load_cubit_config(write_config('on_cubit_error: "bogus"\n'))
|
|
2593
|
+
finally:
|
|
2594
|
+
cupy._config = saved_config
|
|
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
|
{cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_contact_condition_beam_to_surface.4C.yaml
RENAMED
|
File without changes
|
{cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_contact_condition_curve_to_curve.4C.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_create_brick_by_corner_points.4C.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_element_types_quad_yplane.4C.yaml
RENAMED
|
File without changes
|
{cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_element_types_quad_zplane.4C.yaml
RENAMED
|
File without changes
|
{cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_element_types_tet_coreform.4C.yaml
RENAMED
|
File without changes
|
{cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_element_types_tet_cubit15.4C.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_fluid_functionality_coreform.4C.yaml
RENAMED
|
File without changes
|
{cubitpy-0.2.2 → cubitpy-0.2.4}/tests/input-files-ref/test_fluid_functionality_cubit15.4C.yaml
RENAMED
|
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
|