PySimultan 0.3.3__tar.gz → 0.4.1__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. pysimultan-0.4.1/.gitignore +27 -0
  2. pysimultan-0.4.1/LICENSE.txt +9 -0
  3. pysimultan-0.4.1/PKG-INFO +50 -0
  4. pysimultan-0.4.1/README.md +21 -0
  5. pysimultan-0.4.1/pyproject.toml +72 -0
  6. pysimultan-0.4.1/src/PySimultan2/__about__.py +1 -0
  7. pysimultan-0.4.1/src/PySimultan2/__init__.py +99 -0
  8. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/data_model.py +56 -68
  9. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/default_types.py +4 -4
  10. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/files.py +6 -3
  11. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/geometry/geometry_base.py +3 -2
  12. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/geometry/utils.py +1 -1
  13. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/object_mapper.py +22 -6
  14. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/simultan_object.py +20 -4
  15. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/taxonomy_maps.py +13 -1
  16. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/utils.py +43 -39
  17. pysimultan-0.4.1/tests/readme_examples/__init__.py +0 -0
  18. pysimultan-0.4.1/tests/readme_examples/create_component.py +35 -0
  19. pysimultan-0.4.1/tests/readme_examples/create_component_with_taxonomy_slot.py +76 -0
  20. pysimultan-0.4.1/tests/readme_examples/create_referenced_component.py +61 -0
  21. pysimultan-0.4.1/tests/readme_examples/create_taxonomies.py +29 -0
  22. pysimultan-0.4.1/tests/readme_examples/resources/__init__.py +0 -0
  23. pysimultan-0.4.1/tests/readme_examples/resources/change_references_example.simultan +0 -0
  24. pysimultan-0.4.1/tests/readme_examples/resources/empty_project.simultan +0 -0
  25. pysimultan-0.4.1/tests/readme_examples/resources/empty_test_excel.xlsx +0 -0
  26. pysimultan-0.4.1/tests/readme_examples/resources/example1.simultan +0 -0
  27. pysimultan-0.4.1/tests/readme_examples/resources/example2.simultan +0 -0
  28. pysimultan-0.4.1/tests/readme_examples/resources/example3.simultan +0 -0
  29. pysimultan-0.4.1/tests/readme_examples/resources/example4_reference_list.simultan +0 -0
  30. pysimultan-0.4.1/tests/readme_examples/resources/example_extend_1.simultan +0 -0
  31. pysimultan-0.4.1/tests/readme_examples/resources/list_test.simultan +0 -0
  32. pysimultan-0.4.1/tests/readme_examples/resources/template_example3.yml +20 -0
  33. pysimultan-0.4.1/tests/readme_examples/resources/template_example4.yml +50 -0
  34. pysimultan-0.4.1/tests/readme_examples/resources/template_example_create_typed_component.yml +10 -0
  35. pysimultan-0.4.1/tests/readme_examples/resources/template_example_create_typed_component_with_slots.yml +22 -0
  36. pysimultan-0.4.1/tests/readme_examples/resources/template_example_extend.yml +10 -0
  37. pysimultan-0.4.1/tests/readme_examples/resources/template_example_update_references.yml +33 -0
  38. pysimultan-0.4.1/tests/readme_examples/resources/template_reference_list.yml +1 -0
  39. pysimultan-0.4.1/tests/resources/U5.simultan +0 -0
  40. pysimultan-0.4.1/tests/resources/U5_1.simultan +0 -0
  41. pysimultan-0.4.1/tests/resources/U5_orig.simultan +0 -0
  42. pysimultan-0.4.1/tests/resources/__init__.py +0 -0
  43. pysimultan-0.4.1/tests/resources/new_geometry_test.simultan +0 -0
  44. pysimultan-0.4.1/tests/resources/test_file.yml +1 -0
  45. pysimultan-0.4.1/tests/resources/test_file_load.simultan +0 -0
  46. pysimultan-0.4.1/tests/resources/test_file_project.simultan +0 -0
  47. pysimultan-0.4.1/tests/resources/test_multi_value_big_table_load.simultan +0 -0
  48. pysimultan-0.4.1/tests/test_calc_static_zone_temperature.py +0 -0
  49. {pysimultan-0.3.3 → pysimultan-0.4.1}/tests/test_calculate_steady_state_temperature.py +87 -27
  50. {pysimultan-0.3.3 → pysimultan-0.4.1}/tests/test_circular_references.py +23 -9
  51. {pysimultan-0.3.3 → pysimultan-0.4.1}/tests/test_create_geometry.py +1 -1
  52. {pysimultan-0.3.3 → pysimultan-0.4.1}/tests/test_files_load.py +1 -1
  53. {pysimultan-0.3.3 → pysimultan-0.4.1}/tests/test_load_geometry.py +1 -1
  54. {pysimultan-0.3.3 → pysimultan-0.4.1}/tests/test_load_multi_values.py +1 -1
  55. {pysimultan-0.3.3 → pysimultan-0.4.1}/tests/test_register_class.py +1 -1
  56. {pysimultan-0.3.3 → pysimultan-0.4.1}/tests/test_ui.py +1 -3
  57. pysimultan-0.4.1/tests/ui_minimal_example.py +55 -0
  58. pysimultan-0.3.3/LICENSE.txt +0 -17
  59. pysimultan-0.3.3/MANIFEST.in +0 -9
  60. pysimultan-0.3.3/PKG-INFO +0 -44
  61. pysimultan-0.3.3/README.md +0 -5
  62. pysimultan-0.3.3/pyproject.toml +0 -61
  63. pysimultan-0.3.3/requirements.txt +0 -14
  64. pysimultan-0.3.3/setup.cfg +0 -9
  65. pysimultan-0.3.3/setup.py +0 -55
  66. pysimultan-0.3.3/src/PySimultan.egg-info/PKG-INFO +0 -44
  67. pysimultan-0.3.3/src/PySimultan.egg-info/SOURCES.txt +0 -109
  68. pysimultan-0.3.3/src/PySimultan.egg-info/dependency_links.txt +0 -1
  69. pysimultan-0.3.3/src/PySimultan.egg-info/not-zip-safe +0 -1
  70. pysimultan-0.3.3/src/PySimultan.egg-info/requires.txt +0 -8
  71. pysimultan-0.3.3/src/PySimultan.egg-info/top_level.txt +0 -2
  72. pysimultan-0.3.3/src/PySimultan2/__init__.py +0 -38
  73. pysimultan-0.3.3/src/PySimultan2/config.py +0 -52
  74. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/geometry/__init__.py +0 -0
  75. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/multi_values.py +0 -0
  76. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/AssimpNet.dll +0 -0
  77. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/AvalonDock.dll +0 -0
  78. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/BruTile.dll +0 -0
  79. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/ClosedXML.dll +0 -0
  80. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/ComponentBuilder.dll +0 -0
  81. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/ComponentBuilder.dll.config +0 -0
  82. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/ComponentBuilder.runtimeconfig.json +0 -0
  83. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/ComponentBuilder.xml +0 -0
  84. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/ControlzEx.dll +0 -0
  85. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/Cyotek.Drawing.BitmapFont.dll +0 -0
  86. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/DocumentFormat.OpenXml.dll +0 -0
  87. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/DotSpatial.Projections.dll +0 -0
  88. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/ExcelNumberFormat.dll +0 -0
  89. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/Fluent.dll +0 -0
  90. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/GeometryViewer.dll +0 -0
  91. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/GeometryViewer.dll.config +0 -0
  92. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/GeometryViewer.xml +0 -0
  93. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/HelixToolkit.Core.Wpf.dll +0 -0
  94. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/HelixToolkit.SharpDX.Core.Wpf.dll +0 -0
  95. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/HelixToolkit.SharpDX.Core.dll +0 -0
  96. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/HelixToolkit.dll +0 -0
  97. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/MathNet.Numerics.dll +0 -0
  98. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/Microsoft.AspNetCore.Authorization.dll +0 -0
  99. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/Microsoft.AspNetCore.Metadata.dll +0 -0
  100. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/Microsoft.Extensions.DependencyInjection.Abstractions.dll +0 -0
  101. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/Microsoft.Extensions.Logging.Abstractions.dll +0 -0
  102. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/Microsoft.Extensions.Options.dll +0 -0
  103. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/Microsoft.Extensions.Primitives.dll +0 -0
  104. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/Microsoft.WindowsAPICodePack.Shell.dll +0 -0
  105. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/Microsoft.WindowsAPICodePack.dll +0 -0
  106. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/Microsoft.Xaml.Behaviors.dll +0 -0
  107. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/Newtonsoft.Json.Bson.dll +0 -0
  108. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/Newtonsoft.Json.dll +0 -0
  109. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/SIMULTAN.AutoUpdate.Client.dll +0 -0
  110. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/SIMULTAN.AutoUpdate.Client.dll.config +0 -0
  111. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/SIMULTAN.AutoUpdate.DataTransferLibrary.dll +0 -0
  112. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/SIMULTAN.AutoUpdate.DataTransferLibrary.dll.config +0 -0
  113. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/SIMULTAN.Lang.dll +0 -0
  114. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/SIMULTAN.Lang.xml +0 -0
  115. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/SIMULTAN.Plugins.dll +0 -0
  116. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/SIMULTAN.Plugins.xml +0 -0
  117. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/SIMULTAN.UI.dll +0 -0
  118. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/SIMULTAN.UI.xml +0 -0
  119. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/SIMULTAN.dll +0 -0
  120. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/SIMULTAN.xml +0 -0
  121. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/SharpDX.D3DCompiler.dll +0 -0
  122. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/SharpDX.DXGI.dll +0 -0
  123. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/SharpDX.Direct2D1.dll +0 -0
  124. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/SharpDX.Direct3D11.dll +0 -0
  125. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/SharpDX.Direct3D9.dll +0 -0
  126. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/SharpDX.Mathematics.dll +0 -0
  127. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/SharpDX.dll +0 -0
  128. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/SitePlanner.dll +0 -0
  129. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/SitePlanner.dll.config +0 -0
  130. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/SitePlanner.xml +0 -0
  131. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/Sprache.Calc.dll +0 -0
  132. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/Sprache.dll +0 -0
  133. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/System.Data.OleDb.dll +0 -0
  134. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/System.Net.Http.Formatting.dll +0 -0
  135. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/XAMLMarkupExtensions.dll +0 -0
  136. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/__init__.py +0 -0
  137. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/assimp.dll +0 -0
  138. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/defaultsettings.xml +0 -0
  139. {pysimultan-0.3.3 → pysimultan-0.4.1}/src/PySimultan2/resources/setup.bat +0 -0
  140. /pysimultan-0.3.3/tests/test_calc_static_zone_temperature.py → /pysimultan-0.4.1/tests/__init__.py +0 -0
  141. {pysimultan-0.3.3 → pysimultan-0.4.1}/tests/test_files.py +0 -0
  142. {pysimultan-0.3.3 → pysimultan-0.4.1}/tests/test_new_dll.py +0 -0
  143. {pysimultan-0.3.3 → pysimultan-0.4.1}/tests/test_new_project_creation.py +0 -0
  144. {pysimultan-0.3.3 → pysimultan-0.4.1}/tests/test_numeric_map.py +0 -0
  145. {pysimultan-0.3.3 → pysimultan-0.4.1}/tests/test_pythonnet.py +0 -0
  146. {pysimultan-0.3.3 → pysimultan-0.4.1}/tests/test_set_attr_property.py +0 -0
  147. {pysimultan-0.3.3 → pysimultan-0.4.1}/tests/test_set_dictionary.py +0 -0
  148. {pysimultan-0.3.3 → pysimultan-0.4.1}/tests/test_set_properties.py +0 -0
  149. {pysimultan-0.3.3 → pysimultan-0.4.1}/tests/test_taxonomie_maps.py +0 -0
  150. {pysimultan-0.3.3 → pysimultan-0.4.1}/tests/test_taxonomies.py +0 -0
@@ -0,0 +1,27 @@
1
+ *.egg-info
2
+ .tox
3
+ .idea
4
+ __pycache__
5
+ .coverage
6
+ .coverage.*
7
+ htmlcov
8
+ *.pyc
9
+ docs/_build
10
+ venv
11
+ dist
12
+ .pytest_cache
13
+ .mypy_cache
14
+ build
15
+ *.codxf
16
+ *.grdxf
17
+ ~*.simultan
18
+ *.simultanbackup
19
+ simultan_exception*
20
+ /PySimultan2/tests/resources/~*
21
+ /tests/resources/*.codxf
22
+ /PySimultan2/tests/readme_examples/resources/~*
23
+ /tests/readme_examples/resources/*.codxf
24
+
25
+ *.AppImage
26
+
27
+ storage-user*
@@ -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.
@@ -0,0 +1,50 @@
1
+ Metadata-Version: 2.3
2
+ Name: PySimultan
3
+ Version: 0.4.1
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.
@@ -0,0 +1,21 @@
1
+ # pysimultan_api
2
+
3
+ [![PyPI - Version](https://img.shields.io/pypi/v/pysimultan-api.svg)](https://pypi.org/project/pysimultan-api)
4
+ [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pysimultan-api.svg)](https://pypi.org/project/pysimultan-api)
5
+
6
+ -----
7
+
8
+ ## Table of Contents
9
+
10
+ - [Installation](#installation)
11
+ - [License](#license)
12
+
13
+ ## Installation
14
+
15
+ ```console
16
+ pip install pysimultan-api
17
+ ```
18
+
19
+ ## License
20
+
21
+ `pysimultan-api` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
@@ -0,0 +1,72 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "PySimultan"
7
+ dynamic = ["version"]
8
+ description = ''
9
+ readme = "README.md"
10
+ requires-python = ">=3.8"
11
+ license = "MIT"
12
+ keywords = []
13
+ authors = [
14
+ { name = "Bühler Maximilian", email = "maximilian.buehler@tuwien.ac.at" },
15
+ ]
16
+ classifiers = [
17
+ "Development Status :: 4 - Beta",
18
+ "Programming Language :: Python",
19
+ "Programming Language :: Python :: 3.8",
20
+ "Programming Language :: Python :: 3.9",
21
+ "Programming Language :: Python :: 3.10",
22
+ "Programming Language :: Python :: 3.11",
23
+ "Programming Language :: Python :: 3.12",
24
+ "Programming Language :: Python :: Implementation :: CPython",
25
+ "Programming Language :: Python :: Implementation :: PyPy",
26
+ ]
27
+ dependencies = ['six',
28
+ 'numpy',
29
+ 'pythonnet',
30
+ 'colorlog',
31
+ 'ruamel.yaml',
32
+ 'tqdm',
33
+ 'pandas',
34
+ 'pyarrow',]
35
+
36
+ [project.urls]
37
+ Documentation = "https://github.com/Bühler Maximilian/PySimultan2#readme"
38
+ Issues = "https://github.com/Bühler Maximilian/PySimultan2/issues"
39
+ Source = "https://github.com/Bühler Maximilian/PySimultan2"
40
+
41
+ [tool.hatch.version]
42
+ path = "src/PySimultan2/__about__.py"
43
+
44
+ [tool.hatch.envs.types]
45
+ extra-dependencies = [
46
+ "mypy>=1.0.0",
47
+ ]
48
+ [tool.hatch.envs.types.scripts]
49
+ check = "mypy --install-types --non-interactive {args:src/PySimultan2 tests}"
50
+
51
+ [tool.hatch.build.targets.wheel]
52
+ packages = ["src/PySimultan2"]
53
+
54
+
55
+ [tool.coverage.run]
56
+ source_pkgs = ["PySimultan2", "tests"]
57
+ branch = true
58
+ parallel = true
59
+ omit = [
60
+ "src/PySimultan2/__about__.py",
61
+ ]
62
+
63
+ [tool.coverage.paths]
64
+ PySimultan2 = ["src/PySimultan2", "*/PySimultan2/src/PySimultan2"]
65
+ tests = ["tests", "*/PySimultan2/tests"]
66
+
67
+ [tool.coverage.report]
68
+ exclude_lines = [
69
+ "no cov",
70
+ "if __name__ == .__main__.:",
71
+ "if TYPE_CHECKING:",
72
+ ]
@@ -0,0 +1 @@
1
+ version = '0.4.1'
@@ -0,0 +1,99 @@
1
+ import os
2
+ import sys
3
+ import colorlog
4
+ # from .config import *
5
+ from ruamel.yaml import YAML, yaml_object, add_representer
6
+
7
+ def setup_logging():
8
+ handler = colorlog.StreamHandler()
9
+ formatter = colorlog.ColoredFormatter(
10
+ "%(log_color)s%(levelname)-8s%(reset)s %(blue)s%(message)s",
11
+ datefmt=None,
12
+ reset=True,
13
+ log_colors={
14
+ 'DEBUG': 'cyan',
15
+ 'INFO': 'green',
16
+ 'WARNING': 'yellow',
17
+ 'ERROR': 'red',
18
+ 'CRITICAL': 'red,bg_white',
19
+ },
20
+ secondary_log_colors={},
21
+ style='%'
22
+ )
23
+
24
+ handler.setFormatter(formatter)
25
+
26
+ logger = colorlog.getLogger('PySimultan')
27
+ logger.addHandler(handler)
28
+
29
+ return logger
30
+
31
+
32
+ def setup():
33
+ import colorlog
34
+ try:
35
+ import importlib.resources as pkg_resources
36
+ except ImportError:
37
+ # Try backported to PY<37 importlib_resources.
38
+ import importlib_resources as pkg_resources
39
+
40
+ from . import resources
41
+ sys.path.append(str(pkg_resources.files(resources)))
42
+
43
+ logger = colorlog.getLogger('PySimultan')
44
+ logger.setLevel('DEBUG')
45
+
46
+ dll_path = os.environ.get('SIMULTAN_SDK_DIR', None)
47
+ if dll_path is None:
48
+ with pkg_resources.path(resources, 'SIMULTAN.dll') as r_path:
49
+ dll_path = str(r_path)
50
+ sys.path.append(dll_path)
51
+
52
+ from pythonnet import load
53
+ from pythonnet import clr_loader, set_runtime
54
+ list(clr_loader.find_runtimes())
55
+ load('coreclr')
56
+ import clr
57
+ test = clr.AddReference(
58
+ os.path.join(dll_path, 'SIMULTAN.dll') if not dll_path.endswith('SIMULTAN.dll') else dll_path)
59
+ clr.AddReference("System.Security.Cryptography")
60
+ # clr.AddReference(os.path.join(dll_path, 'SIMULTAN'))
61
+
62
+ from SIMULTAN.Data.Components import SimComponent
63
+
64
+ continue_on_error = True
65
+
66
+ def represent_none(self, _):
67
+ return self.represent_scalar('tag:yaml.org,2002:null', '')
68
+
69
+ add_representer(type(None), represent_none)
70
+ yaml = YAML()
71
+ yaml.default_flow_style = None
72
+ yaml.preserve_quotes = True
73
+ yaml.allow_unicode = True
74
+
75
+ return yaml
76
+
77
+
78
+ logger = setup_logging()
79
+ yaml = setup()
80
+
81
+
82
+ class Config:
83
+ def __init__(self):
84
+ self._default_data_model = None
85
+ self._default_mapper = None
86
+ self.logger = logger
87
+
88
+ def get_default_data_model(self, *args, **kwargs):
89
+ return self._default_data_model
90
+
91
+ def get_default_mapper(self, *args, **kwargs):
92
+ return self._default_mapper
93
+
94
+
95
+ config = Config()
96
+
97
+ from .data_model import DataModel
98
+ from .files import FileInfo
99
+ from .object_mapper import PythonMapper
@@ -3,7 +3,6 @@ import os
3
3
  import shutil
4
4
  from uuid import uuid4
5
5
  from colorlog import getLogger
6
- from functools import lru_cache, reduce
7
6
  from weakref import WeakSet, WeakValueDictionary
8
7
  from . import config
9
8
  from .utils import *
@@ -46,6 +45,7 @@ from .files import add_tag_to_resource
46
45
 
47
46
  if TYPE_CHECKING:
48
47
  from .object_mapper import PythonMapper
48
+ from .geometry import GeometryModel
49
49
 
50
50
 
51
51
  logger = getLogger('PySimultan')
@@ -114,7 +114,7 @@ class DataModel:
114
114
  else:
115
115
  print("Failed to create project")
116
116
 
117
- return cls(project_path=project_path, user_name=user_name, password=password)
117
+ return cls(project_path=project_path, user_name=user_name, password=password, project_data_manager=projectData)
118
118
 
119
119
  def __new__(cls, *args, **kwargs):
120
120
 
@@ -147,6 +147,8 @@ class DataModel:
147
147
  self._project = None
148
148
  self._zip_loader = None
149
149
 
150
+ self.project_data_manager = kwargs.get('project_data_manager', None)
151
+
150
152
  self.project_path = kwargs.get('project_path', None)
151
153
 
152
154
  self.service_provider = Utils.ServicesProvider()
@@ -156,38 +158,10 @@ class DataModel:
156
158
  self.i_aut_service.password = self.password
157
159
 
158
160
  self.service_provider.AddService[SimultanUsers.IAuthenticationService](self.i_aut_service())
159
-
160
- # self.serv = GeometryViewerService([], self.service_provider)
161
- # self.service_provider.AddService[IGeometryViewerService](self.serv)
162
-
163
161
  self.exch = self.project.AllProjectDataManagers.ComponentGeometryExchange
164
162
  # self.exch.ModelStore = self.serv
165
163
 
166
164
  self.resources = {}
167
- # self.models_dict = {}
168
- #
169
- # if self.project_data_manager.AssetManager.Resources.__len__() > 0:
170
- # for resource in self.project_data_manager.AssetManager.Resources:
171
- # if resource is None:
172
- # continue
173
- # self.resources[resource.Key] = resource
174
- # self.models_dict[resource.Key] = None
175
- # current_full_path = resource.CurrentFullPath
176
- # if current_full_path == '?':
177
- # continue
178
- #
179
- # if resource.Extension == '.simgeo':
180
- # error_list = NetList[SimGeoIOError]()
181
- #
182
- # model = SimGeoIO.Load(resource, self.project_data_manager, error_list, OffsetAlgorithm.Full)
183
- # self.models_dict[resource.Key] = model
184
- # try:
185
- # self.project_data_manager.GeometryModels.AddGeometryModel(model)
186
- # except Exception as e:
187
- # logger.warning(f'Error while loading Model: {model} from {model.File}: {e}. Trying reload...')
188
- # raise e
189
-
190
- self.ValueFields = self.project_data_manager.ValueManager.Items
191
165
  self.import_data_model()
192
166
 
193
167
  self.__mongo_instance = None
@@ -197,40 +171,41 @@ class DataModel:
197
171
  return self.project_data_manager.AssetManager.Resources
198
172
 
199
173
  @property
200
- def _mongo_instance(self):
201
- if self.__mongo_instance is None:
202
- self.create_mongo_instance()
203
- return self.__mongo_instance
174
+ def models(self) -> dict[int, 'GeometryModel']:
175
+ """
176
+ Return the geometry models of the project
177
+ :return: dict[int, GeometryModel]
178
+ """
204
179
 
205
- @_mongo_instance.setter
206
- def _mongo_instance(self, value):
207
- self.__mongo_instance = value
180
+ # if self.models_dict:
181
+ # return self.models_dict
208
182
 
209
- @property
210
- def models(self):
211
183
  self.models_dict = {}
212
184
 
213
- if self.project_data_manager.AssetManager.Resources.__len__() > 0:
214
- for resource in self.project_data_manager.AssetManager.Resources:
215
- if resource is None:
216
- continue
217
- self.resources[resource.Key] = resource
185
+ # self.project_data_manager.Reset()
186
+
187
+ resources = self.project_data_manager.AssetManager.Resources
188
+
189
+ for resource in resources:
190
+ if resource is None:
191
+ continue
192
+ self.resources[resource.Key] = resource
218
193
 
219
- current_full_path = resource.CurrentFullPath
220
- if current_full_path == '?':
221
- continue
194
+ current_full_path = resource.CurrentFullPath
195
+ if current_full_path == '?':
196
+ continue
222
197
 
223
- if resource.Extension == '.simgeo':
224
- self.models_dict[resource.Key] = None
225
- error_list = NetList[SimGeoIOError]()
198
+ if resource.Extension == '.simgeo':
199
+ self.models_dict[resource.Key] = None
200
+ error_list = NetList[SimGeoIOError]()
226
201
 
227
- model = SimGeoIO.Load(resource, self.project_data_manager, error_list, OffsetAlgorithm.Full)
228
- self.models_dict[resource.Key] = model
229
- try:
230
- self.project_data_manager.GeometryModels.AddGeometryModel(model)
231
- except Exception as e:
232
- logger.warning(f'Error while loading Model: {model} from {model.File}: {e}. Trying reload...')
233
- raise e
202
+ model = SimGeoIO.Load(resource, self.project_data_manager, error_list, OffsetAlgorithm.Full)
203
+ self.models_dict[resource.Key] = model
204
+ try:
205
+ self.project_data_manager.GeometryModels.AddGeometryModel(model)
206
+ except Exception as e:
207
+ logger.warning(f'Error while loading Model: {model} from {model.File}: {e}')
208
+ raise e
234
209
 
235
210
  return self.models_dict
236
211
 
@@ -238,14 +213,20 @@ class DataModel:
238
213
  def taxonomies(self):
239
214
  return self.project_data_manager.Taxonomies
240
215
 
216
+ @property
217
+ def ValueFields(self):
218
+ return self.project_data_manager.ValueManager.Items
219
+
241
220
  @property
242
221
  def value_fields(self):
243
222
  return self.project_data_manager.ValueManager
244
223
 
245
224
  @property
246
225
  def project_data_manager(self):
247
- if (self._project_data_manager) is None and (self.user is not None):
226
+
227
+ if self._project_data_manager is None:
248
228
  self._project_data_manager = ExtendedProjectData()
229
+
249
230
  return self._project_data_manager
250
231
 
251
232
  @project_data_manager.setter
@@ -261,7 +242,6 @@ class DataModel:
261
242
  @user.setter
262
243
  def user(self, value: SimultanUsers.SimUserRole):
263
244
  if value != self._user:
264
- self.project_data_manager = None
265
245
  self._project = None
266
246
  self._user = value
267
247
 
@@ -306,7 +286,6 @@ class DataModel:
306
286
  def remove_field(self, field: SimMultiValueField3D):
307
287
  self.project_data_manager.ValueManager.Remove(field)
308
288
 
309
- @lru_cache(maxsize=None)
310
289
  def get_geo_instance(self, file_id, type, id):
311
290
  geo_model = self.models[file_id]
312
291
  objects = getattr(geo_model.Geometry, type)
@@ -381,16 +360,28 @@ class DataModel:
381
360
  """
382
361
  logger.info('closing project...')
383
362
  try:
363
+
384
364
  self._project.DisableProjectUnpackFolderWatcher()
385
365
  if self._project is not None:
366
+ if self._project.IsOpened:
367
+ ZipProjectIO.Close(self._project, True)
386
368
  if self._project.IsLoaded:
387
369
  ZipProjectIO.Unload(self._project)
388
- if self._project.IsOpened:
389
- ZipProjectIO.Close(self._project, False, True)
390
370
 
391
- self._project_data_manager.Reset()
392
371
  except Exception as e:
393
372
  pass
373
+ finally:
374
+ if self._project_data_manager is not None:
375
+ del self._project_data_manager
376
+ self._project_data_manager = None
377
+
378
+ data_models = WeakSet()
379
+ data_models_dict = WeakValueDictionary()
380
+
381
+ if config.default_data_model is self:
382
+ config.default_data_model = None
383
+
384
+ del self
394
385
 
395
386
  # def create_new_component(self):
396
387
  #
@@ -570,14 +561,13 @@ class DataModel:
570
561
  if isinstance(component, SimultanObject):
571
562
  component = component._wrapped_obj
572
563
 
573
- if not component.Instances:
574
- return []
575
-
576
564
  for instance in component.Instances:
577
565
  for placement in instance.Placements.Items:
578
566
  geo_model = next((x for x in self.models.values() if x is not None and x.File.Key == placement.FileId), None)
579
567
  if geo_model is not None:
580
568
  ref_geometries.append((geo_model.Geometry.GeometryFromId(placement.GeometryId), geo_model))
569
+ if geo_model is None:
570
+ logger.warning(f'Geometry model with id {placement.FileId} not found in project {self.project_path}')
581
571
 
582
572
  return ref_geometries
583
573
 
@@ -665,7 +655,6 @@ class DataModel:
665
655
  None)
666
656
  return model_to_work_with, resource_file
667
657
 
668
- @lru_cache(maxsize=None)
669
658
  def get_or_create_taxonomy(self, taxonomy_key: str, taxonomy_name: str = None, description='', create=True):
670
659
  taxonomy = next((x for x in self.taxonomies if x.Key == taxonomy_key), None)
671
660
  if taxonomy is None:
@@ -676,7 +665,6 @@ class DataModel:
676
665
 
677
666
  return next((x for x in self.taxonomies if x.Key == taxonomy_key), None)
678
667
 
679
- @lru_cache(maxsize=None)
680
668
  def get_or_create_taxonomy_entry(self,
681
669
  name: str,
682
670
  key: str,
@@ -113,7 +113,7 @@ class ComponentList(SimultanObject):
113
113
 
114
114
  try:
115
115
  indices = sort_slots(slots)
116
- return [self._object_mapper.create_python_object(x) for x in
116
+ return [self._object_mapper.create_python_object(x, data_model=self._data_model) for x in
117
117
  [all_components[i] for i in np.argsort(indices)]]
118
118
  except TypeError as e:
119
119
  logger.warning(f'Could not sort list {all_components}:\n{e}')
@@ -259,7 +259,7 @@ class ComponentList(SimultanObject):
259
259
  return f'List {self.name}: ' + repr(list(self.data))
260
260
 
261
261
  def __iter__(self):
262
- return iter([self._object_mapper.create_python_object(x) for x in self.data])
262
+ return iter([self._object_mapper.create_python_object(x, data_model=self._data_model) for x in self.data])
263
263
 
264
264
  def __next__(self):
265
265
  try:
@@ -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
 
@@ -18,7 +18,9 @@ from SIMULTAN.Data.Assets import ResourceEntry, ResourceFileEntry, ContainedReso
18
18
  from SIMULTAN.Data.Taxonomy import SimTaxonomyEntry, SimTaxonomyEntryReference, SimTaxonomy
19
19
  from SIMULTAN.Data.Components import SimComponent, ComponentMapping
20
20
 
21
- from .config import default_data_model
21
+ # from .config import default_data_model
22
+
23
+ from . import config
22
24
 
23
25
  from typing import TYPE_CHECKING
24
26
  if TYPE_CHECKING:
@@ -195,7 +197,7 @@ class FileInfo(object, metaclass=MetaMock):
195
197
  :return: FileInfo
196
198
  """
197
199
 
198
- data_model = kwargs.get('data_model', default_data_model)
200
+ data_model = kwargs.get('data_model', config.default_data_model)
199
201
  resource = create_asset_from_string(filename, content, *args, **kwargs)
200
202
 
201
203
  file_info = cls(resource_entry=resource,
@@ -239,7 +241,8 @@ class FileInfo(object, metaclass=MetaMock):
239
241
  def resource_entry(self) -> Union[ResourceFileEntry, ContainedResourceFileEntry, None]:
240
242
  if self._resource_entry is None:
241
243
  if self.data_model is None:
242
- self.data_model = default_data_model
244
+ logger.warning(f'No data model provided. Using default data model: {config.default_data_model.id}.')
245
+ self.data_model = config.default_data_model
243
246
  if self.data_model is not None:
244
247
  self.resource_entry = self.data_model.add_resource(self.file_path)
245
248
  return self._resource_entry
@@ -30,7 +30,7 @@ from SIMULTAN.Data.Geometry import VolumeAlgorithms
30
30
  # from ..utils import create_mapped_python_object, create_python_object
31
31
  # from ..files import create_asset_from_file, FileInfo, create_asset_from_string
32
32
  from .. import config
33
- from ..config import logger
33
+ from .. import logger
34
34
 
35
35
  from typing import TYPE_CHECKING
36
36
  if TYPE_CHECKING:
@@ -538,11 +538,12 @@ class GeometryModel(object, metaclass=MetaMock):
538
538
  def create_simultan_instance(cls, *args, **kwargs):
539
539
 
540
540
  data_model: DataModel = kwargs.get('data_model', config.default_data_model)
541
- name = kwargs.get('name', 'GeometryModel')
541
+ name: str = kwargs.get('name', 'GeometryModel')
542
542
 
543
543
  new_geo_model, resource = data_model.create_new_geometry_model(name=name)
544
544
  data_model.project_data_manager.GeometryModels.AddGeometryModel(new_geo_model)
545
545
  data_model.models_dict[resource.Key] = new_geo_model
546
+ data_model.save()
546
547
 
547
548
  return new_geo_model
548
549
 
@@ -57,7 +57,7 @@ def create_cube(data_model,
57
57
  scale: Optional[float] = 1):
58
58
 
59
59
  if obj_mapper is None:
60
- obj_mapper = config.default_mapper
60
+ obj_mapper = config.get_default_mapper()
61
61
 
62
62
  new_layer = obj_mapper.registered_geometry_classes[Layer](geometry_model=geo_model,
63
63
  data_model=data_model,