mastapy 14.0.1__py3-none-any.whl → 14.0.1b2__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.
@@ -26,7 +26,6 @@ import importlib
26
26
  import inspect
27
27
  import itertools
28
28
  import os
29
- import platform
30
29
  import sys
31
30
  import types
32
31
  import typing
@@ -307,7 +306,7 @@ def masta_property(
307
306
  return _masta_property_decorator
308
307
 
309
308
 
310
- def mastafile_hook() -> None:
309
+ def mastafile_hook():
311
310
  global _has_attempted_mastafile_load, _hook_name_to_method_dict
312
311
  global _has_initialised_with_environment_variable
313
312
 
@@ -421,7 +420,7 @@ def _convert_version_to_tuple(version: "Union[str, Tuple[int]]") -> "Tuple[int]"
421
420
  return version
422
421
 
423
422
 
424
- def match_versions() -> None:
423
+ def match_versions():
425
424
  versioning = python_net_import("SMT.MastaAPI", "UtilityMethods")
426
425
 
427
426
  if hasattr(versioning, "ReleaseVersionString"):
@@ -513,17 +512,9 @@ def _init_runtime_setup(
513
512
  framework_version: str = "net462",
514
513
  ) -> str:
515
514
  python_version = get_python_version()
516
- is_linux = platform.system() == "Linux"
517
- dot_net_core = _is_dotnet_core(path_to_dll_folder)
518
515
 
519
516
  if python_version in SpecifierSet(">=3.9"):
520
- if is_linux and not dot_net_core:
521
- raise MastaInitException(
522
- "You are attempting to load a .NET Framework version of the MASTA API "
523
- "on Linux. This is not possible. Linux is only supported in .NET 6+ "
524
- "versions of the MASTA API."
525
- ) from None
526
-
517
+ dot_net_core = _is_dotnet_core(path_to_dll_folder)
527
518
  framework_identifier = core_version if dot_net_core else framework_version
528
519
 
529
520
  current_directory = os.path.dirname(os.path.realpath(__file__))
@@ -542,31 +533,21 @@ def _init_runtime_setup(
542
533
  )
543
534
  python_runtime_path = os.path.join(path_to_dll_folder, python_runtime_dll)
544
535
  else:
545
- if is_linux:
546
- raise MastaInitException(
547
- "Linux is not supported by the MASTA API in versions of Python older "
548
- "than Python 3.9."
549
- ) from None
550
- elif dot_net_core:
551
- raise MastaInitException(
552
- "Versions of Python older than 3.9 are not supported in .NET 6+ "
553
- "versions of the MASTA API. Please use a newer version of Python."
554
- ) from None
555
-
556
536
  version_identifier = "".join(map(str, python_version.release))
557
537
  python_runtime_dll = f"Python.Runtime{version_identifier}.dll"
558
538
  python_runtime_path = os.path.join(path_to_dll_folder, python_runtime_dll)
559
539
 
560
540
  if not os.path.exists(python_runtime_path):
561
541
  raise MastaInitException(
562
- "Failed to load Python runtime environment at path "
563
- f"'{python_runtime_path}'."
542
+ ("Failed to load Python runtime environment " "at path '{}'.").format(
543
+ python_runtime_path
544
+ )
564
545
  )
565
546
 
566
547
  return python_runtime_path
567
548
 
568
549
 
569
- def _init_runtime_legacy(python_runtime_path: str) -> None:
550
+ def _init_runtime_legacy(python_runtime_path: str):
570
551
  assembly = python_net_add_reference(python_runtime_path)
571
552
 
572
553
  binding_flags = python_net_import("System.Reflection", "BindingFlags")
@@ -579,7 +560,7 @@ def _init_runtime_legacy(python_runtime_path: str) -> None:
579
560
  method.Invoke(None, None)
580
561
 
581
562
 
582
- def _init_runtime(path_to_dll_folder: str) -> None:
563
+ def _init_runtime(path_to_dll_folder: str):
583
564
  python_runtime_path = _init_runtime_setup(path_to_dll_folder)
584
565
 
585
566
  if using_pythonnet3():
@@ -596,7 +577,7 @@ def _is_dotnet_core(path_to_dll_folder: str) -> bool:
596
577
  return os.path.isfile(path_to_deps)
597
578
 
598
579
 
599
- def _init_dotnet_core_if_required(path_to_dll_folder: str) -> None:
580
+ def _init_dotnet_core_if_required(path_to_dll_folder: str):
600
581
  if not _is_dotnet_core(path_to_dll_folder):
601
582
  return
602
583
 
@@ -680,9 +661,7 @@ def _init(path_to_dll_folder: str, initialise_api_access: bool = True) -> bool:
680
661
 
681
662
  initialise_python_net_importing(utility_full_path)
682
663
  _init_runtime(path_to_dll_folder)
683
-
684
- if initialise_api_access:
685
- _init_dotnet_core_if_required(path_to_dll_folder)
664
+ _init_dotnet_core_if_required(path_to_dll_folder)
686
665
 
687
666
  python_net_add_reference(os.path.join(path_to_dll_folder, "Utility.dll"))
688
667
  python_net_add_reference(full_path)
@@ -702,7 +681,7 @@ def _init(path_to_dll_folder: str, initialise_api_access: bool = True) -> bool:
702
681
  return True
703
682
 
704
683
 
705
- def init(path_to_dll_folder: str) -> None:
684
+ def init(path_to_dll_folder: str):
706
685
  """Initialise the Python to MASTA API interop.
707
686
 
708
687
  Args:
@@ -727,7 +706,7 @@ def start_debugging(
727
706
  timeout: int = 10,
728
707
  *,
729
708
  environment: DebugEnvironment = (DebugEnvironment.VSCODE),
730
- ) -> None:
709
+ ):
731
710
  """Start Python debugging using PTVSD.
732
711
 
733
712
  Args:
@@ -758,7 +737,7 @@ def start_debugging(
758
737
  ptvsd.wait_for_attach(timeout)
759
738
  elif environment == DebugEnvironment.PYCHARM:
760
739
  try:
761
- import pydevd_pycharm # type: ignore
740
+ import pydevd_pycharm
762
741
  except ModuleNotFoundError:
763
742
  message = (
764
743
  "PyCharm debugging was detected but the "
@@ -77,27 +77,6 @@ def python_net_add_reference(path: str) -> "Any":
77
77
  raise AssemblyLoadError(message) from None
78
78
 
79
79
 
80
- def _verify_imports_can_be_resolved() -> None:
81
- """Verify that the import system works correctly.
82
-
83
- While it is unlikely, there are rare instances when assemblies can be loaded but
84
- importing fails. This situation produces confusing errors, so this method is
85
- designed to report something slightly more readable.
86
-
87
- We only do verification if a Python.NET import error occurs to avoid performance
88
- costs in working applications.
89
- """
90
- module_name = "SMT"
91
- module = __import__(module_name)
92
-
93
- if "MastaAPI" not in dir(module):
94
- raise ImportError(
95
- "Failed to load internal MastaAPI dependencies. This is likely due to a "
96
- 'conflicting module on the path. Ensure there is no folder called "SMT" in '
97
- "the same directory as the script you are attempting to run."
98
- ) from None
99
-
100
-
101
80
  def python_net_import(module: str, class_name: "Optional[str]" = None) -> None:
102
81
  """Dynamically import a Python.NET module.
103
82
 
@@ -119,14 +98,15 @@ def python_net_import(module: str, class_name: "Optional[str]" = None) -> None:
119
98
  m = getattr(m, class_name)
120
99
  except ImportError:
121
100
  raise ImportError(
122
- "Mastapy has not been initialised. You must call `mastapy.init(...)` with "
123
- "the path to your MASTA directory as the only argument before importing "
124
- "anything else."
101
+ (
102
+ "\"mastapy\" has not been initialised. Call 'mastapy.init()' "
103
+ "with the path to your SMT.MastaAPI.dll file."
104
+ )
125
105
  ) from None
126
106
  except Exception:
127
- _verify_imports_can_be_resolved()
128
-
129
- raise ImportError(f"Failed to load {class_name} from {module}.") from None
107
+ raise ImportError(
108
+ "Failed to load {} from {}.".format(class_name, module)
109
+ ) from None
130
110
 
131
111
  return m
132
112
 
@@ -99,25 +99,6 @@ class AnalysisSettingsItem(_1882.NamedDatabaseItem):
99
99
  float(value) if value is not None else 0.0,
100
100
  )
101
101
 
102
- @property
103
- def maximum_nodes_for_nvh_analysis(self: "Self") -> "int":
104
- """int"""
105
- temp = pythonnet_property_get(self.wrapped, "MaximumNodesForNVHAnalysis")
106
-
107
- if temp is None:
108
- return 0
109
-
110
- return temp
111
-
112
- @maximum_nodes_for_nvh_analysis.setter
113
- @enforce_parameter_types
114
- def maximum_nodes_for_nvh_analysis(self: "Self", value: "int") -> None:
115
- pythonnet_property_set(
116
- self.wrapped,
117
- "MaximumNodesForNVHAnalysis",
118
- int(value) if value is not None else 0,
119
- )
120
-
121
102
  @property
122
103
  def maximum_section_length_to_diameter_ratio(self: "Self") -> "float":
123
104
  """float"""
@@ -8,11 +8,7 @@ from mastapy._private import _0
8
8
  from mastapy._private._internal import utility
9
9
  from mastapy._private._internal.cast_exception import CastException
10
10
  from mastapy._private._internal.dataclasses import extended_dataclass
11
- from mastapy._private._internal.python_net import (
12
- python_net_import,
13
- pythonnet_method_call,
14
- )
15
- from mastapy._private._internal.type_enforcement import enforce_parameter_types
11
+ from mastapy._private._internal.python_net import python_net_import
16
12
 
17
13
  _PARAMETRIC_STUDY_TOOL_RESULTS_FOR_REPORTING = python_net_import(
18
14
  "SMT.MastaAPI.SystemModel.AnalysesAndResults.ParametricStudyTools",
@@ -73,18 +69,6 @@ class ParametricStudyToolResultsForReporting(_0.APIBase):
73
69
 
74
70
  self.wrapped.reference_count += 1
75
71
 
76
- @enforce_parameter_types
77
- def export_results_to_xml(self: "Self", file_path: "str") -> None:
78
- """Method does not return.
79
-
80
- Args:
81
- file_path (str)
82
- """
83
- file_path = str(file_path)
84
- pythonnet_method_call(
85
- self.wrapped, "ExportResultsToXML", file_path if file_path else ""
86
- )
87
-
88
72
  @property
89
73
  def cast_to(self: "Self") -> "_Cast_ParametricStudyToolResultsForReporting":
90
74
  """Cast to another type.
@@ -181,29 +181,23 @@ class FESubstructure(_66.FEStiffness):
181
181
  )
182
182
 
183
183
  @property
184
- def angular_alignment_tolerance(self: "Self") -> "overridable.Overridable_float":
185
- """Overridable[float]"""
184
+ def angular_alignment_tolerance(self: "Self") -> "float":
185
+ """float"""
186
186
  temp = pythonnet_property_get(self.wrapped, "AngularAlignmentTolerance")
187
187
 
188
188
  if temp is None:
189
189
  return 0.0
190
190
 
191
- return constructor.new_from_mastapy(
192
- "mastapy._private._internal.implicit.overridable", "Overridable_float"
193
- )(temp)
191
+ return temp
194
192
 
195
193
  @angular_alignment_tolerance.setter
196
194
  @enforce_parameter_types
197
- def angular_alignment_tolerance(
198
- self: "Self", value: "Union[float, Tuple[float, bool]]"
199
- ) -> None:
200
- wrapper_type = overridable.Overridable_float.wrapper_type()
201
- enclosed_type = overridable.Overridable_float.implicit_type()
202
- value, is_overridden = _unpack_overridable(value)
203
- value = wrapper_type[enclosed_type](
204
- enclosed_type(value) if value is not None else 0.0, is_overridden
195
+ def angular_alignment_tolerance(self: "Self", value: "float") -> None:
196
+ pythonnet_property_set(
197
+ self.wrapped,
198
+ "AngularAlignmentTolerance",
199
+ float(value) if value is not None else 0.0,
205
200
  )
206
- pythonnet_property_set(self.wrapped, "AngularAlignmentTolerance", value)
207
201
 
208
202
  @property
209
203
  def apply_translation_and_rotation_for_planetary_duplicates(self: "Self") -> "bool":
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mastapy
3
- Version: 14.0.1
3
+ Version: 14.0.1b2
4
4
  Summary: Python scripting API for MASTA.
5
5
  Home-page: https://www.smartmt.com/
6
6
  License: MIT
@@ -59,11 +59,6 @@ Mastapy is the Python scripting API for MASTA.
59
59
 
60
60
  ### Release Information
61
61
 
62
- #### Major Changes
63
-
64
- - Adds .NET 6.0+ Windows and Linux support for scripted properties (e.g. `@masta_property(...)`)
65
-
66
62
  #### Minor Changes
67
63
 
68
- - Additional error detection and handling added to initialisation to better detect invalid configurations.
69
64
  - Small bug fixes and improvements.
@@ -25,7 +25,7 @@ mastapy/_private/_internal/dataclasses.py,sha256=ts6BYMeJLSV_fSEHNdJQGWojU45q5rD
25
25
  mastapy/_private/_internal/deprecation.py,sha256=riT97SpMPLzIdlQNml22U4PT3DQMcg6cc5A61Weed30,1786
26
26
  mastapy/_private/_internal/enum_with_selected_value_runtime.py,sha256=889_CMTzIlTlf5zE3fx-5B-SjTIUBKdeh3sc-N_Dx8g,1922
27
27
  mastapy/_private/_internal/example_name.py,sha256=2YeKRg8qHei6Dz11rCMKggHaQKDjdG4xpaq2LgdBul4,46840
28
- mastapy/_private/_internal/helpers.py,sha256=5Ca7zn4RP5_ERmUKFyBMhQWibp4AoSglsJQPCGhGnTk,26596
28
+ mastapy/_private/_internal/helpers.py,sha256=Jbrv84TD5flD1JEG6TbrvI5tAU4CJgkqGRrZ0FsJ9LE,25656
29
29
  mastapy/_private/_internal/implicit/__init__.py,sha256=foTfUR6889DGjnDl1hPMIhFx2jP-CvEAt6XYK0mD_k4,19
30
30
  mastapy/_private/_internal/implicit/enum_with_selected_value/__init__.py,sha256=E6nMv34p7xP-HaKUaaxqUrEikuK_DlPfh3LqkmvOHQ0,34998
31
31
  mastapy/_private/_internal/implicit/enum_with_selected_value/active_process_method.py,sha256=8Ow-6fziEZDp7cYyWK1mqkb5QziOeRLeEJcH3JACZG4,2773
@@ -248,7 +248,7 @@ mastapy/_private/_internal/measurement_type.py,sha256=XIdMynl7fZkLg-MApq9-dFZKxL
248
248
  mastapy/_private/_internal/mixins.py,sha256=qjTMp4wzNl5xKMwFxNrjDpmo9QF4kW9Q_uWq3QinWK8,2232
249
249
  mastapy/_private/_internal/overridable_constructor.py,sha256=y94aX9r5wonPSpu_xMLgHsXX_M2LXy6JuRfrJo9So4k,1306
250
250
  mastapy/_private/_internal/overridable_enum_runtime.py,sha256=JI0ychFiO0HB5bwf7YgMos95UXjN30atzUrlfFqfj4A,2095
251
- mastapy/_private/_internal/python_net.py,sha256=yDws-Q1Z2NYsqDwpdf0p22vDUBI45dAo1wspa6ix_Gs,11573
251
+ mastapy/_private/_internal/python_net.py,sha256=k7Xp4fpk6-Hyr5awfXKyH36wSSNnSlHZ-fSWQYQvNp4,10657
252
252
  mastapy/_private/_internal/sentinels.py,sha256=L_ibd3s8-FRJYQqHc7AwTLbqLAr7EWGb6lnbTZJPbxE,2222
253
253
  mastapy/_private/_internal/tuple_with_name.py,sha256=PPpSho04giLWf9yZc5EoP0jporzCRgoZpZN9paGKfo0,1580
254
254
  mastapy/_private/_internal/type_enforcement.py,sha256=sNZIVZ8r9Iwnoc_cWQ5e6c-YJ6FaxritQF5ic4V8AJM,9080
@@ -2133,7 +2133,7 @@ mastapy/_private/nodal_analysis/_46.py,sha256=TC4j15q5VzK3yTsolVCzb_26068VvOQivV
2133
2133
  mastapy/_private/nodal_analysis/_47.py,sha256=VUQCtflw0WFtOG2nfxsqEa_KFeIIv_VHBqzTHJgoGZ0,2724
2134
2134
  mastapy/_private/nodal_analysis/_48.py,sha256=ka0ElU8wXLGSkF1GwkDJmjrOZEYyusWhHQyaES-1M_k,2178
2135
2135
  mastapy/_private/nodal_analysis/_49.py,sha256=ZX894fc_O9uSIx0aCVrCNJgg90yZ2rmWjMII9Fr5ve0,3091
2136
- mastapy/_private/nodal_analysis/_50.py,sha256=OB1TDFn-dRvMV5awRD4liROH21Lk6ei-N0nYlpw_8as,12602
2136
+ mastapy/_private/nodal_analysis/_50.py,sha256=OkWJ2voBhTKBvSwnNLI8Z1B1yceakrGA3nfnwob_CIw,12026
2137
2137
  mastapy/_private/nodal_analysis/_51.py,sha256=ALm2MKrlwu1uD3zGzwB7k7tVz6-mlAmdm6rc0ciMXFg,3071
2138
2138
  mastapy/_private/nodal_analysis/_52.py,sha256=zjehcy4CAP3u3dIjw79VKK2rf7_0LOBs-3b21sA8ljE,1293
2139
2139
  mastapy/_private/nodal_analysis/_53.py,sha256=OROJwXlM4UTr7s30fIaaD6zedczytp43xFHihn46Fec,1289
@@ -5451,7 +5451,7 @@ mastapy/_private/system_model/analyses_and_results/parametric_study_tools/_4499.
5451
5451
  mastapy/_private/system_model/analyses_and_results/parametric_study_tools/_4500.py,sha256=D01ONXdyJ4nbPT4cuJteFf_YILadwoIjFLBAWQ_yHG0,3239
5452
5452
  mastapy/_private/system_model/analyses_and_results/parametric_study_tools/_4501.py,sha256=KFDFd4XGRMSyyKo0q2ku2AAbXZD4mbO8DXBeHDaLoYk,4519
5453
5453
  mastapy/_private/system_model/analyses_and_results/parametric_study_tools/_4502.py,sha256=EuQUhz3wx4v9Sml1wZJxtx-Aw4NnUllFYryNieHg_GY,25291
5454
- mastapy/_private/system_model/analyses_and_results/parametric_study_tools/_4503.py,sha256=KDUqktqfxBnrS1XLp6QVCzqLCawPbeaBj75KChQZUnE,3159
5454
+ mastapy/_private/system_model/analyses_and_results/parametric_study_tools/_4503.py,sha256=vp60G4vHIDtSl8AvZa7T3TW05eCxGAJ-8lGXsGLwKa0,2681
5455
5455
  mastapy/_private/system_model/analyses_and_results/parametric_study_tools/_4504.py,sha256=7NuLm8F-AhJUO5G6oblghX5VMmMcmImXbcwIowmYvPM,4046
5456
5456
  mastapy/_private/system_model/analyses_and_results/parametric_study_tools/_4505.py,sha256=kxvntRVLHbwV_D0mcNxisdcjhqyvhtMZaRqhxidK-HY,14146
5457
5457
  mastapy/_private/system_model/analyses_and_results/parametric_study_tools/_4506.py,sha256=PeVXpaQkyISUPYPMCAdzRodPSXOeJSfDgcbM0XSVXLs,42335
@@ -7641,7 +7641,7 @@ mastapy/_private/system_model/fe/_2435.py,sha256=C3MhsTUg2WEMjl-OwlI0D4IoHDihLrD
7641
7641
  mastapy/_private/system_model/fe/_2436.py,sha256=z8RxqmkuagASunTNtkGqm-MV16JtgiluD4-gaUGKWOk,4313
7642
7642
  mastapy/_private/system_model/fe/_2437.py,sha256=IeXF6jqs5Bf5J91t8dZB4EzSiATf8z6U2wk43948x2c,3172
7643
7643
  mastapy/_private/system_model/fe/_2438.py,sha256=7Xzkik1C2CO8HGvNACpkMkQXfmol8gpf5EAeB5LLMHc,8274
7644
- mastapy/_private/system_model/fe/_2439.py,sha256=Ifl6SeegqbiFpO_RYvhLt9yyx9RjlKOxnTyJt5iM3Io,53080
7644
+ mastapy/_private/system_model/fe/_2439.py,sha256=84W-_-MC4Fd5CBwQwV0KzNWpVIc1x4bcKbFhO1pVf50,52627
7645
7645
  mastapy/_private/system_model/fe/_2440.py,sha256=FCuSWVDVJKel2sTY3U41N7suAT_slpALG2W37DryuHE,15138
7646
7646
  mastapy/_private/system_model/fe/_2441.py,sha256=YnvovXIx7hTnfCMcsQ6P7i64AzI9JCMfcQCj46ty7_E,7142
7647
7647
  mastapy/_private/system_model/fe/_2442.py,sha256=bLq0pTKO37ZF9zJtXr8VmKMMIdIUt4Pbt2n8lxqVd7c,4480
@@ -8526,6 +8526,6 @@ mastapy/utility/vectors/__init__.py,sha256=f6ZLo7uvpTCs6fOjiBbmyaAjydCaQjdGBaUNs
8526
8526
  mastapy/utility_gui/__init__.py,sha256=WKl0tRrwyK-eVtW80QhzeIjk2S9mu2Yo9SiiTn1qQww,1161
8527
8527
  mastapy/utility_gui/charts/__init__.py,sha256=3DVEXpTCfVH9nVwrc_sCUhOAnaMSQxsGgs1iGQWvQ4Y,3256
8528
8528
  mastapy/utility_gui/databases/__init__.py,sha256=Hu7PPDG3z37m2vouJRgxSNeuDtVqVrp80xrI59B4D48,553
8529
- mastapy-14.0.1.dist-info/METADATA,sha256=O9smtrG9EyhjMMv96OYEoyFSXzunXZ6q7tibtHlKfwQ,3483
8530
- mastapy-14.0.1.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
8531
- mastapy-14.0.1.dist-info/RECORD,,
8529
+ mastapy-14.0.1b2.dist-info/METADATA,sha256=i89hx0ERQgyrckqfEMHFtcC2lSCA8vxgnI0Jd3-zfJU,3260
8530
+ mastapy-14.0.1b2.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
8531
+ mastapy-14.0.1b2.dist-info/RECORD,,