PySimultan 0.7.3__py3-none-any.whl → 0.7.4__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.
- PySimultan2/__about__.py +1 -1
 - PySimultan2/multi_values.py +23 -1
 - PySimultan2/type_setter_lookup.py +3 -1
 - PySimultan2/utils.py +4 -2
 - {pysimultan-0.7.3.dist-info → pysimultan-0.7.4.dist-info}/METADATA +1 -1
 - {pysimultan-0.7.3.dist-info → pysimultan-0.7.4.dist-info}/RECORD +8 -8
 - {pysimultan-0.7.3.dist-info → pysimultan-0.7.4.dist-info}/WHEEL +0 -0
 - {pysimultan-0.7.3.dist-info → pysimultan-0.7.4.dist-info}/licenses/LICENSE.txt +0 -0
 
    
        PySimultan2/__about__.py
    CHANGED
    
    | 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            version = '0.7. 
     | 
| 
      
 1 
     | 
    
         
            +
            version = '0.7.4'
         
     | 
    
        PySimultan2/multi_values.py
    CHANGED
    
    | 
         @@ -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 =  
     | 
| 
      
 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))]
         
     | 
    
        PySimultan2/utils.py
    CHANGED
    
    | 
         @@ -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  
     | 
| 
      
 1449 
     | 
    
         
            +
                        return cache_value
         
     | 
| 
       1448 
1450 
     | 
    
         | 
| 
       1449 
1451 
     | 
    
         
             
                    val = get_property(component=self,
         
     | 
| 
       1450 
1452 
     | 
    
         
             
                                       text_or_key=content.text_or_key,
         
     | 
| 
         @@ -1,6 +1,6 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            Metadata-Version: 2.4
         
     | 
| 
       2 
2 
     | 
    
         
             
            Name: PySimultan
         
     | 
| 
       3 
     | 
    
         
            -
            Version: 0.7. 
     | 
| 
      
 3 
     | 
    
         
            +
            Version: 0.7.4
         
     | 
| 
       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
         
     | 
| 
         @@ -1,15 +1,15 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            PySimultan2/CHANGELOG.md,sha256=sFTVr_AgFyqf4HPmShaAHKaHcT5A3MjL2s2VVzEdoyM,1340
         
     | 
| 
       2 
     | 
    
         
            -
            PySimultan2/__about__.py,sha256= 
     | 
| 
      
 2 
     | 
    
         
            +
            PySimultan2/__about__.py,sha256=gcBTRNxROmZTpPihDWN7cepd2Ky4poAu-P0K56b6scA,19
         
     | 
| 
       3 
3 
     | 
    
         
             
            PySimultan2/__init__.py,sha256=PGVR1uhY01dF5tHyad-znURUZ_LVB95vsjId2BT0aJM,3245
         
     | 
| 
       4 
4 
     | 
    
         
             
            PySimultan2/data_model.py,sha256=3KX3cjsEB-9G-FzRVd0Zo1FpoAgR8cFOCo-drPoXJKg,45894
         
     | 
| 
       5 
5 
     | 
    
         
             
            PySimultan2/default_types.py,sha256=NnBgf16CElEAWH7tA0qLKqFHZ4_YS00HAJpKHG1CmjQ,30581
         
     | 
| 
       6 
6 
     | 
    
         
             
            PySimultan2/files.py,sha256=8JCWtUPS89POsPrmn_kCrHzmiBsLb1iWhw-A9qQLcR8,34716
         
     | 
| 
       7 
     | 
    
         
            -
            PySimultan2/multi_values.py,sha256= 
     | 
| 
      
 7 
     | 
    
         
            +
            PySimultan2/multi_values.py,sha256=gx46mYc_foSVJkesNkNHFGSA95aM1Z3ypgjhzNfPWHs,16687
         
     | 
| 
       8 
8 
     | 
    
         
             
            PySimultan2/object_mapper.py,sha256=0qiVEjn6q24u2_YZGOyD4ESXZ-0tfJjGjSowT8wa2wM,20568
         
     | 
| 
       9 
9 
     | 
    
         
             
            PySimultan2/simultan_object.py,sha256=-3dTlkyoVdrXmSZgozz7fTHJnaxN63utYPXOXTCuEOY,20837
         
     | 
| 
       10 
10 
     | 
    
         
             
            PySimultan2/taxonomy_maps.py,sha256=hhgXhRXIPTD2briG_yYZssJ9musOnzs0LC4e8e78e40,10323
         
     | 
| 
       11 
     | 
    
         
            -
            PySimultan2/type_setter_lookup.py,sha256= 
     | 
| 
       12 
     | 
    
         
            -
            PySimultan2/utils.py,sha256= 
     | 
| 
      
 11 
     | 
    
         
            +
            PySimultan2/type_setter_lookup.py,sha256=QtepnP-FigxGv53_dB70hLSFewEidZS1KrUpW7ZIrQI,3873
         
     | 
| 
      
 12 
     | 
    
         
            +
            PySimultan2/utils.py,sha256=1k8IoAHJVsXDZPrqlmEkCfszsqSTN4yh3-CqELP5KmY,67202
         
     | 
| 
       13 
13 
     | 
    
         
             
            PySimultan2/geometry/__init__.py,sha256=nJolTD1i5J8qUkOQa-r3D20aq3Co3sN31Xc0n4wJpJo,248
         
     | 
| 
       14 
14 
     | 
    
         
             
            PySimultan2/geometry/geometry_base.py,sha256=TwABfQEsqxAIGLqwvqVXEV-GA5sYGBJSJm7e58QmNzM,24015
         
     | 
| 
       15 
15 
     | 
    
         
             
            PySimultan2/geometry/utils.py,sha256=J25YsK8sso_UL7xRusItQZvyjtvxdOsSPelBQYFABhY,8519
         
     | 
| 
         @@ -44,7 +44,7 @@ PySimultan2/resources/System.Data.OleDb.dll,sha256=-AAzdmyo01QNgD9qnUIewEImplJFV 
     | 
|
| 
       44 
44 
     | 
    
         
             
            PySimultan2/resources/System.Net.Http.Formatting.dll,sha256=xQBIin4YpqDObdqwau_5dr8XQEq54hlxV4gBgNtUqbc,179672
         
     | 
| 
       45 
45 
     | 
    
         
             
            PySimultan2/resources/System.Reflection.MetadataLoadContext.dll,sha256=P4PBRwAGWL27sNc754Wd28t_koJKBFYJ2FyolrD1xo0,242296
         
     | 
| 
       46 
46 
     | 
    
         
             
            PySimultan2/resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
         
     | 
| 
       47 
     | 
    
         
            -
            pysimultan-0.7. 
     | 
| 
       48 
     | 
    
         
            -
            pysimultan-0.7. 
     | 
| 
       49 
     | 
    
         
            -
            pysimultan-0.7. 
     | 
| 
       50 
     | 
    
         
            -
            pysimultan-0.7. 
     | 
| 
      
 47 
     | 
    
         
            +
            pysimultan-0.7.4.dist-info/METADATA,sha256=Hx0MaOQnujynjSXoSlJfzJtbFtpfVPLaRgGmG81bWJ8,6608
         
     | 
| 
      
 48 
     | 
    
         
            +
            pysimultan-0.7.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
         
     | 
| 
      
 49 
     | 
    
         
            +
            pysimultan-0.7.4.dist-info/licenses/LICENSE.txt,sha256=FgR_YZkk7oYz4087xYXfcBCXGuTStFrsOWTH4bbpa3c,1821
         
     | 
| 
      
 50 
     | 
    
         
            +
            pysimultan-0.7.4.dist-info/RECORD,,
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     |