PySimultan 0.5.6__py3-none-any.whl → 0.5.8__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
PySimultan2/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ Version 0.5.7 (11.12.2024)
2
+ - Added get_orientation_to_volume method to SimultanFace which returns the orientation of the face to the volume
3
+
1
4
  Version 0.5.3 (01.12.2024)
2
5
  - Added support for directories (Assets and FileInfo)
3
6
 
PySimultan2/__about__.py CHANGED
@@ -1 +1 @@
1
- version = '0.5.6'
1
+ version = '0.5.8'
@@ -471,6 +471,18 @@ class SimultanFace(ExtendedBaseGeometry):
471
471
 
472
472
  return vertices, triangles
473
473
 
474
+ def get_orientation_to_volume(self, volume: 'SimultanVolume') -> Optional[GeometricOrientation]:
475
+
476
+ p_face = next((x for x in volume._wrapped_object.Faces if x.Face.Id is self._wrapped_object.Id), None)
477
+
478
+ if p_face is None or p_face.Orientation == GeometricOrientation.Undefined:
479
+ return None
480
+
481
+ mul_1 = 1 if self.orientation == GeometricOrientation.Forward else -1
482
+ mul_2 = 1 if p_face.Orientation == GeometricOrientation.Forward else -1
483
+
484
+ return GeometricOrientation.Forward if mul_1 * mul_2 == 1 else GeometricOrientation.Backward
485
+
474
486
  def __repr__(self):
475
487
  return f"SimultanFace {self.id} ({self.boundary.id}, {[x.id for x in self.holes]})"
476
488
 
@@ -46,6 +46,8 @@ class Content(object):
46
46
  self._taxonomy_entries = {}
47
47
  self._taxonomy_map = kwargs.get('taxonomy_map', None)
48
48
 
49
+ self.taxonomy_key = kwargs.get('taxonomy_key')
50
+
49
51
  add_kwargs = kwargs.copy()
50
52
  _ = [add_kwargs.pop(key, None) for key in ['taxonomy_name', 'taxonomy_key', 'taxonomy_entry_name',
51
53
  'taxonomy_entry_key', 'content', 'documentation', 'python_mapper',
@@ -54,10 +56,20 @@ class Content(object):
54
56
 
55
57
  self.additional_attributes = add_kwargs
56
58
 
59
+ self.taxonomy_key = kwargs.get('taxonomy_key')
60
+ self.taxonomy_name = kwargs.get('taxonomy_name')
61
+
62
+
57
63
  def get_taxonomie_entry(self, data_model: 'DataModel'):
58
64
  if self._taxonomy_entries.get(data_model, None) is None:
59
65
 
60
- taxonomy = self._taxonomy_map.get_or_create_simultan_taxonomy(data_model=data_model, create=True)
66
+ if self.taxonomy_key is None:
67
+ taxonomy = self._taxonomy_map.get_or_create_simultan_taxonomy(data_model=data_model, create=True)
68
+ else:
69
+ taxonomy = data_model.get_or_create_taxonomy(taxonomy_name=self.taxonomy_name,
70
+ taxonomy_key=self.taxonomy_key,
71
+ create=True)
72
+
61
73
  self._taxonomy_entries[data_model] = data_model.get_or_create_taxonomy_entry(name=self.text_or_key,
62
74
  key=self.text_or_key,
63
75
  description=self.documentation,
@@ -20,7 +20,6 @@ from SIMULTAN.Data.Components import (ComponentWalker, SimComponent, SimBoolPara
20
20
 
21
21
 
22
22
  class TypeSetterFcnLookupDict(object):
23
-
24
23
  lookup_dict = {None: lambda x: None,
25
24
  SimComponent: set_property_to_sim_component,
26
25
  SimultanObject: set_property_to_sim_component,
@@ -32,7 +31,11 @@ class TypeSetterFcnLookupDict(object):
32
31
  SimMultiValueField3D: set_property_to_value_field,
33
32
  SimMultiValueBigTable: set_property_to_value_field,
34
33
  int: set_property_to_parameter,
34
+ np.int32: set_property_to_parameter,
35
+ np.int64: set_property_to_parameter,
35
36
  float: set_property_to_parameter,
37
+ np.float32: set_property_to_parameter,
38
+ np.float64: set_property_to_parameter,
36
39
  str: set_property_to_parameter,
37
40
  bool: set_property_to_parameter,
38
41
  FileInfo: set_property_to_file_info,
PySimultan2/utils.py CHANGED
@@ -360,9 +360,9 @@ def create_parameter(value: Union[int, float, str, SimTaxonomyEntry] = 0,
360
360
  taxonomy_entry = get_default_slot(SimTaxonomyEntry)
361
361
 
362
362
  if parameter_type is None:
363
- if type(value) is float:
363
+ if type(value) in (float, np.float64, np.float32):
364
364
  parameter_type = float
365
- elif type(value) is int:
365
+ elif type(value) in (int, np.int64, np.int32):
366
366
  parameter_type = int
367
367
  elif type(value) is str:
368
368
  parameter_type = str
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: PySimultan
3
- Version: 0.5.6
3
+ Version: 0.5.8
4
4
  Project-URL: Documentation, https://github.com/Bühler Maximilian/PySimultan2#readme
5
5
  Project-URL: Issues, https://github.com/Bühler Maximilian/PySimultan2/issues
6
6
  Project-URL: Source, https://github.com/Bühler Maximilian/PySimultan2
@@ -166,6 +166,10 @@ print(instances[0].param_1)
166
166
 
167
167
  # Change Log
168
168
 
169
+ ## [0.5.7] - 2024-12-09
170
+ - Added support for different taxonomy for content
171
+ - Added support for numpy np.float32, np.float64 and np.int32, np.int64
172
+
169
173
  ## [0.4.20] - 2024-07-01
170
174
  - Fixed Bug in nested dictionary creation
171
175
 
@@ -1,5 +1,5 @@
1
- PySimultan2/CHANGELOG.md,sha256=LeVHBC6dGDwDwgXipNrwgvgews9QkyjsqtYa_jiLMm0,217
2
- PySimultan2/__about__.py,sha256=ahwIJXU28jCG9DVuIM_KtpxcsovPdHHik2HOD6G7DgQ,19
1
+ PySimultan2/CHANGELOG.md,sha256=BBfCqgFQeigrlRQdHAksDz70-0fLKjzWkHbfFjJ2eDg,361
2
+ PySimultan2/__about__.py,sha256=I4Xkc80vf8gODt5O1ySRQPAixhhRNGFEyH4DQhuHlco,19
3
3
  PySimultan2/__init__.py,sha256=PGVR1uhY01dF5tHyad-znURUZ_LVB95vsjId2BT0aJM,3245
4
4
  PySimultan2/data_model.py,sha256=YYtfcR6jvGztng6Be8Vw9FQ02cPkl8ATHTZMoIu1ABQ,34140
5
5
  PySimultan2/default_types.py,sha256=K-Eka5BCKk8DT3HU5761Ym_-ZFmu1_Dro0zW0LVGoHA,27157
@@ -7,11 +7,11 @@ PySimultan2/files.py,sha256=BCETl4M8qedw7Bjt8QXvY6Rl3U6Lou36XqPY2ST1o9Q,22447
7
7
  PySimultan2/multi_values.py,sha256=ZFXlTLuZo32x7_7diYAp2XEjp5uwgHLgNOzN7v74-5I,13650
8
8
  PySimultan2/object_mapper.py,sha256=_SQye38NmIr4m_-X9CuvUJnVDBmjmUDdPH2bnaxpzKY,18546
9
9
  PySimultan2/simultan_object.py,sha256=akaSUZZWIVfwx1wT5EdOgRR2UeShUthX-LE2Uk6w8CQ,19058
10
- PySimultan2/taxonomy_maps.py,sha256=abMB2RSKEaliW-Ewegq-Inq9npHeOD1VVrMYoKJAlC0,8762
11
- PySimultan2/type_setter_lookup.py,sha256=px92E-BlnvY-11F-F7L7cOwbE1_L8FQVqi-23nJi5j4,3518
12
- PySimultan2/utils.py,sha256=TOrMMTh6n63VgjEGVX6j67_jhUx4ImFI39X61g0OegQ,66692
10
+ PySimultan2/taxonomy_maps.py,sha256=K8lwiBkEnQkx40YZxqSJAHdqwuo6ssvkXLL_GBxVYO0,9271
11
+ PySimultan2/type_setter_lookup.py,sha256=PGa5_EtV7SM15w3uxy0fA3LiQ0TaS4Ys0LYR5zs8aNk,3748
12
+ PySimultan2/utils.py,sha256=1e2sYW1ioV0L9NREbBr03Y2tK1Hx9HxQv1pdXnIPIGY,66740
13
13
  PySimultan2/geometry/__init__.py,sha256=nJolTD1i5J8qUkOQa-r3D20aq3Co3sN31Xc0n4wJpJo,248
14
- PySimultan2/geometry/geometry_base.py,sha256=nbb9U2W3vFviVLxISLHRi2CVyLEM-3zIKvoZ1uSYs_8,23420
14
+ PySimultan2/geometry/geometry_base.py,sha256=TwABfQEsqxAIGLqwvqVXEV-GA5sYGBJSJm7e58QmNzM,24015
15
15
  PySimultan2/geometry/utils.py,sha256=J25YsK8sso_UL7xRusItQZvyjtvxdOsSPelBQYFABhY,8519
16
16
  PySimultan2/resources/AssimpNet.dll,sha256=x8uwMHPRmEH9fDQihfEQLUdblM1u7RP-CCnUjOpXcLo,205312
17
17
  PySimultan2/resources/AvalonDock.dll,sha256=9tCcw7cpaVq0bh1H2sfcxb8EWhySmgujPs89lAqIPZs,500224
@@ -75,7 +75,7 @@ PySimultan2/resources/assimp.dll,sha256=HwfDwXqoPDTFRyoQpA3qmgZoUdFtziJkV5fNtktE
75
75
  PySimultan2/resources/componentmanager.user,sha256=hrzr1US4pqkFnLHXcvPkvrgGd7QvlxaV8mhS6fuikEs,760
76
76
  PySimultan2/resources/defaultsettings.xml,sha256=s6Tk1tubLz5UYqXZWpD42EDHzedemRY1nEneoIVcUfg,392
77
77
  PySimultan2/resources/setup.bat,sha256=fjvvYfVM6TalS-QTSiKAbAId5nTsk8kGGo06ba-wWaY,32
78
- pysimultan-0.5.6.dist-info/METADATA,sha256=MblBIAKHvlsGbA3u5BVv5rycD0yqSqph_B4nNyEyfOA,5815
79
- pysimultan-0.5.6.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
80
- pysimultan-0.5.6.dist-info/licenses/LICENSE.txt,sha256=pmSr98k6N005KMojnZxzLGRuRlDjDx3PUrK1lFj53HA,1126
81
- pysimultan-0.5.6.dist-info/RECORD,,
78
+ pysimultan-0.5.8.dist-info/METADATA,sha256=MRNoaabziaKiIp2bEk0MBnDiFGyiEtyWWesmdgIf3V4,5963
79
+ pysimultan-0.5.8.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
80
+ pysimultan-0.5.8.dist-info/licenses/LICENSE.txt,sha256=pmSr98k6N005KMojnZxzLGRuRlDjDx3PUrK1lFj53HA,1126
81
+ pysimultan-0.5.8.dist-info/RECORD,,