steer-core 0.1.32__tar.gz → 0.1.33__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.
- {steer_core-0.1.32 → steer_core-0.1.33}/PKG-INFO +1 -1
- {steer_core-0.1.32 → steer_core-0.1.33}/steer_core/Data/DataManager.py +0 -3
- {steer_core-0.1.32 → steer_core-0.1.33}/steer_core/Mixins/Dunder.py +4 -1
- {steer_core-0.1.32 → steer_core-0.1.33}/steer_core/Mixins/Serializer.py +19 -2
- {steer_core-0.1.32 → steer_core-0.1.33}/steer_core/__init__.py +1 -1
- {steer_core-0.1.32 → steer_core-0.1.33}/steer_core.egg-info/PKG-INFO +1 -1
- {steer_core-0.1.32 → steer_core-0.1.33}/README.md +0 -0
- {steer_core-0.1.32 → steer_core-0.1.33}/pyproject.toml +0 -0
- {steer_core-0.1.32 → steer_core-0.1.33}/setup.cfg +0 -0
- {steer_core-0.1.32 → steer_core-0.1.33}/steer_core/Constants/Units.py +0 -0
- {steer_core-0.1.32 → steer_core-0.1.33}/steer_core/Constants/Universal.py +0 -0
- {steer_core-0.1.32 → steer_core-0.1.33}/steer_core/Constants/__init__.py +0 -0
- {steer_core-0.1.32 → steer_core-0.1.33}/steer_core/ContextManagers/ContextManagers.py +0 -0
- {steer_core-0.1.32 → steer_core-0.1.33}/steer_core/ContextManagers/__init__.py +0 -0
- {steer_core-0.1.32 → steer_core-0.1.33}/steer_core/Data/__init__.py +0 -0
- {steer_core-0.1.32 → steer_core-0.1.33}/steer_core/Decorators/Coordinates.py +0 -0
- {steer_core-0.1.32 → steer_core-0.1.33}/steer_core/Decorators/General.py +0 -0
- {steer_core-0.1.32 → steer_core-0.1.33}/steer_core/Decorators/Objects.py +0 -0
- {steer_core-0.1.32 → steer_core-0.1.33}/steer_core/Decorators/__init__.py +0 -0
- {steer_core-0.1.32 → steer_core-0.1.33}/steer_core/Mixins/Colors.py +0 -0
- {steer_core-0.1.32 → steer_core-0.1.33}/steer_core/Mixins/Coordinates.py +0 -0
- {steer_core-0.1.32 → steer_core-0.1.33}/steer_core/Mixins/Data.py +0 -0
- {steer_core-0.1.32 → steer_core-0.1.33}/steer_core/Mixins/Plotter.py +0 -0
- {steer_core-0.1.32 → steer_core-0.1.33}/steer_core/Mixins/TypeChecker.py +0 -0
- {steer_core-0.1.32 → steer_core-0.1.33}/steer_core/Mixins/__init__.py +0 -0
- {steer_core-0.1.32 → steer_core-0.1.33}/steer_core.egg-info/SOURCES.txt +0 -0
- {steer_core-0.1.32 → steer_core-0.1.33}/steer_core.egg-info/dependency_links.txt +0 -0
- {steer_core-0.1.32 → steer_core-0.1.33}/steer_core.egg-info/requires.txt +0 -0
- {steer_core-0.1.32 → steer_core-0.1.33}/steer_core.egg-info/top_level.txt +0 -0
- {steer_core-0.1.32 → steer_core-0.1.33}/test/test_validation_mixin.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: steer-core
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.33
|
|
4
4
|
Summary: Modelling energy storage from cell to site - STEER OpenCell Design
|
|
5
5
|
Author-email: Nicholas Siemons <nsiemons@stanford.edu>
|
|
6
6
|
Maintainer-email: Nicholas Siemons <nsiemons@stanford.edu>
|
|
@@ -361,7 +361,6 @@ class DataManager:
|
|
|
361
361
|
self._cursor.execute(f"DELETE FROM {table_name} WHERE {condition}")
|
|
362
362
|
self._connection.commit()
|
|
363
363
|
|
|
364
|
-
|
|
365
364
|
@classmethod
|
|
366
365
|
def from_database(cls: type[T], name: str, table_name: str = None) -> T:
|
|
367
366
|
"""
|
|
@@ -427,8 +426,6 @@ class DataManager:
|
|
|
427
426
|
f"Available: {all_available}"
|
|
428
427
|
)
|
|
429
428
|
|
|
430
|
-
|
|
431
|
-
|
|
432
429
|
def __del__(self):
|
|
433
430
|
self._connection.close()
|
|
434
431
|
|
|
@@ -154,7 +154,10 @@ class DunderMixin:
|
|
|
154
154
|
"""
|
|
155
155
|
String representation of the instance showing all @property decorated attributes and their values.
|
|
156
156
|
"""
|
|
157
|
-
|
|
157
|
+
if hasattr(self, 'name') and self.name:
|
|
158
|
+
return f"{self.__class__.__name__} ({self.name})"
|
|
159
|
+
else:
|
|
160
|
+
return f"{self.__class__.__name__}"
|
|
158
161
|
|
|
159
162
|
def __repr__(self):
|
|
160
163
|
"""
|
|
@@ -25,7 +25,12 @@ class SerializerMixin:
|
|
|
25
25
|
The serialized byte representation of the object.
|
|
26
26
|
"""
|
|
27
27
|
m.patch() # Enable numpy support
|
|
28
|
-
|
|
28
|
+
# Include class information for proper deserialization
|
|
29
|
+
obj_dict = {
|
|
30
|
+
'_class': f"{self.__class__.__module__}.{self.__class__.__name__}",
|
|
31
|
+
**self._to_dict()
|
|
32
|
+
}
|
|
33
|
+
data = msgpack.packb(obj_dict, use_bin_type=True)
|
|
29
34
|
|
|
30
35
|
if compress:
|
|
31
36
|
# Add marker byte to indicate compression
|
|
@@ -133,7 +138,19 @@ class SerializerMixin:
|
|
|
133
138
|
data = data[1:]
|
|
134
139
|
|
|
135
140
|
obj_dict = msgpack.unpackb(data, raw=False)
|
|
136
|
-
|
|
141
|
+
|
|
142
|
+
# Use stored class information if available
|
|
143
|
+
if '_class' in obj_dict:
|
|
144
|
+
import importlib
|
|
145
|
+
module_name, class_name = obj_dict['_class'].rsplit('.', 1)
|
|
146
|
+
module = importlib.import_module(module_name)
|
|
147
|
+
actual_cls = getattr(module, class_name)
|
|
148
|
+
# Remove class marker before reconstructing
|
|
149
|
+
obj_data = {k: v for k, v in obj_dict.items() if k != '_class'}
|
|
150
|
+
return actual_cls._from_dict(obj_data)
|
|
151
|
+
else:
|
|
152
|
+
# Fallback for backward compatibility
|
|
153
|
+
return cls._from_dict(obj_dict)
|
|
137
154
|
|
|
138
155
|
@classmethod
|
|
139
156
|
def _deserialize_value(cls, value: Any) -> Any:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: steer-core
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.33
|
|
4
4
|
Summary: Modelling energy storage from cell to site - STEER OpenCell Design
|
|
5
5
|
Author-email: Nicholas Siemons <nsiemons@stanford.edu>
|
|
6
6
|
Maintainer-email: Nicholas Siemons <nsiemons@stanford.edu>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|