PySimultan 0.6.0.3__py3-none-any.whl → 0.6.0.7__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.
Files changed (108) hide show
  1. PySimultan2/CHANGELOG.md +3 -0
  2. PySimultan2/__about__.py +1 -1
  3. PySimultan2/default_types.py +9 -0
  4. PySimultan2/object_mapper.py +1 -0
  5. PySimultan2/simultan_object.py +36 -0
  6. PySimultan2/typings/SIMULTAN/Data/Assets/__init__.pyi +616 -0
  7. PySimultan2/typings/SIMULTAN/Data/Components/__init__.pyi +2538 -0
  8. PySimultan2/typings/SIMULTAN/Data/FlowNetworks/__init__.pyi +499 -0
  9. PySimultan2/typings/SIMULTAN/Data/Geometry/__init__.pyi +2219 -0
  10. PySimultan2/typings/SIMULTAN/Data/MultiValues/__init__.pyi +682 -0
  11. PySimultan2/typings/SIMULTAN/Data/SimMath/__init__.pyi +1654 -0
  12. PySimultan2/typings/SIMULTAN/Data/SimNetworks/__init__.pyi +442 -0
  13. PySimultan2/typings/SIMULTAN/Data/SitePlanner/__init__.pyi +193 -0
  14. PySimultan2/typings/SIMULTAN/Data/Taxonomy/__init__.pyi +367 -0
  15. PySimultan2/typings/SIMULTAN/Data/Users/__init__.pyi +116 -0
  16. PySimultan2/typings/SIMULTAN/Data/ValueMappings/__init__.pyi +212 -0
  17. PySimultan2/typings/SIMULTAN/Data/__init__.pyi +232 -0
  18. PySimultan2/typings/SIMULTAN/DataMapping/__init__.pyi +916 -0
  19. PySimultan2/typings/SIMULTAN/Excel/__init__.pyi +15 -0
  20. PySimultan2/typings/SIMULTAN/Exceptions/__init__.pyi +268 -0
  21. PySimultan2/typings/SIMULTAN/Exchange/SimNetworkConnectors/__init__.pyi +32 -0
  22. PySimultan2/typings/SIMULTAN/Exchange/__init__.pyi +116 -0
  23. PySimultan2/typings/SIMULTAN/Projects/ManagedFiles/__init__.pyi +433 -0
  24. PySimultan2/typings/SIMULTAN/Projects/__init__.pyi +435 -0
  25. PySimultan2/typings/SIMULTAN/Serializer/CODXF/__init__.pyi +103 -0
  26. PySimultan2/typings/SIMULTAN/Serializer/CSV/__init__.pyi +122 -0
  27. PySimultan2/typings/SIMULTAN/Serializer/DXF/__init__.pyi +1335 -0
  28. PySimultan2/typings/SIMULTAN/Serializer/Geometry/__init__.pyi +48 -0
  29. PySimultan2/typings/SIMULTAN/Serializer/JSON/__init__.pyi +562 -0
  30. PySimultan2/typings/SIMULTAN/Serializer/METADXF/__init__.pyi +11 -0
  31. PySimultan2/typings/SIMULTAN/Serializer/PADXF/__init__.pyi +21 -0
  32. PySimultan2/typings/SIMULTAN/Serializer/PPATH/__init__.pyi +11 -0
  33. PySimultan2/typings/SIMULTAN/Serializer/Projects/__init__.pyi +112 -0
  34. PySimultan2/typings/SIMULTAN/Serializer/SIMLINKS/__init__.pyi +5 -0
  35. PySimultan2/typings/SIMULTAN/Serializer/SPDXF/__init__.pyi +13 -0
  36. PySimultan2/typings/SIMULTAN/Serializer/SimGeo/__init__.pyi +54 -0
  37. PySimultan2/typings/SIMULTAN/Serializer/TXDXF/__init__.pyi +46 -0
  38. PySimultan2/typings/SIMULTAN/Serializer/XMI/__init__.pyi +22 -0
  39. PySimultan2/typings/SIMULTAN/Serializer/__init__.pyi +32 -0
  40. PySimultan2/typings/SIMULTAN/Utils/BackgroundWork/__init__.pyi +43 -0
  41. PySimultan2/typings/SIMULTAN/Utils/Collections/__init__.pyi +216 -0
  42. PySimultan2/typings/SIMULTAN/Utils/ElevationProvider/__init__.pyi +66 -0
  43. PySimultan2/typings/SIMULTAN/Utils/Files/__init__.pyi +48 -0
  44. PySimultan2/typings/SIMULTAN/Utils/Randomize/__init__.pyi +11 -0
  45. PySimultan2/typings/SIMULTAN/Utils/Streams/__init__.pyi +59 -0
  46. PySimultan2/typings/SIMULTAN/Utils/UndoRedo/__init__.pyi +133 -0
  47. PySimultan2/typings/SIMULTAN/Utils/__init__.pyi +570 -0
  48. PySimultan2/typings/System/Buffers/Binary/__init__.pyi +248 -0
  49. PySimultan2/typings/System/Buffers/Text/__init__.pyi +91 -0
  50. PySimultan2/typings/System/Buffers/__init__.pyi +192 -0
  51. PySimultan2/typings/System/CodeDom/Compiler/__init__.pyi +137 -0
  52. PySimultan2/typings/System/Collections/Concurrent/__init__.pyi +47 -0
  53. PySimultan2/typings/System/Collections/Generic/__init__.pyi +1293 -0
  54. PySimultan2/typings/System/Collections/ObjectModel/__init__.pyi +166 -0
  55. PySimultan2/typings/System/Collections/Specialized/__init__.pyi +82 -0
  56. PySimultan2/typings/System/Collections/__init__.pyi +403 -0
  57. PySimultan2/typings/System/ComponentModel/__init__.pyi +582 -0
  58. PySimultan2/typings/System/Configuration/Assemblies/__init__.pyi +30 -0
  59. PySimultan2/typings/System/Diagnostics/CodeAnalysis/__init__.pyi +315 -0
  60. PySimultan2/typings/System/Diagnostics/Contracts/__init__.pyi +297 -0
  61. PySimultan2/typings/System/Diagnostics/SymbolStore/__init__.pyi +9 -0
  62. PySimultan2/typings/System/Diagnostics/Tracing/__init__.pyi +641 -0
  63. PySimultan2/typings/System/Diagnostics/__init__.pyi +1101 -0
  64. PySimultan2/typings/System/Globalization/__init__.pyi +1675 -0
  65. PySimultan2/typings/System/IO/Enumeration/__init__.pyi +125 -0
  66. PySimultan2/typings/System/IO/__init__.pyi +2747 -0
  67. PySimultan2/typings/System/Linq/Expressions/__init__.pyi +1815 -0
  68. PySimultan2/typings/System/Net/__init__.pyi +81 -0
  69. PySimultan2/typings/System/Numerics/__init__.pyi +2853 -0
  70. PySimultan2/typings/System/Reflection/Emit/__init__.pyi +1945 -0
  71. PySimultan2/typings/System/Reflection/Metadata/__init__.pyi +24 -0
  72. PySimultan2/typings/System/Reflection/__init__.pyi +2724 -0
  73. PySimultan2/typings/System/Resources/__init__.pyi +205 -0
  74. PySimultan2/typings/System/Runtime/CompilerServices/__init__.pyi +1926 -0
  75. PySimultan2/typings/System/Runtime/ConstrainedExecution/__init__.pyi +49 -0
  76. PySimultan2/typings/System/Runtime/ExceptionServices/__init__.pyi +34 -0
  77. PySimultan2/typings/System/Runtime/InteropServices/ComTypes/__init__.pyi +758 -0
  78. PySimultan2/typings/System/Runtime/InteropServices/Marshalling/__init__.pyi +461 -0
  79. PySimultan2/typings/System/Runtime/InteropServices/ObjectiveC/__init__.pyi +48 -0
  80. PySimultan2/typings/System/Runtime/InteropServices/__init__.pyi +2632 -0
  81. PySimultan2/typings/System/Runtime/Intrinsics/Arm/__init__.pyi +4757 -0
  82. PySimultan2/typings/System/Runtime/Intrinsics/Wasm/__init__.pyi +844 -0
  83. PySimultan2/typings/System/Runtime/Intrinsics/X86/__init__.pyi +5642 -0
  84. PySimultan2/typings/System/Runtime/Intrinsics/__init__.pyi +4504 -0
  85. PySimultan2/typings/System/Runtime/Loader/__init__.pyi +63 -0
  86. PySimultan2/typings/System/Runtime/Remoting/__init__.pyi +7 -0
  87. PySimultan2/typings/System/Runtime/Serialization/__init__.pyi +269 -0
  88. PySimultan2/typings/System/Runtime/Versioning/__init__.pyi +200 -0
  89. PySimultan2/typings/System/Runtime/__init__.pyi +141 -0
  90. PySimultan2/typings/System/Security/Cryptography/__init__.pyi +39 -0
  91. PySimultan2/typings/System/Security/Permissions/__init__.pyi +163 -0
  92. PySimultan2/typings/System/Security/Principal/__init__.pyi +45 -0
  93. PySimultan2/typings/System/Security/__init__.pyi +347 -0
  94. PySimultan2/typings/System/Text/Unicode/__init__.pyi +62 -0
  95. PySimultan2/typings/System/Text/__init__.pyi +1590 -0
  96. PySimultan2/typings/System/Threading/Tasks/Sources/__init__.pyi +76 -0
  97. PySimultan2/typings/System/Threading/Tasks/__init__.pyi +1403 -0
  98. PySimultan2/typings/System/Threading/__init__.pyi +1788 -0
  99. PySimultan2/typings/System/Xml/Schema/__init__.pyi +1255 -0
  100. PySimultan2/typings/System/Xml/Serialization/__init__.pyi +16 -0
  101. PySimultan2/typings/System/Xml/XPath/__init__.pyi +474 -0
  102. PySimultan2/typings/System/Xml/__init__.pyi +2410 -0
  103. PySimultan2/typings/System/__init__.pyi +17821 -0
  104. {pysimultan-0.6.0.3.dist-info → pysimultan-0.6.0.7.dist-info}/METADATA +1 -1
  105. pysimultan-0.6.0.7.dist-info/RECORD +174 -0
  106. pysimultan-0.6.0.3.dist-info/RECORD +0 -76
  107. {pysimultan-0.6.0.3.dist-info → pysimultan-0.6.0.7.dist-info}/WHEEL +0 -0
  108. {pysimultan-0.6.0.3.dist-info → pysimultan-0.6.0.7.dist-info}/licenses/LICENSE.txt +0 -0
PySimultan2/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ Version 0.6.0.3 (23.01.2024)
2
+ - Added sub_classes and super_classes to SimultanObject
3
+
1
4
  Version 0.6.0.2 (16.01.2024)
2
5
  - Added __delitem__ method to default_types.ComponentList
3
6
 
PySimultan2/__about__.py CHANGED
@@ -1 +1 @@
1
- version = '0.6.0.3'
1
+ version = '0.6.0.7'
@@ -5,6 +5,7 @@ import numpy as np
5
5
  import colorlog
6
6
  from typing import Union, List, Type, Set, Tuple, Any, Optional
7
7
 
8
+ from .geometry.geometry_base import classproperty
8
9
  from .utils import (sort_slots, create_simultan_component_for_taxonomy, create_mapped_python_object,
9
10
  set_property_to_sim_component, set_property_to_parameter, set_property_to_file_info,
10
11
  set_property_to_list, set_property_to_value_field, set_property_to_unknown_type,
@@ -32,6 +33,10 @@ class ComponentList(SimultanObject):
32
33
  _create_all = False # if true all properties are evaluated to create python objects when initialized
33
34
  _taxonomy = 'ComponentList'
34
35
 
36
+ @classproperty
37
+ def _original_class(cls) -> Type[ComponentList]:
38
+ return cls
39
+
35
40
  def __init__(self, *args, **kwargs):
36
41
  super().__init__(*args, **kwargs)
37
42
  self.component_policy = kwargs.get('component_policy', 'subcomponent') # component add policy of the content/parameter/property, 'reference' or 'subcomponent'
@@ -405,6 +410,10 @@ class ComponentDictionary(SimultanObject):
405
410
 
406
411
  _taxonomy = 'ComponentDict'
407
412
 
413
+ @classproperty
414
+ def _original_class(cls) -> Type[ComponentList]:
415
+ return cls
416
+
408
417
  def __init__(self, *args, **kwargs):
409
418
  self._dict = {}
410
419
  super().__init__(*args, **kwargs)
@@ -168,6 +168,7 @@ class PythonMapper(object):
168
168
  '_cls_instances': WeakSet(),
169
169
  '_taxonomy_map': self.taxonomy_maps.get(taxonomy, None),
170
170
  '_base': bases,
171
+ '_original_cls': cls,
171
172
  '_object_mapper': self}
172
173
 
173
174
  new_class_dict.update(self.get_properties(taxonomy))
@@ -130,6 +130,42 @@ class SimultanObject(object, metaclass=MetaMock):
130
130
  logger.error(f'Error getting cls_instances: {e}')
131
131
  return []
132
132
 
133
+ @classproperty
134
+ def super_classes(cls):
135
+ superclasses = []
136
+ for key, mcls in cls._object_mapper.mapped_classes.items():
137
+ if mcls is cls:
138
+ continue
139
+ if set(cls._original_cls.__mro__) & set(mcls._original_cls.__mro__) - set([object]) and \
140
+ set(mcls._original_cls.__mro__) - set(cls._original_cls.__mro__) - set((SimultanObject,
141
+ object)):
142
+ superclasses.append(mcls)
143
+ return superclasses
144
+
145
+ @classproperty
146
+ def sub_classes(cls):
147
+ subclasses = []
148
+ for key, mcls in cls._object_mapper.mapped_classes.items():
149
+ if mcls is cls:
150
+ continue
151
+ if set(cls._original_cls.__mro__) & set(mcls._original_cls.__mro__) - set([object]) and \
152
+ set(cls._original_cls.__mro__) - set(mcls._original_cls.__mro__) - set((SimultanObject,
153
+ object)):
154
+ subclasses.append(mcls)
155
+ return subclasses
156
+
157
+ @classproperty
158
+ def super_class_instances(cls) -> set['SimultanObject']:
159
+ instances = set()
160
+ _ = [instances.update(x.cls_instances) for x in cls.super_classes]
161
+ return instances
162
+
163
+ @classproperty
164
+ def sub_class_instances(cls) -> set['SimultanObject']:
165
+ instances = set()
166
+ _ = [instances.update(x.cls_instances) for x in cls.sub_classes]
167
+ return instances
168
+
133
169
  @classmethod
134
170
  def create_simultan_component(cls, *args, **kwargs) -> SimComponent:
135
171
  wrapped_obj = utils.create_simultan_component_for_taxonomy(cls, *args, **kwargs)