cad-to-dagmc 0.9.4__tar.gz → 0.9.6__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.
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/PKG-INFO +2 -2
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/README.md +1 -1
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/src/_version.py +3 -3
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/src/cad_to_dagmc/core.py +53 -3
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/src/cad_to_dagmc.egg-info/PKG-INFO +2 -2
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/tests/test_kwarg_args.py +115 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/.github/workflows/black.yml +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/.github/workflows/ci_with_benchmarks.yml +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/.github/workflows/ci_with_conda_install.yml +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/.github/workflows/ci_with_pip_install.yml +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/.github/workflows/python-publish.yml +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/.gitignore +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/CITATION.cff +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/LICENSE +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/examples/surface_and_unstructured_mesh/unstructured_mesh_with_conformal_surface_mesh.py +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/examples/surface_mesh/cadquery_assembly.py +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/examples/surface_mesh/cadquery_assembly_with_scaled_geometry.py +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/examples/surface_mesh/cadquery_compound.py +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/examples/surface_mesh/cadquery_object_and_stp_file.py +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/examples/surface_mesh/cadquery_text.py +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/examples/surface_mesh/curved_cadquery_object_to_dagmc_surface_mesh.py +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/examples/surface_mesh/different_resolution_meshes.py +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/examples/surface_mesh/from_gmsh_mesh_file.py +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/examples/surface_mesh/from_gmsh_mesh_file_with_tags.py +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/examples/surface_mesh/from_gmsh_object_with_tag.py +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/examples/surface_mesh/multiple_cadquery_objects.py +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/examples/surface_mesh/multiple_stp_files.py +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/examples/surface_mesh/single_cadquery_object.py +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/examples/surface_mesh/single_stp_file.py +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/examples/surface_mesh/single_stp_file_multiple_volumes.py +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/examples/surface_mesh/tagged_mesh.msh +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/examples/unstrucutred_volume_mesh/curved_cadquery_object_to_dagmc_volume_mesh.py +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/examples/unstrucutred_volume_mesh/different_resolution_meshes.py +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/examples/unstrucutred_volume_mesh/simulate_unstrucutred_volume_mesh_with_openmc.py +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/pyproject.toml +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/setup.cfg +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/src/cad_to_dagmc/__init__.py +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/src/cad_to_dagmc/direct_mesh_plugin.py +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/src/cad_to_dagmc.egg-info/SOURCES.txt +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/src/cad_to_dagmc.egg-info/dependency_links.txt +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/src/cad_to_dagmc.egg-info/requires.txt +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/src/cad_to_dagmc.egg-info/top_level.txt +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/tests/ENDFB-7.1-NNDC_H1.h5 +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/tests/ball_reactor.brep +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/tests/curved_extrude.stp +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/tests/extrude_rectangle.stp +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/tests/multi_volume_cylinders.stp +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/tests/one_cube.brep +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/tests/single_cube.stp +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/tests/single_volume_thin.stp +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/tests/single_volume_thin.vtk +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/tests/tagged_mesh.msh +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/tests/test_brep_file.brep +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/tests/test_file_creation.py +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/tests/test_get_volumes.py +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/tests/test_h5m_in_transport.py +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/tests/test_loading_from_file_vs_shape_object.py +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/tests/test_mesh_to_dagmc.py +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/tests/test_python_api.py +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/tests/test_two_joined_cubes.brep +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/tests/test_two_sep_cubes.brep +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/tests/test_version.py +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/tests/two_connected_cubes.stp +0 -0
- {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/tests/two_disconnected_cubes.stp +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cad_to_dagmc
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.6
|
|
4
4
|
Summary: Converts CAD files to a DAGMC h5m file
|
|
5
5
|
Author-email: Jonathan Shimwell <mail@jshimwell.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/fusion-energy/cad_to_dagmc
|
|
@@ -50,7 +50,7 @@ cad-to-dagmc can convert the following in to DAGMC compatible meshes:
|
|
|
50
50
|
|
|
51
51
|
Cad-to-dagmc offers a wide range of features including.
|
|
52
52
|
- Geometry scaling with ```scale_factor``` argument
|
|
53
|
-
-
|
|
53
|
+
- Direct surface meshing of CadQuery geometry with ```tolerance``` and ```angular_tolerance``` arguments (avoids using Gmsh)
|
|
54
54
|
- Model wide mesh Gmsh size parameters with ```min_mesh_size``` and ```max_mesh_size``` arguments
|
|
55
55
|
- Volume specific mesh sizing parameters with the ```set_size``` argument
|
|
56
56
|
- Unstructured mesh that share the same coordinates as the surface mesh.
|
|
@@ -25,7 +25,7 @@ cad-to-dagmc can convert the following in to DAGMC compatible meshes:
|
|
|
25
25
|
|
|
26
26
|
Cad-to-dagmc offers a wide range of features including.
|
|
27
27
|
- Geometry scaling with ```scale_factor``` argument
|
|
28
|
-
-
|
|
28
|
+
- Direct surface meshing of CadQuery geometry with ```tolerance``` and ```angular_tolerance``` arguments (avoids using Gmsh)
|
|
29
29
|
- Model wide mesh Gmsh size parameters with ```min_mesh_size``` and ```max_mesh_size``` arguments
|
|
30
30
|
- Volume specific mesh sizing parameters with the ```set_size``` argument
|
|
31
31
|
- Unstructured mesh that share the same coordinates as the surface mesh.
|
|
@@ -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 = '0.9.
|
|
32
|
-
__version_tuple__ = version_tuple = (0, 9,
|
|
31
|
+
__version__ = version = '0.9.6'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 9, 6)
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'gc9bf24ac7'
|
|
@@ -812,7 +812,6 @@ class CadToDagmc:
|
|
|
812
812
|
def export_dagmc_h5m_file(
|
|
813
813
|
self,
|
|
814
814
|
filename: str = "dagmc.h5m",
|
|
815
|
-
meshing_backend: str = "cadquery",
|
|
816
815
|
implicit_complement_material_tag: str | None = None,
|
|
817
816
|
scale_factor: float = 1.0,
|
|
818
817
|
imprint: bool = True,
|
|
@@ -822,8 +821,6 @@ class CadToDagmc:
|
|
|
822
821
|
|
|
823
822
|
Args:
|
|
824
823
|
filename: the filename to use for the saved DAGMC file.
|
|
825
|
-
meshing_backend: determines whether gmsh or cadquery's direct mesh method
|
|
826
|
-
is used for meshing. Options are 'gmsh' or 'cadquery'.
|
|
827
824
|
implicit_complement_material_tag: the name of the material tag to use
|
|
828
825
|
for the implicit complement (void space).
|
|
829
826
|
scale_factor: a scaling factor to apply to the geometry.
|
|
@@ -831,6 +828,11 @@ class CadToDagmc:
|
|
|
831
828
|
|
|
832
829
|
**kwargs: Backend-specific parameters:
|
|
833
830
|
|
|
831
|
+
Backend selection:
|
|
832
|
+
- meshing_backend (str, optional): explicitly specify 'gmsh' or 'cadquery'.
|
|
833
|
+
If not provided, backend is auto-selected based on other arguments.
|
|
834
|
+
Defaults to 'cadquery' if no backend-specific arguments are given.
|
|
835
|
+
|
|
834
836
|
For GMSH backend:
|
|
835
837
|
- min_mesh_size (float): minimum mesh element size
|
|
836
838
|
- max_mesh_size (float): maximum mesh element size
|
|
@@ -851,6 +853,52 @@ class CadToDagmc:
|
|
|
851
853
|
ValueError: If invalid parameter combinations are used.
|
|
852
854
|
"""
|
|
853
855
|
|
|
856
|
+
# Define all acceptable kwargs
|
|
857
|
+
cadquery_keys = {"tolerance", "angular_tolerance"}
|
|
858
|
+
gmsh_keys = {
|
|
859
|
+
"min_mesh_size",
|
|
860
|
+
"max_mesh_size",
|
|
861
|
+
"mesh_algorithm",
|
|
862
|
+
"set_size",
|
|
863
|
+
"umesh_filename",
|
|
864
|
+
"method",
|
|
865
|
+
"unstructured_volumes",
|
|
866
|
+
}
|
|
867
|
+
all_acceptable_keys = cadquery_keys | gmsh_keys | {"meshing_backend"}
|
|
868
|
+
|
|
869
|
+
# Check for invalid kwargs
|
|
870
|
+
invalid_keys = set(kwargs.keys()) - all_acceptable_keys
|
|
871
|
+
if invalid_keys:
|
|
872
|
+
raise ValueError(
|
|
873
|
+
f"Invalid keyword arguments: {sorted(invalid_keys)}\n"
|
|
874
|
+
f"Acceptable arguments are: {sorted(all_acceptable_keys)}"
|
|
875
|
+
)
|
|
876
|
+
|
|
877
|
+
# Handle meshing_backend - either from kwargs or auto-detect
|
|
878
|
+
meshing_backend = kwargs.pop("meshing_backend", None)
|
|
879
|
+
|
|
880
|
+
if meshing_backend is None:
|
|
881
|
+
# Auto-select meshing_backend based on kwargs
|
|
882
|
+
has_cadquery = any(key in kwargs for key in cadquery_keys)
|
|
883
|
+
has_gmsh = any(key in kwargs for key in gmsh_keys)
|
|
884
|
+
if has_cadquery and not has_gmsh:
|
|
885
|
+
meshing_backend = "cadquery"
|
|
886
|
+
elif has_gmsh and not has_cadquery:
|
|
887
|
+
meshing_backend = "gmsh"
|
|
888
|
+
elif has_cadquery and has_gmsh:
|
|
889
|
+
provided_cadquery = [key for key in cadquery_keys if key in kwargs]
|
|
890
|
+
provided_gmsh = [key for key in gmsh_keys if key in kwargs]
|
|
891
|
+
raise ValueError(
|
|
892
|
+
"Ambiguous backend: both CadQuery and GMSH-specific arguments provided.\n"
|
|
893
|
+
f"CadQuery-specific arguments: {sorted(cadquery_keys)}\n"
|
|
894
|
+
f"GMSH-specific arguments: {sorted(gmsh_keys)}\n"
|
|
895
|
+
f"Provided CadQuery arguments: {provided_cadquery}\n"
|
|
896
|
+
f"Provided GMSH arguments: {provided_gmsh}\n"
|
|
897
|
+
"Please provide only one backend's arguments."
|
|
898
|
+
)
|
|
899
|
+
else:
|
|
900
|
+
meshing_backend = "cadquery" # default
|
|
901
|
+
|
|
854
902
|
# Validate meshing backend
|
|
855
903
|
if meshing_backend not in ["gmsh", "cadquery"]:
|
|
856
904
|
raise ValueError(
|
|
@@ -858,6 +906,8 @@ class CadToDagmc:
|
|
|
858
906
|
'Available options are "gmsh" or "cadquery"'
|
|
859
907
|
)
|
|
860
908
|
|
|
909
|
+
print(f"Using meshing backend: {meshing_backend}")
|
|
910
|
+
|
|
861
911
|
# Initialize variables to avoid unbound errors
|
|
862
912
|
tolerance = 0.1
|
|
863
913
|
angular_tolerance = 0.1
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cad_to_dagmc
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.6
|
|
4
4
|
Summary: Converts CAD files to a DAGMC h5m file
|
|
5
5
|
Author-email: Jonathan Shimwell <mail@jshimwell.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/fusion-energy/cad_to_dagmc
|
|
@@ -50,7 +50,7 @@ cad-to-dagmc can convert the following in to DAGMC compatible meshes:
|
|
|
50
50
|
|
|
51
51
|
Cad-to-dagmc offers a wide range of features including.
|
|
52
52
|
- Geometry scaling with ```scale_factor``` argument
|
|
53
|
-
-
|
|
53
|
+
- Direct surface meshing of CadQuery geometry with ```tolerance``` and ```angular_tolerance``` arguments (avoids using Gmsh)
|
|
54
54
|
- Model wide mesh Gmsh size parameters with ```min_mesh_size``` and ```max_mesh_size``` arguments
|
|
55
55
|
- Volume specific mesh sizing parameters with the ```set_size``` argument
|
|
56
56
|
- Unstructured mesh that share the same coordinates as the surface mesh.
|
|
@@ -187,6 +187,121 @@ class TestKwargsExportDagmcH5mFile:
|
|
|
187
187
|
assert output_file_gmsh.exists()
|
|
188
188
|
|
|
189
189
|
|
|
190
|
+
class TestKwargsValidation:
|
|
191
|
+
"""Test kwargs validation for export_dagmc_h5m_file method"""
|
|
192
|
+
|
|
193
|
+
def setup_method(self):
|
|
194
|
+
"""Setup method to create a simple geometry for testing"""
|
|
195
|
+
self.my_model = CadToDagmc()
|
|
196
|
+
|
|
197
|
+
# Create a simple box
|
|
198
|
+
box = cq.Workplane("XY").box(10, 10, 10)
|
|
199
|
+
self.my_model.add_cadquery_object(box, material_tags=["steel"])
|
|
200
|
+
|
|
201
|
+
def test_invalid_kwargs_raises_error(self, tmp_path):
|
|
202
|
+
"""Test that invalid kwargs raise ValueError with helpful message"""
|
|
203
|
+
output_file = tmp_path / "test_invalid_kwargs.h5m"
|
|
204
|
+
|
|
205
|
+
with pytest.raises(ValueError) as excinfo:
|
|
206
|
+
self.my_model.export_dagmc_h5m_file(
|
|
207
|
+
filename=str(output_file),
|
|
208
|
+
invalid_param=123,
|
|
209
|
+
another_invalid=True,
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
error_message = str(excinfo.value)
|
|
213
|
+
assert "Invalid keyword arguments:" in error_message
|
|
214
|
+
assert "another_invalid" in error_message
|
|
215
|
+
assert "invalid_param" in error_message
|
|
216
|
+
assert "Acceptable arguments are:" in error_message
|
|
217
|
+
|
|
218
|
+
def test_mixed_valid_invalid_kwargs_raises_error(self, tmp_path):
|
|
219
|
+
"""Test that mix of valid and invalid kwargs raises error"""
|
|
220
|
+
output_file = tmp_path / "test_mixed_kwargs.h5m"
|
|
221
|
+
|
|
222
|
+
with pytest.raises(ValueError) as excinfo:
|
|
223
|
+
self.my_model.export_dagmc_h5m_file(
|
|
224
|
+
filename=str(output_file),
|
|
225
|
+
tolerance=0.1, # valid
|
|
226
|
+
bad_param=456, # invalid
|
|
227
|
+
min_mesh_size=0.5, # valid
|
|
228
|
+
)
|
|
229
|
+
|
|
230
|
+
error_message = str(excinfo.value)
|
|
231
|
+
assert "Invalid keyword arguments:" in error_message
|
|
232
|
+
assert "bad_param" in error_message
|
|
233
|
+
assert "tolerance" in error_message # valid param should be in error
|
|
234
|
+
assert "min_mesh_size" in error_message # valid param should be in error
|
|
235
|
+
|
|
236
|
+
def test_all_valid_cadquery_kwargs_accepted(self, tmp_path):
|
|
237
|
+
"""Test that all valid CadQuery kwargs are accepted"""
|
|
238
|
+
output_file = tmp_path / "test_valid_cq_kwargs.h5m"
|
|
239
|
+
|
|
240
|
+
# Should not raise any error
|
|
241
|
+
result = self.my_model.export_dagmc_h5m_file(
|
|
242
|
+
filename=str(output_file),
|
|
243
|
+
meshing_backend="cadquery",
|
|
244
|
+
tolerance=0.1,
|
|
245
|
+
angular_tolerance=0.2,
|
|
246
|
+
)
|
|
247
|
+
|
|
248
|
+
assert result == str(output_file)
|
|
249
|
+
assert output_file.exists()
|
|
250
|
+
|
|
251
|
+
def test_all_valid_gmsh_kwargs_accepted(self, tmp_path):
|
|
252
|
+
"""Test that all valid GMSH kwargs are accepted"""
|
|
253
|
+
output_file = tmp_path / "test_valid_gmsh_kwargs.h5m"
|
|
254
|
+
|
|
255
|
+
# Should not raise any error
|
|
256
|
+
result = self.my_model.export_dagmc_h5m_file(
|
|
257
|
+
filename=str(output_file),
|
|
258
|
+
meshing_backend="gmsh",
|
|
259
|
+
min_mesh_size=0.1,
|
|
260
|
+
max_mesh_size=1.0,
|
|
261
|
+
mesh_algorithm=1,
|
|
262
|
+
set_size={1: 0.5},
|
|
263
|
+
umesh_filename="test.vtk",
|
|
264
|
+
method="file",
|
|
265
|
+
# unstructured_volumes would be tested separately
|
|
266
|
+
)
|
|
267
|
+
|
|
268
|
+
assert result == str(output_file)
|
|
269
|
+
assert output_file.exists()
|
|
270
|
+
|
|
271
|
+
def test_typo_in_kwarg_name_raises_helpful_error(self, tmp_path):
|
|
272
|
+
"""Test that typos in parameter names give helpful error messages"""
|
|
273
|
+
output_file = tmp_path / "test_typo.h5m"
|
|
274
|
+
|
|
275
|
+
# Common typo: "tolerance" -> "tollerance"
|
|
276
|
+
with pytest.raises(ValueError) as excinfo:
|
|
277
|
+
self.my_model.export_dagmc_h5m_file(
|
|
278
|
+
filename=str(output_file),
|
|
279
|
+
tollerance=0.1, # typo
|
|
280
|
+
)
|
|
281
|
+
|
|
282
|
+
error_message = str(excinfo.value)
|
|
283
|
+
assert "Invalid keyword arguments:" in error_message
|
|
284
|
+
assert "tollerance" in error_message
|
|
285
|
+
assert "tolerance" in error_message # should show the correct options
|
|
286
|
+
|
|
287
|
+
def test_case_sensitivity_in_kwargs(self, tmp_path):
|
|
288
|
+
"""Test that kwargs are case sensitive"""
|
|
289
|
+
output_file = tmp_path / "test_case_sensitive.h5m"
|
|
290
|
+
|
|
291
|
+
# Wrong case should raise error
|
|
292
|
+
with pytest.raises(ValueError) as excinfo:
|
|
293
|
+
self.my_model.export_dagmc_h5m_file(
|
|
294
|
+
filename=str(output_file),
|
|
295
|
+
Tolerance=0.1, # wrong case
|
|
296
|
+
MESHING_BACKEND="cadquery", # wrong case
|
|
297
|
+
)
|
|
298
|
+
|
|
299
|
+
error_message = str(excinfo.value)
|
|
300
|
+
assert "Invalid keyword arguments:" in error_message
|
|
301
|
+
assert "Tolerance" in error_message
|
|
302
|
+
assert "MESHING_BACKEND" in error_message
|
|
303
|
+
|
|
304
|
+
|
|
190
305
|
class TestKwargsWithMultipleVolumes:
|
|
191
306
|
"""Test kwargs functionality with multiple volumes"""
|
|
192
307
|
|
|
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
|
{cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/examples/surface_mesh/cadquery_object_and_stp_file.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/examples/surface_mesh/different_resolution_meshes.py
RENAMED
|
File without changes
|
|
File without changes
|
{cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/examples/surface_mesh/from_gmsh_mesh_file_with_tags.py
RENAMED
|
File without changes
|
{cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/examples/surface_mesh/from_gmsh_object_with_tag.py
RENAMED
|
File without changes
|
{cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/examples/surface_mesh/multiple_cadquery_objects.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.6}/examples/surface_mesh/single_stp_file_multiple_volumes.py
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
|
|
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
|