PySimultan 0.3.2__py3-none-any.whl → 0.4.0__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1 @@
1
+ version = '0.4.0'
@@ -375,10 +375,10 @@ class ComponentDictionary(SimultanObject):
375
375
  '_dict').keys():
376
376
  return object.__getattribute__(self, '_dict')[key]
377
377
  else:
378
- data_model = config.default_data_model
378
+ # data_model = config.default_data_model
379
379
  obj = get_component_taxonomy_entry(self._wrapped_obj, key)
380
380
  if obj is not None:
381
- val = get_obj_value(obj, data_model=data_model, object_mapper=self._object_mapper)
381
+ val = get_obj_value(obj, data_model=self._data_model, object_mapper=self._object_mapper)
382
382
  self._dict[key] = val
383
383
  return self._dict[key]
384
384
 
@@ -99,7 +99,6 @@ class PythonMapper(object):
99
99
  new_component_list = set()
100
100
 
101
101
  def get_subcomponents(sim_component: Union[SimComponent, SimultanObject]):
102
- print(sim_component.Id)
103
102
  new_subcomponents = set()
104
103
  if isinstance(sim_component, SimultanObject):
105
104
  sim_component = sim_component._wrapped_obj
@@ -109,9 +108,16 @@ class PythonMapper(object):
109
108
  else:
110
109
  new_component_list.add(sim_component)
111
110
 
111
+ if sim_component is None:
112
+ return []
113
+
112
114
  for sub_component in sim_component.Components.Items:
115
+ if sub_component is None:
116
+ continue
113
117
  new_subcomponents.add(sub_component.Component)
114
118
  for ref_component in sim_component.ReferencedComponents.Items:
119
+ if ref_component is None:
120
+ continue
115
121
  new_subcomponents.add(ref_component.Target)
116
122
 
117
123
  for new_subcomponent in new_subcomponents:
@@ -120,6 +126,8 @@ class PythonMapper(object):
120
126
  new_component_list.update(new_subcomponents)
121
127
 
122
128
  for component in component_list:
129
+ if component is None:
130
+ continue
123
131
  get_subcomponents(component)
124
132
  component_list = list(new_component_list)
125
133
 
PySimultan2/utils.py CHANGED
@@ -69,6 +69,8 @@ def create_python_object(wrapped_obj: SimComponent, cls: Type[SimultanObject], *
69
69
  :return:
70
70
  """
71
71
 
72
+ from .default_types import ComponentList, ComponentDictionary
73
+
72
74
  if kwargs.get('data_model_id', None) is None:
73
75
  from .data_model import data_models
74
76
  kwargs['data_model_id'] = list(data_models)[0].id
@@ -100,11 +102,17 @@ def create_python_object(wrapped_obj: SimComponent, cls: Type[SimultanObject], *
100
102
  kwargs['__obj_init__'] = True
101
103
 
102
104
  obj = cls.__new__(cls)
105
+ obj.__obj_init__ = True
103
106
  obj._wrapped_obj = wrapped_obj
104
107
  obj._data_model = kwargs.get('data_model', None)
105
108
  obj._object_mapper = kwargs.get('object_mapper', None)
106
109
  obj.component_policy = kwargs.get('component_policy', 'subcomponent')
107
110
 
111
+ if isinstance(obj, ComponentList):
112
+ obj.index = kwargs.get('index', 0)
113
+ if isinstance(obj, ComponentDictionary):
114
+ obj._dict = {}
115
+
108
116
  if "_cls_instances" not in cls.__dict__:
109
117
  cls._cls_instances = WeakSet()
110
118
  try:
@@ -0,0 +1,50 @@
1
+ Metadata-Version: 2.3
2
+ Name: PySimultan
3
+ Version: 0.4.0
4
+ Project-URL: Documentation, https://github.com/Bühler Maximilian/PySimultan2#readme
5
+ Project-URL: Issues, https://github.com/Bühler Maximilian/PySimultan2/issues
6
+ Project-URL: Source, https://github.com/Bühler Maximilian/PySimultan2
7
+ Author-email: Bühler Maximilian <maximilian.buehler@tuwien.ac.at>
8
+ License-Expression: MIT
9
+ License-File: LICENSE.txt
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Programming Language :: Python
12
+ Classifier: Programming Language :: Python :: 3.8
13
+ Classifier: Programming Language :: Python :: 3.9
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: Implementation :: CPython
18
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
19
+ Requires-Python: >=3.8
20
+ Requires-Dist: colorlog
21
+ Requires-Dist: numpy
22
+ Requires-Dist: pandas
23
+ Requires-Dist: pyarrow
24
+ Requires-Dist: pythonnet
25
+ Requires-Dist: ruamel-yaml
26
+ Requires-Dist: six
27
+ Requires-Dist: tqdm
28
+ Description-Content-Type: text/markdown
29
+
30
+ # pysimultan_api
31
+
32
+ [![PyPI - Version](https://img.shields.io/pypi/v/pysimultan-api.svg)](https://pypi.org/project/pysimultan-api)
33
+ [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pysimultan-api.svg)](https://pypi.org/project/pysimultan-api)
34
+
35
+ -----
36
+
37
+ ## Table of Contents
38
+
39
+ - [Installation](#installation)
40
+ - [License](#license)
41
+
42
+ ## Installation
43
+
44
+ ```console
45
+ pip install pysimultan-api
46
+ ```
47
+
48
+ ## License
49
+
50
+ `pysimultan-api` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
@@ -1,13 +1,14 @@
1
+ PySimultan2/__about__.py,sha256=NLz2y04spAo9hkDBgrxcVBhjKElO7Jf_NlVw_P6fGxc,19
1
2
  PySimultan2/__init__.py,sha256=X10eSCNtac3CG28w7Ogo1csNalhapO9V4oVSIucc0Kw,1121
2
3
  PySimultan2/config.py,sha256=Bazt2vDSEga_cFEIPWcAYBsj3TUN5jgtob8TtUvGm5E,1523
3
4
  PySimultan2/data_model.py,sha256=2Qq_JyUxtDgsIt3p5hIXIqNy7eAtvn-6Of_Wzb9AWoE,28004
4
- PySimultan2/default_types.py,sha256=E4aS3NuLl0mG5vBJv0saxbBFWk1s4eSg21cl4bcNAH8,22880
5
+ PySimultan2/default_types.py,sha256=C6CB5NIjpT0zBeruMBzojKa9LPz4_8VCY6yOLNQPOCg,22888
5
6
  PySimultan2/files.py,sha256=q6A5KTqU1nCwh0W0Qf3Se7qcvhGiDAWza2v-X-rt6E4,12473
6
7
  PySimultan2/multi_values.py,sha256=ZFXlTLuZo32x7_7diYAp2XEjp5uwgHLgNOzN7v74-5I,13650
7
- PySimultan2/object_mapper.py,sha256=cvw0gJk3NzsSkN2UNd7nRxhBkTe7TYddmHwxW7VpIHg,8973
8
+ PySimultan2/object_mapper.py,sha256=RCIJl0hj1cmWCTOj2HkwRY5EWrSdjziyEg-xIqj1kUw,9239
8
9
  PySimultan2/simultan_object.py,sha256=PWpveGPFi1nlcHSK8vT_3lyEoa27eBY6ZpKAtgR-KGg,16215
9
10
  PySimultan2/taxonomy_maps.py,sha256=qgKM0CdwwgLCFj-ivzY38VaCpE_eCPKyCiBaTBazpBk,7509
10
- PySimultan2/utils.py,sha256=dooNH59P8tks0_BeRdQqs7L3nkLR3cqMkVeNviL-s7U,62897
11
+ PySimultan2/utils.py,sha256=FSMvcK_6i8-Z7xGlxxRV6SJPp9UZS8Jj-CX5y7TxXSw,63171
11
12
  PySimultan2/geometry/__init__.py,sha256=nJolTD1i5J8qUkOQa-r3D20aq3Co3sN31Xc0n4wJpJo,248
12
13
  PySimultan2/geometry/geometry_base.py,sha256=IQQPVxkgIdBsFJp8rPSCNiCiKO7TxkVWy-XmE8GjDbE,23367
13
14
  PySimultan2/geometry/utils.py,sha256=K_3HnqPMAlJkOh01oqjspeqsLrooG9NwIQKWf14IJ48,8513
@@ -75,8 +76,7 @@ PySimultan2/resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
75
76
  PySimultan2/resources/assimp.dll,sha256=HwfDwXqoPDTFRyoQpA3qmgZoUdFtziJkV5fNtktEZEU,6081536
76
77
  PySimultan2/resources/defaultsettings.xml,sha256=s6Tk1tubLz5UYqXZWpD42EDHzedemRY1nEneoIVcUfg,392
77
78
  PySimultan2/resources/setup.bat,sha256=fjvvYfVM6TalS-QTSiKAbAId5nTsk8kGGo06ba-wWaY,32
78
- PySimultan-0.3.2.dist-info/LICENSE.txt,sha256=htoPAa6uRjSKPD1GUZXcHOzN55956HdppkuNoEsqR0E,1023
79
- PySimultan-0.3.2.dist-info/METADATA,sha256=llAFFL2ApdxeU6gqwy6PWNFYyIvP-OEEfEVDxW5MVu0,1990
80
- PySimultan-0.3.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
81
- PySimultan-0.3.2.dist-info/top_level.txt,sha256=pbE6SbdKIEEK4vaDNmmdRTj0vesrjgRXGow8QWMTXvk,12
82
- PySimultan-0.3.2.dist-info/RECORD,,
79
+ pysimultan-0.4.0.dist-info/METADATA,sha256=6o0gfQ0uVpgmXt5ssaelcmqPziQyhXQB8Me_vv934aA,1657
80
+ pysimultan-0.4.0.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
81
+ pysimultan-0.4.0.dist-info/licenses/LICENSE.txt,sha256=pmSr98k6N005KMojnZxzLGRuRlDjDx3PUrK1lFj53HA,1126
82
+ pysimultan-0.4.0.dist-info/RECORD,,
@@ -1,5 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.43.0)
2
+ Generator: hatchling 1.24.2
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
-
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024-present Bühler Maximilian <maximilian.buehler@a1.digital>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,17 +0,0 @@
1
- Permission is hereby granted, free of charge, to any person obtaining a copy
2
- of this software and associated documentation files (the "Software"), to
3
- deal in the Software without restriction, including without limitation the
4
- rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
5
- sell copies of the Software, and to permit persons to whom the Software is
6
- furnished to do so, subject to the following conditions:
7
-
8
- The above copyright notice and this permission notice shall be included in
9
- all copies or substantial portions of the Software.
10
-
11
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
16
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
17
- IN THE SOFTWARE.
@@ -1,44 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: PySimultan
3
- Version: 0.3.2
4
- Home-page:
5
- Author: Max Buehler
6
- Author-email: Max Bühler <maximilian.buehler@tuwien.ac.at>
7
- License: Permission is hereby granted, free of charge, to any person obtaining a copy
8
- of this software and associated documentation files (the "Software"), to
9
- deal in the Software without restriction, including without limitation the
10
- rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11
- sell copies of the Software, and to permit persons to whom the Software is
12
- furnished to do so, subject to the following conditions:
13
-
14
- The above copyright notice and this permission notice shall be included in
15
- all copies or substantial portions of the Software.
16
-
17
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
23
- IN THE SOFTWARE.
24
-
25
- Classifier: Programming Language :: Python :: 3
26
- Classifier: License :: OSI Approved :: MIT License
27
- Classifier: Operating System :: OS Independent
28
- Requires-Python: >=3.10
29
- Description-Content-Type: text/markdown
30
- License-File: LICENSE.txt
31
- Requires-Dist: six
32
- Requires-Dist: numpy
33
- Requires-Dist: pythonnet
34
- Requires-Dist: colorlog
35
- Requires-Dist: ruamel.yaml
36
- Requires-Dist: tqdm
37
- Requires-Dist: pandas
38
- Requires-Dist: pyarrow
39
-
40
- ===================================================
41
- geometry_utils: Several tools to work with geometry
42
- ===================================================
43
-
44
- Python library with several tools to work with geometry
@@ -1 +0,0 @@
1
- PySimultan2