steer-core 0.1.27__tar.gz → 0.1.28__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 (32) hide show
  1. {steer_core-0.1.27 → steer_core-0.1.28}/PKG-INFO +1 -1
  2. {steer_core-0.1.27 → steer_core-0.1.28}/steer_core/Data/database.db +0 -0
  3. {steer_core-0.1.27 → steer_core-0.1.28}/steer_core/DataManager.py +20 -0
  4. {steer_core-0.1.27 → steer_core-0.1.28}/steer_core/Mixins/Coordinates.py +49 -3
  5. {steer_core-0.1.27 → steer_core-0.1.28}/steer_core/__init__.py +1 -1
  6. {steer_core-0.1.27 → steer_core-0.1.28}/steer_core.egg-info/PKG-INFO +1 -1
  7. {steer_core-0.1.27 → steer_core-0.1.28}/steer_core.egg-info/SOURCES.txt +0 -1
  8. steer_core-0.1.27/steer_core/Decorators/Electrochemical.py +0 -29
  9. {steer_core-0.1.27 → steer_core-0.1.28}/README.md +0 -0
  10. {steer_core-0.1.27 → steer_core-0.1.28}/pyproject.toml +0 -0
  11. {steer_core-0.1.27 → steer_core-0.1.28}/setup.cfg +0 -0
  12. {steer_core-0.1.27 → steer_core-0.1.28}/steer_core/Constants/Units.py +0 -0
  13. {steer_core-0.1.27 → steer_core-0.1.28}/steer_core/Constants/Universal.py +0 -0
  14. {steer_core-0.1.27 → steer_core-0.1.28}/steer_core/Constants/__init__.py +0 -0
  15. {steer_core-0.1.27 → steer_core-0.1.28}/steer_core/ContextManagers/ContextManagers.py +0 -0
  16. {steer_core-0.1.27 → steer_core-0.1.28}/steer_core/ContextManagers/__init__.py +0 -0
  17. {steer_core-0.1.27 → steer_core-0.1.28}/steer_core/Data/__init__.py +0 -0
  18. {steer_core-0.1.27 → steer_core-0.1.28}/steer_core/Decorators/Coordinates.py +0 -0
  19. {steer_core-0.1.27 → steer_core-0.1.28}/steer_core/Decorators/General.py +0 -0
  20. {steer_core-0.1.27 → steer_core-0.1.28}/steer_core/Decorators/Objects.py +0 -0
  21. {steer_core-0.1.27 → steer_core-0.1.28}/steer_core/Decorators/__init__.py +0 -0
  22. {steer_core-0.1.27 → steer_core-0.1.28}/steer_core/Mixins/Colors.py +0 -0
  23. {steer_core-0.1.27 → steer_core-0.1.28}/steer_core/Mixins/Data.py +0 -0
  24. {steer_core-0.1.27 → steer_core-0.1.28}/steer_core/Mixins/Dunder.py +0 -0
  25. {steer_core-0.1.27 → steer_core-0.1.28}/steer_core/Mixins/Plotter.py +0 -0
  26. {steer_core-0.1.27 → steer_core-0.1.28}/steer_core/Mixins/Serializer.py +0 -0
  27. {steer_core-0.1.27 → steer_core-0.1.28}/steer_core/Mixins/TypeChecker.py +0 -0
  28. {steer_core-0.1.27 → steer_core-0.1.28}/steer_core/Mixins/__init__.py +0 -0
  29. {steer_core-0.1.27 → steer_core-0.1.28}/steer_core.egg-info/dependency_links.txt +0 -0
  30. {steer_core-0.1.27 → steer_core-0.1.28}/steer_core.egg-info/requires.txt +0 -0
  31. {steer_core-0.1.27 → steer_core-0.1.28}/steer_core.egg-info/top_level.txt +0 -0
  32. {steer_core-0.1.27 → steer_core-0.1.28}/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.27
3
+ Version: 0.1.28
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>
@@ -281,6 +281,26 @@ class DataManager:
281
281
 
282
282
  return data
283
283
 
284
+ def get_prismatic_container_materials(self, most_recent: bool = True) -> pd.DataFrame:
285
+ """
286
+ Retrieves prismatic container materials from the database.
287
+
288
+ :param most_recent: If True, returns only the most recent entry.
289
+ :return: DataFrame with prismatic container materials.
290
+ """
291
+ data = (
292
+ self.get_data(table_name="prismatic_container_materials")
293
+ .groupby("name", group_keys=False)
294
+ .apply(
295
+ lambda x: x.sort_values("date", ascending=False).head(1)
296
+ if most_recent
297
+ else x
298
+ )
299
+ .reset_index(drop=True)
300
+ )
301
+
302
+ return data
303
+
284
304
  @staticmethod
285
305
  def read_half_cell_curve(half_cell_path) -> pd.DataFrame:
286
306
  """
@@ -130,7 +130,10 @@ class CoordinateMixin:
130
130
 
131
131
  @staticmethod
132
132
  def rotate_coordinates(
133
- coords: np.ndarray, axis: str, angle: float, center: tuple = None
133
+ coords: np.ndarray,
134
+ axis: str,
135
+ angle: float,
136
+ center: tuple = None
134
137
  ) -> np.ndarray:
135
138
  """
136
139
  Rotate a (N, 3) NumPy array of 3D coordinates around the specified axis.
@@ -240,9 +243,52 @@ class CoordinateMixin:
240
243
  The width of the square.
241
244
  y_width : float
242
245
  The height of the square.
246
+
247
+ Returns
248
+ -------
249
+ Tuple[np.ndarray, np.ndarray]
250
+ Tuple containing x and y coordinate arrays defining the square/rectangle
243
251
  """
244
- x_coords = [x, x, x + x_width, x + x_width, x]
245
- y_coords = [y, y + y_width, y + y_width, y, y]
252
+ x_coords = np.array([x, x, x + x_width, x + x_width, x])
253
+ y_coords = np.array([y, y + y_width, y + y_width, y, y])
254
+ return x_coords, y_coords
255
+
256
+ @staticmethod
257
+ def build_circle_array(
258
+ center_x: float, center_y: float, radius: float, num_points: int = 64, anticlockwise: bool = True
259
+ ) -> Tuple[np.ndarray, np.ndarray]:
260
+ """
261
+ Build a NumPy array representing a circle defined by its center and radius.
262
+
263
+ Parameters
264
+ ----------
265
+ center_x : float
266
+ The x-coordinate of the circle center.
267
+ center_y : float
268
+ The y-coordinate of the circle center.
269
+ radius : float
270
+ The radius of the circle.
271
+ num_points : int, optional
272
+ Number of points to use for the circle approximation, by default 64
273
+ anticlockwise : bool, optional
274
+ If True, points are ordered anticlockwise; if False, clockwise, by default True
275
+
276
+ Returns
277
+ -------
278
+ Tuple[np.ndarray, np.ndarray]
279
+ Tuple containing x and y coordinate arrays defining the circle
280
+ """
281
+ # Generate angles from 0 to 2π
282
+ angles = np.linspace(0, 2 * np.pi, num_points + 1)
283
+
284
+ # Reverse angles for clockwise direction
285
+ if not anticlockwise:
286
+ angles = angles[::-1]
287
+
288
+ # Calculate x and y coordinates
289
+ x_coords = center_x + radius * np.cos(angles)
290
+ y_coords = center_y + radius * np.sin(angles)
291
+
246
292
  return x_coords, y_coords
247
293
 
248
294
  @staticmethod
@@ -1,4 +1,4 @@
1
- __version__ = "0.1.27"
1
+ __version__ = "0.1.28"
2
2
 
3
3
  # datamanager import
4
4
  from .DataManager import DataManager
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: steer-core
3
- Version: 0.1.27
3
+ Version: 0.1.28
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>
@@ -15,7 +15,6 @@ steer_core/ContextManagers/__init__.py
15
15
  steer_core/Data/__init__.py
16
16
  steer_core/Data/database.db
17
17
  steer_core/Decorators/Coordinates.py
18
- steer_core/Decorators/Electrochemical.py
19
18
  steer_core/Decorators/General.py
20
19
  steer_core/Decorators/Objects.py
21
20
  steer_core/Decorators/__init__.py
@@ -1,29 +0,0 @@
1
- from functools import wraps
2
-
3
- def calculate_half_cell_curve(func):
4
- """
5
- Decorator to recalculate half-cell curve properties after a method call.
6
- This is useful for methods that modify the half-cell curve data.
7
- """
8
- @wraps(func)
9
- def wrapper(self, *args, **kwargs):
10
- result = func(self, *args, **kwargs)
11
- if hasattr(self, '_update_properties') and self._update_properties:
12
- self._calculate_half_cell_curve()
13
- return result
14
- return wrapper
15
-
16
-
17
- def calculate_half_cell_curves_properties(func):
18
- """
19
- Decorator to recalculate half-cell curves properties after a method call.
20
- This is useful for methods that modify the half-cell curves data.
21
- """
22
- @wraps(func)
23
- def wrapper(self, *args, **kwargs):
24
- result = func(self, *args, **kwargs)
25
- if hasattr(self, '_update_properties') and self._update_properties:
26
- self._calculate_half_cell_curves_properties()
27
- return result
28
- return wrapper
29
-
File without changes
File without changes
File without changes