PySimultan 0.7.3__tar.gz → 0.7.5__tar.gz

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 (98) hide show
  1. {pysimultan-0.7.3 → pysimultan-0.7.5}/PKG-INFO +1 -1
  2. pysimultan-0.7.5/src/PySimultan2/__about__.py +1 -0
  3. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/__init__.py +5 -3
  4. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/multi_values.py +23 -1
  5. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/type_setter_lookup.py +3 -1
  6. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/utils.py +4 -2
  7. pysimultan-0.7.5/tests/resources/new_test_file_1.txt +1 -0
  8. pysimultan-0.7.5/tests/resources/new_test_file_2.txt +1 -0
  9. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/test_set_properties.py +7 -1
  10. pysimultan-0.7.3/src/PySimultan2/__about__.py +0 -1
  11. {pysimultan-0.7.3 → pysimultan-0.7.5}/.gitignore +0 -0
  12. {pysimultan-0.7.3 → pysimultan-0.7.5}/LICENSE.txt +0 -0
  13. {pysimultan-0.7.3 → pysimultan-0.7.5}/README.md +0 -0
  14. {pysimultan-0.7.3 → pysimultan-0.7.5}/pyproject.toml +0 -0
  15. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/CHANGELOG.md +0 -0
  16. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/data_model.py +0 -0
  17. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/default_types.py +0 -0
  18. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/files.py +0 -0
  19. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/geometry/__init__.py +0 -0
  20. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/geometry/geometry_base.py +0 -0
  21. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/geometry/utils.py +0 -0
  22. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/object_mapper.py +0 -0
  23. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/resources/ClosedXML.dll +0 -0
  24. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/resources/ControlzEx.dll +0 -0
  25. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/resources/DocumentFormat.OpenXml.dll +0 -0
  26. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/resources/DotSpatial.Projections.dll +0 -0
  27. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/resources/ExcelNumberFormat.dll +0 -0
  28. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/resources/Fluent.dll +0 -0
  29. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/resources/MathNet.Numerics.dll +0 -0
  30. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/resources/Microsoft.AspNetCore.Authorization.dll +0 -0
  31. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/resources/Microsoft.AspNetCore.Metadata.dll +0 -0
  32. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/resources/Microsoft.Extensions.DependencyInjection.Abstractions.dll +0 -0
  33. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/resources/Microsoft.Extensions.Logging.Abstractions.dll +0 -0
  34. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/resources/Microsoft.Extensions.Options.dll +0 -0
  35. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/resources/Microsoft.Extensions.Primitives.dll +0 -0
  36. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/resources/Microsoft.WindowsAPICodePack.Shell.dll +0 -0
  37. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/resources/Microsoft.WindowsAPICodePack.dll +0 -0
  38. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/resources/Microsoft.Xaml.Behaviors.dll +0 -0
  39. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/resources/Newtonsoft.Json.Bson.dll +0 -0
  40. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/resources/Newtonsoft.Json.dll +0 -0
  41. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/resources/SIMULTAN.Lang.dll +0 -0
  42. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/resources/SIMULTAN.Lang.xml +0 -0
  43. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/resources/SIMULTAN.Plugins.dll +0 -0
  44. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/resources/SIMULTAN.Plugins.xml +0 -0
  45. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/resources/SIMULTAN.dll +0 -0
  46. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/resources/SIMULTAN.xml +0 -0
  47. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/resources/SharpDX.Mathematics.dll +0 -0
  48. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/resources/Sprache.Calc.dll +0 -0
  49. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/resources/Sprache.dll +0 -0
  50. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/resources/System.Data.OleDb.dll +0 -0
  51. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/resources/System.Net.Http.Formatting.dll +0 -0
  52. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/resources/System.Reflection.MetadataLoadContext.dll +0 -0
  53. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/resources/__init__.py +0 -0
  54. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/simultan_object.py +0 -0
  55. {pysimultan-0.7.3 → pysimultan-0.7.5}/src/PySimultan2/taxonomy_maps.py +0 -0
  56. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/RoomAcoustics_V02.py +0 -0
  57. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/__init__.py +0 -0
  58. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/readme_examples/__init__.py +0 -0
  59. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/readme_examples/create_component.py +0 -0
  60. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/readme_examples/create_component_with_taxonomy_slot.py +0 -0
  61. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/readme_examples/create_referenced_component.py +0 -0
  62. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/readme_examples/create_taxonomies.py +0 -0
  63. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/readme_examples/resources/__init__.py +0 -0
  64. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/readme_examples/resources/empty_test_excel.xlsx +0 -0
  65. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/readme_examples/resources/template_example3.yml +0 -0
  66. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/readme_examples/resources/template_example4.yml +0 -0
  67. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/readme_examples/resources/template_example_create_typed_component.yml +0 -0
  68. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/readme_examples/resources/template_example_create_typed_component_with_slots.yml +0 -0
  69. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/readme_examples/resources/template_example_extend.yml +0 -0
  70. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/readme_examples/resources/template_example_update_references.yml +0 -0
  71. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/readme_examples/resources/template_reference_list.yml +0 -0
  72. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/resources/__init__.py +0 -0
  73. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/resources/new_test_file.txt +0 -0
  74. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/resources/new_test_file2.txt +0 -0
  75. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/test_calc_static_zone_temperature.py +0 -0
  76. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/test_calculate_steady_state_temperature.py +0 -0
  77. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/test_circular_references.py +0 -0
  78. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/test_create_geometry.py +0 -0
  79. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/test_default_component.py +0 -0
  80. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/test_directory_and_files.py +0 -0
  81. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/test_files.py +0 -0
  82. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/test_files_load.py +0 -0
  83. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/test_load_geometry.py +0 -0
  84. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/test_load_multi_values.py +0 -0
  85. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/test_new_dll.py +0 -0
  86. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/test_new_project_creation.py +0 -0
  87. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/test_numeric_map.py +0 -0
  88. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/test_numpy.py +0 -0
  89. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/test_parameter_reference.py +0 -0
  90. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/test_pythonnet.py +0 -0
  91. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/test_register_class.py +0 -0
  92. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/test_register_decorator.py +0 -0
  93. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/test_set_attr_property.py +0 -0
  94. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/test_set_dictionary.py +0 -0
  95. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/test_taxonomie_maps.py +0 -0
  96. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/test_taxonomies.py +0 -0
  97. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/test_ui.py +0 -0
  98. {pysimultan-0.7.3 → pysimultan-0.7.5}/tests/ui_minimal_example.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PySimultan
3
- Version: 0.7.3
3
+ Version: 0.7.5
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
@@ -0,0 +1 @@
1
+ version = '0.7.5'
@@ -48,7 +48,6 @@ def setup():
48
48
  logger.setLevel('DEBUG')
49
49
 
50
50
  dll_path = os.environ.get('SIMULTAN_SDK_DIR', None)
51
- dll_path = None
52
51
  if dll_path is None:
53
52
  with pkg_resources.path(resources, 'SIMULTAN.dll') as r_path:
54
53
  dll_path = str(r_path)
@@ -59,8 +58,11 @@ def setup():
59
58
  list(clr_loader.find_runtimes())
60
59
  load('coreclr')
61
60
  import clr
62
- test = clr.AddReference(
63
- os.path.join(dll_path, 'SIMULTAN.dll') if not dll_path.endswith('SIMULTAN.dll') else dll_path)
61
+ try:
62
+ clr.AddReference('SIMULTAN')
63
+ except Exception as e:
64
+ test = clr.AddReference(
65
+ os.path.join(dll_path, 'SIMULTAN.dll') if not dll_path.endswith('SIMULTAN.dll') else dll_path)
64
66
  clr.AddReference("System.Security.Cryptography")
65
67
  # clr.AddReference(os.path.join(dll_path, 'SIMULTAN'))
66
68
 
@@ -16,6 +16,18 @@ from pandas import DataFrame
16
16
  import System
17
17
 
18
18
 
19
+ class SimultanPandasDataFrame(pd.DataFrame):
20
+ # temporary properties
21
+
22
+ # normal properties
23
+ _metadata = ["SimultanField"]
24
+
25
+ @property
26
+ def _constructor(self):
27
+ return SimultanPandasDataFrame
28
+
29
+
30
+
19
31
  def numpy_to_simultan_multi_value_field_3d(array: np.ndarray,
20
32
  name: str = 'UnnamedField',
21
33
  x_axis: list = None,
@@ -124,7 +136,8 @@ def simultan_multi_value_big_table_to_pandas(field: SimMultiValueBigTable) -> pd
124
136
  for i in range(field.RowHeaders.Count):
125
137
  data[i, :] = list(field.GetRow(i))
126
138
 
127
- df = pd.DataFrame(data, columns=[x.Name for x in field.ColumnHeaders], index=[x.Name for x in field.RowHeaders])
139
+ df = SimultanPandasDataFrame(data, columns=[x.Name for x in field.ColumnHeaders], index=[x.Name for x in field.RowHeaders])
140
+ df.SimultanField = {'id': field.Id, 'name': field.Name}
128
141
 
129
142
  return df
130
143
 
@@ -224,8 +237,16 @@ def set_parameter_to_value_field(parameter: SimDoubleParameter,
224
237
  #
225
238
  # source = SimMultiValueField3DParameterSource(value_field, x_ax_val, y_ax_val, z_ax_val)
226
239
  source = default_value_source(value_field, x_ax_val, y_ax_val, z_ax_val)
240
+ elif isinstance(value, SimultanPandasDataFrame):
241
+ field = next(x for x in data_model.value_fields if x.Id.Equals(value.SimultanField['id'])) # check if field is in data model
242
+ value_field = pandas_to_simultan_multi_value_big_table(value,
243
+ name=field_name if field_name is not None else str(
244
+ parameter.Id) + '_field')
245
+ field.ReplaceData(value_field)
246
+ source = SimMultiValueBigTableParameterSource(field, 0, 0)
227
247
 
228
248
  elif isinstance(value, pd.DataFrame):
249
+ value.__class__ = SimultanPandasDataFrame # change class to add temporary properties
229
250
  value_field = pandas_to_simultan_multi_value_big_table(value,
230
251
  name=field_name if field_name is not None else str(
231
252
  parameter.Id) + '_field')
@@ -233,6 +254,7 @@ def set_parameter_to_value_field(parameter: SimDoubleParameter,
233
254
  data_model.add_field(value_field)
234
255
 
235
256
  source = SimMultiValueBigTableParameterSource(value_field, 0, 0)
257
+ value.SimultanField = {'id': value_field.Id, 'name': value_field.Name}
236
258
 
237
259
  else:
238
260
  raise ValueError('The value of the field parameter must be a numpy array or a DataFrame.')
@@ -12,6 +12,7 @@ from .utils import (SimComponent, SimDoubleParameter, SimIntegerParameter, SimSt
12
12
  from .simultan_object import SimultanObject, MetaMock
13
13
 
14
14
  from .default_types import ComponentList, ComponentDictionary
15
+ from .multi_values import SimultanPandasDataFrame
15
16
 
16
17
  from SIMULTAN.Data.Components import (ComponentWalker, SimComponent, SimBoolParameter, SimDoubleParameter,
17
18
  SimEnumParameter, SimIntegerParameter, SimStringParameter, ComponentMapping,
@@ -50,7 +51,8 @@ class TypeSetterFcnLookupDict(object):
50
51
  ComponentDictionary: set_property_to_sim_component,
51
52
  ComponentList: set_property_to_list,
52
53
  np.ndarray: set_property_to_value_field,
53
- pd.DataFrame: set_property_to_value_field}
54
+ pd.DataFrame: set_property_to_value_field,
55
+ SimultanPandasDataFrame: set_property_to_value_field}
54
56
 
55
57
  def __getitem__(self, item: type):
56
58
  bases = [item, *inspect.getmro(type(item))]
@@ -27,7 +27,7 @@ from SIMULTAN.Data.Assets import (ResourceEntry, ResourceFileEntry, ContainedRes
27
27
  from SIMULTAN.Data.Geometry import Face, Edge, Vertex, Volume
28
28
 
29
29
  from .multi_values import (simultan_multi_value_field_3d_to_numpy, set_parameter_to_value_field,
30
- create_field_parameter, simultan_multi_value_big_table_to_pandas)
30
+ create_field_parameter, simultan_multi_value_big_table_to_pandas, SimultanPandasDataFrame)
31
31
  from .files import FileInfo, remove_asset_from_component, add_asset_to_component, DirectoryInfo
32
32
 
33
33
  if TYPE_CHECKING:
@@ -1442,9 +1442,11 @@ def add_properties(prop_name: str,
1442
1442
  def getx(self):
1443
1443
 
1444
1444
  cache_value = self.__property_cache__.get(content.text_or_key, Empty)
1445
+ if isinstance(cache_value, SimultanPandasDataFrame):
1446
+ cache_value = Empty
1445
1447
 
1446
1448
  if cache_value is not Empty:
1447
- return self.__property_cache__[content.text_or_key]
1449
+ return cache_value
1448
1450
 
1449
1451
  val = get_property(component=self,
1450
1452
  text_or_key=content.text_or_key,
@@ -0,0 +1 @@
1
+ This is the content of the file 1.
@@ -0,0 +1 @@
1
+ This is the content of the file 2.
@@ -121,6 +121,12 @@ def test_set_value_field(test_component):
121
121
  test_component.mapped_property = df
122
122
  assert np.array_equal(test_component.mapped_property.values, df.values)
123
123
 
124
+ df['A'] = df['A'] * 2
125
+
126
+ test_component.value2 = df
127
+ assert np.array_equal(test_component.value2.values, df.values)
128
+ assert np.array_equal(test_component.mapped_property.values, df.values)
129
+
124
130
 
125
131
  def set_referenced_component(test_component):
126
132
  referenced_component = mapped_cls_2(name='referenced_component',
@@ -152,7 +158,7 @@ if __name__ == '__main__':
152
158
  test_set_set_file(component)
153
159
  test_set_value_field(component)
154
160
  set_referenced_component(component)
155
- set_new_component(component)
161
+ # set_new_component(component)
156
162
  data_model.save()
157
163
 
158
164
  data_model.cleanup()
@@ -1 +0,0 @@
1
- version = '0.7.3'
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes