cad-to-dagmc 0.9.4__tar.gz → 0.9.5__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 (64) hide show
  1. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/PKG-INFO +1 -1
  2. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/src/_version.py +3 -3
  3. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/src/cad_to_dagmc/core.py +42 -3
  4. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/src/cad_to_dagmc.egg-info/PKG-INFO +1 -1
  5. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/.github/workflows/black.yml +0 -0
  6. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/.github/workflows/ci_with_benchmarks.yml +0 -0
  7. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/.github/workflows/ci_with_conda_install.yml +0 -0
  8. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/.github/workflows/ci_with_pip_install.yml +0 -0
  9. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/.github/workflows/python-publish.yml +0 -0
  10. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/.gitignore +0 -0
  11. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/CITATION.cff +0 -0
  12. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/LICENSE +0 -0
  13. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/README.md +0 -0
  14. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/examples/surface_and_unstructured_mesh/unstructured_mesh_with_conformal_surface_mesh.py +0 -0
  15. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/examples/surface_mesh/cadquery_assembly.py +0 -0
  16. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/examples/surface_mesh/cadquery_assembly_with_scaled_geometry.py +0 -0
  17. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/examples/surface_mesh/cadquery_compound.py +0 -0
  18. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/examples/surface_mesh/cadquery_object_and_stp_file.py +0 -0
  19. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/examples/surface_mesh/cadquery_text.py +0 -0
  20. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/examples/surface_mesh/curved_cadquery_object_to_dagmc_surface_mesh.py +0 -0
  21. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/examples/surface_mesh/different_resolution_meshes.py +0 -0
  22. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/examples/surface_mesh/from_gmsh_mesh_file.py +0 -0
  23. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/examples/surface_mesh/from_gmsh_mesh_file_with_tags.py +0 -0
  24. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/examples/surface_mesh/from_gmsh_object_with_tag.py +0 -0
  25. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/examples/surface_mesh/multiple_cadquery_objects.py +0 -0
  26. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/examples/surface_mesh/multiple_stp_files.py +0 -0
  27. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/examples/surface_mesh/single_cadquery_object.py +0 -0
  28. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/examples/surface_mesh/single_stp_file.py +0 -0
  29. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/examples/surface_mesh/single_stp_file_multiple_volumes.py +0 -0
  30. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/examples/surface_mesh/tagged_mesh.msh +0 -0
  31. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/examples/unstrucutred_volume_mesh/curved_cadquery_object_to_dagmc_volume_mesh.py +0 -0
  32. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/examples/unstrucutred_volume_mesh/different_resolution_meshes.py +0 -0
  33. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/examples/unstrucutred_volume_mesh/simulate_unstrucutred_volume_mesh_with_openmc.py +0 -0
  34. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/pyproject.toml +0 -0
  35. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/setup.cfg +0 -0
  36. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/src/cad_to_dagmc/__init__.py +0 -0
  37. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/src/cad_to_dagmc/direct_mesh_plugin.py +0 -0
  38. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/src/cad_to_dagmc.egg-info/SOURCES.txt +0 -0
  39. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/src/cad_to_dagmc.egg-info/dependency_links.txt +0 -0
  40. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/src/cad_to_dagmc.egg-info/requires.txt +0 -0
  41. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/src/cad_to_dagmc.egg-info/top_level.txt +0 -0
  42. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/tests/ENDFB-7.1-NNDC_H1.h5 +0 -0
  43. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/tests/ball_reactor.brep +0 -0
  44. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/tests/curved_extrude.stp +0 -0
  45. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/tests/extrude_rectangle.stp +0 -0
  46. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/tests/multi_volume_cylinders.stp +0 -0
  47. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/tests/one_cube.brep +0 -0
  48. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/tests/single_cube.stp +0 -0
  49. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/tests/single_volume_thin.stp +0 -0
  50. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/tests/single_volume_thin.vtk +0 -0
  51. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/tests/tagged_mesh.msh +0 -0
  52. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/tests/test_brep_file.brep +0 -0
  53. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/tests/test_file_creation.py +0 -0
  54. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/tests/test_get_volumes.py +0 -0
  55. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/tests/test_h5m_in_transport.py +0 -0
  56. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/tests/test_kwarg_args.py +0 -0
  57. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/tests/test_loading_from_file_vs_shape_object.py +0 -0
  58. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/tests/test_mesh_to_dagmc.py +0 -0
  59. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/tests/test_python_api.py +0 -0
  60. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/tests/test_two_joined_cubes.brep +0 -0
  61. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/tests/test_two_sep_cubes.brep +0 -0
  62. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/tests/test_version.py +0 -0
  63. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/tests/two_connected_cubes.stp +0 -0
  64. {cad_to_dagmc-0.9.4 → cad_to_dagmc-0.9.5}/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.4
3
+ Version: 0.9.5
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
@@ -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.4'
32
- __version_tuple__ = version_tuple = (0, 9, 4)
31
+ __version__ = version = '0.9.5'
32
+ __version_tuple__ = version_tuple = (0, 9, 5)
33
33
 
34
- __commit_id__ = commit_id = 'g725750322'
34
+ __commit_id__ = commit_id = 'gf1807169b'
@@ -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,41 @@ class CadToDagmc:
851
853
  ValueError: If invalid parameter combinations are used.
852
854
  """
853
855
 
856
+ # Handle meshing_backend - either from kwargs or auto-detect
857
+ meshing_backend = kwargs.pop("meshing_backend", None)
858
+
859
+ if meshing_backend is None:
860
+ # Auto-select meshing_backend based on kwargs
861
+ cadquery_keys = {"tolerance", "angular_tolerance"}
862
+ gmsh_keys = {
863
+ "min_mesh_size",
864
+ "max_mesh_size",
865
+ "mesh_algorithm",
866
+ "set_size",
867
+ "umesh_filename",
868
+ "method",
869
+ "unstructured_volumes",
870
+ }
871
+ has_cadquery = any(key in kwargs for key in cadquery_keys)
872
+ has_gmsh = any(key in kwargs for key in gmsh_keys)
873
+ if has_cadquery and not has_gmsh:
874
+ meshing_backend = "cadquery"
875
+ elif has_gmsh and not has_cadquery:
876
+ meshing_backend = "gmsh"
877
+ elif has_cadquery and has_gmsh:
878
+ provided_cadquery = [key for key in cadquery_keys if key in kwargs]
879
+ provided_gmsh = [key for key in gmsh_keys if key in kwargs]
880
+ raise ValueError(
881
+ "Ambiguous backend: both CadQuery and GMSH-specific arguments provided.\n"
882
+ f"CadQuery-specific arguments: {sorted(cadquery_keys)}\n"
883
+ f"GMSH-specific arguments: {sorted(gmsh_keys)}\n"
884
+ f"Provided CadQuery arguments: {provided_cadquery}\n"
885
+ f"Provided GMSH arguments: {provided_gmsh}\n"
886
+ "Please provide only one backend's arguments."
887
+ )
888
+ else:
889
+ meshing_backend = "cadquery" # default
890
+
854
891
  # Validate meshing backend
855
892
  if meshing_backend not in ["gmsh", "cadquery"]:
856
893
  raise ValueError(
@@ -858,6 +895,8 @@ class CadToDagmc:
858
895
  'Available options are "gmsh" or "cadquery"'
859
896
  )
860
897
 
898
+ print(f"Using meshing backend: {meshing_backend}")
899
+
861
900
  # Initialize variables to avoid unbound errors
862
901
  tolerance = 0.1
863
902
  angular_tolerance = 0.1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cad_to_dagmc
3
- Version: 0.9.4
3
+ Version: 0.9.5
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
File without changes
File without changes
File without changes
File without changes
File without changes