besslib 0.1.0__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.
- besslib/__init__.py +12 -0
- besslib/data/__init__.py +1 -0
- besslib/data/sample_05/NOTICE.md +39 -0
- besslib/data/sample_05/daily.parquet +0 -0
- besslib/data/sample_05/rests.parquet +0 -0
- besslib/data/sample_05/steps.parquet +0 -0
- besslib/frames.py +84 -0
- besslib/io/__init__.py +6 -0
- besslib/io/figgener.py +236 -0
- besslib/io/figgener_meta/README.md +12 -0
- besslib/io/figgener_meta/capacity_tests.csv +61 -0
- besslib/io/figgener_meta/systems.csv +22 -0
- besslib/soh/__init__.py +43 -0
- besslib/soh/_core.py +1081 -0
- besslib/soh/_ratio.py +277 -0
- besslib/soh/capacity.py +332 -0
- besslib/soh/capacity_test.py +205 -0
- besslib/soh/charge_loss.py +199 -0
- besslib/soh/config.py +153 -0
- besslib/soh/efficiency.py +270 -0
- besslib/soh/record.py +556 -0
- besslib/soh/reduce.py +352 -0
- besslib/soh/report.py +290 -0
- besslib/soh/resistance.py +570 -0
- besslib/soh/rests.py +488 -0
- besslib/soh/usage.py +322 -0
- besslib-0.1.0.dist-info/METADATA +210 -0
- besslib-0.1.0.dist-info/RECORD +31 -0
- besslib-0.1.0.dist-info/WHEEL +5 -0
- besslib-0.1.0.dist-info/licenses/LICENSE +28 -0
- besslib-0.1.0.dist-info/top_level.txt +1 -0
besslib/__init__.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""besslib: state of health from battery storage operating data."""
|
|
2
|
+
|
|
3
|
+
from importlib import metadata as _metadata
|
|
4
|
+
|
|
5
|
+
from besslib import frames, io, soh
|
|
6
|
+
from besslib.frames import PackSpec
|
|
7
|
+
|
|
8
|
+
try:
|
|
9
|
+
__version__ = _metadata.version("besslib")
|
|
10
|
+
except _metadata.PackageNotFoundError: # running from a source tree that was never installed
|
|
11
|
+
__version__ = "unknown"
|
|
12
|
+
__all__ = ["PackSpec", "frames", "io", "soh", "__version__"]
|
besslib/data/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Data shipped with besslib: the sample of the quickstart (``besslib.io.read_sample``)."""
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Sample data: system 05 of the Figgener home-storage dataset
|
|
2
|
+
|
|
3
|
+
## What the files are
|
|
4
|
+
|
|
5
|
+
`daily.parquet`, `steps.parquet` and `rests.parquet` are the reduced tables of system 05: one row per day, per current step and per rest candidate. besslib reads them with `besslib.io.read_sample()`.
|
|
6
|
+
|
|
7
|
+
Modified: reduced by besslib 0.1.0 with validation/reduce_phase3.py: daily sums, current steps and rest candidates; not the original samples.
|
|
8
|
+
|
|
9
|
+
Made with the settings of configuration hashes 109e9eb1efa5 (capacity) and c2f7f545cebb (record).
|
|
10
|
+
|
|
11
|
+
## Credit
|
|
12
|
+
|
|
13
|
+
Creators, as in the Zenodo record:
|
|
14
|
+
|
|
15
|
+
- Figgener, Jan
|
|
16
|
+
- Haberschusz, David
|
|
17
|
+
- Wessels, Oliver
|
|
18
|
+
- Kairies, Kai-Philipp
|
|
19
|
+
- Bors, Jakob
|
|
20
|
+
- van Ouwerkerk, Jonas
|
|
21
|
+
- Sauer, Dirk Uwe
|
|
22
|
+
|
|
23
|
+
Title: Data for: Multi-year field measurements of home storage systems and their use in capacity estimation.
|
|
24
|
+
|
|
25
|
+
Source: Zenodo, https://doi.org/10.5281/zenodo.12091223, file Data_ID_05.zip.
|
|
26
|
+
|
|
27
|
+
Licence: CC BY 4.0, https://creativecommons.org/licenses/by/4.0/.
|
|
28
|
+
|
|
29
|
+
This sample is licensed under CC BY 4.0, not under the BSD-3-Clause licence of the besslib code.
|
|
30
|
+
|
|
31
|
+
## Disclaimer
|
|
32
|
+
|
|
33
|
+
The licensed material is provided as-is and as-available, without representations or warranties of any kind, as stated in Section 5 of the CC BY 4.0 licence (disclaimer of warranties and limitation of liability).
|
|
34
|
+
|
|
35
|
+
## The paper
|
|
36
|
+
|
|
37
|
+
The dataset belongs to an article in Nature Energy. Cite it when you use the data:
|
|
38
|
+
|
|
39
|
+
Figgener, J. et al., Multi-year field measurements of home storage systems and their use in capacity estimation, Nature Energy 9, 1438-1447 (2024), https://doi.org/10.1038/s41560-024-01620-9, licence CC BY-NC-ND 4.0: cited, nothing copied.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
besslib/frames.py
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"""The one data contract of besslib: column names, units and the sign convention.
|
|
2
|
+
|
|
3
|
+
Every function in ``besslib.soh`` reads a *frame*: a pandas DataFrame with a sorted,
|
|
4
|
+
timezone-naive ``DatetimeIndex`` and the columns below. ``besslib.sim`` (A2) writes
|
|
5
|
+
the same format.
|
|
6
|
+
|
|
7
|
+
Sign convention
|
|
8
|
+
---------------
|
|
9
|
+
Positive ``current_a`` and positive ``power_w`` mean **charging**: energy flows into
|
|
10
|
+
the battery and its state of charge rises. Discharging is negative.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
from dataclasses import dataclass, field
|
|
16
|
+
from datetime import date
|
|
17
|
+
|
|
18
|
+
import pandas as pd
|
|
19
|
+
|
|
20
|
+
#: Required columns and their units.
|
|
21
|
+
REQUIRED = {
|
|
22
|
+
"voltage_v": "V, at the battery terminals",
|
|
23
|
+
"current_a": "A, positive = charging",
|
|
24
|
+
"power_w": "W, positive = charging",
|
|
25
|
+
"temp_pack_c": "degrees C, battery pack",
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
#: Optional columns and their units.
|
|
29
|
+
OPTIONAL = {
|
|
30
|
+
"temp_ambient_c": "degrees C, room or ambient",
|
|
31
|
+
"interpolated": "bool, True where the value was filled in, not measured",
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class FrameError(ValueError):
|
|
36
|
+
"""The DataFrame does not follow the besslib frame format."""
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def check_frame(frame: pd.DataFrame) -> pd.DataFrame:
|
|
40
|
+
"""Return ``frame`` unchanged if it follows the format; raise ``FrameError`` if not."""
|
|
41
|
+
if not isinstance(frame.index, pd.DatetimeIndex):
|
|
42
|
+
raise FrameError("the index must be a DatetimeIndex")
|
|
43
|
+
if frame.index.tz is not None:
|
|
44
|
+
raise FrameError("the index must be timezone-naive")
|
|
45
|
+
missing = [name for name in REQUIRED if name not in frame.columns]
|
|
46
|
+
if missing:
|
|
47
|
+
raise FrameError(f"missing columns: {', '.join(missing)}")
|
|
48
|
+
if not frame.index.is_monotonic_increasing:
|
|
49
|
+
raise FrameError("the index must be sorted by time")
|
|
50
|
+
if frame.index.has_duplicates:
|
|
51
|
+
raise FrameError("the index has duplicate timestamps")
|
|
52
|
+
return frame
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
@dataclass(frozen=True)
|
|
56
|
+
class PackSpec:
|
|
57
|
+
"""What is known about a battery pack from its documents, not from its data.
|
|
58
|
+
|
|
59
|
+
``reference_capacity_ah`` is the value every state-of-health share is divided by.
|
|
60
|
+
besslib prints it with every share, because the same pack can read 100 % or 65 %
|
|
61
|
+
depending on the reference chosen.
|
|
62
|
+
"""
|
|
63
|
+
|
|
64
|
+
nominal_capacity_ah: float
|
|
65
|
+
nominal_energy_kwh: float
|
|
66
|
+
cells_in_series: int
|
|
67
|
+
cells_in_parallel: int = 1
|
|
68
|
+
chemistry: str = ""
|
|
69
|
+
nominal_voltage_v: float | None = None
|
|
70
|
+
voltage_max_v: float | None = None
|
|
71
|
+
voltage_min_v: float | None = None
|
|
72
|
+
reference_capacity_ah: float | None = None
|
|
73
|
+
date_of_manufacture: date | None = None
|
|
74
|
+
date_put_into_service: date | None = None
|
|
75
|
+
name: str = ""
|
|
76
|
+
extra: dict = field(default_factory=dict, compare=False)
|
|
77
|
+
|
|
78
|
+
def __post_init__(self) -> None:
|
|
79
|
+
if self.nominal_capacity_ah <= 0 or self.nominal_energy_kwh <= 0:
|
|
80
|
+
raise ValueError("nominal capacity and energy must be positive")
|
|
81
|
+
if self.cells_in_series < 1 or self.cells_in_parallel < 1:
|
|
82
|
+
raise ValueError("cell counts must be at least 1")
|
|
83
|
+
if self.reference_capacity_ah is None:
|
|
84
|
+
object.__setattr__(self, "reference_capacity_ah", self.nominal_capacity_ah)
|
besslib/io/__init__.py
ADDED
besslib/io/figgener.py
ADDED
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
"""Reader for the open home-storage field dataset of Figgener et al. (2024).
|
|
2
|
+
|
|
3
|
+
Data: Figgener, J. et al., "Data for: Multi-year field measurements of home storage
|
|
4
|
+
systems and their use in capacity estimation", Zenodo, doi:10.5281/zenodo.12091223,
|
|
5
|
+
licence CC BY 4.0. Paper: Nature Energy 9, 1438-1447 (2024),
|
|
6
|
+
doi:10.1038/s41560-024-01620-9.
|
|
7
|
+
|
|
8
|
+
The dataset has one archive per system (``Data_ID_01.zip`` to ``Data_ID_21.zip``),
|
|
9
|
+
each with one CSV file per month at one-second resolution. This reader takes the
|
|
10
|
+
months straight out of the archive, so nothing has to be unpacked.
|
|
11
|
+
|
|
12
|
+
The source's current and power are already positive for charging, which is the
|
|
13
|
+
besslib convention (checked on system 17: the current is positive around midday,
|
|
14
|
+
while the voltage rises).
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
from __future__ import annotations
|
|
18
|
+
|
|
19
|
+
import re
|
|
20
|
+
import zipfile
|
|
21
|
+
from datetime import date
|
|
22
|
+
from importlib import resources
|
|
23
|
+
from pathlib import Path
|
|
24
|
+
|
|
25
|
+
import pandas as pd
|
|
26
|
+
import pyarrow as pa
|
|
27
|
+
import pyarrow.csv as pc
|
|
28
|
+
|
|
29
|
+
from besslib.frames import PackSpec
|
|
30
|
+
from besslib.soh.reduce import Reduced
|
|
31
|
+
|
|
32
|
+
SYSTEM_IDS = tuple(range(1, 22))
|
|
33
|
+
|
|
34
|
+
_RENAME = {
|
|
35
|
+
"P_in_W": "power_w",
|
|
36
|
+
"V_in_V": "voltage_v",
|
|
37
|
+
"I_in_A": "current_a",
|
|
38
|
+
"T_Bat_in_C": "temp_pack_c",
|
|
39
|
+
"T_Room_in_C": "temp_ambient_c",
|
|
40
|
+
"Interpolated": "interpolated",
|
|
41
|
+
}
|
|
42
|
+
_COLUMNS = ["voltage_v", "current_a", "power_w", "temp_pack_c", "temp_ambient_c", "interpolated"]
|
|
43
|
+
_MONTH_FILE = re.compile(r"(\d{4})_(\d{2})_System_ID_(\d{2})\.csv$")
|
|
44
|
+
_TIME_FORMAT = "%d-%b-%Y %H:%M:%S"
|
|
45
|
+
|
|
46
|
+
#: The credit line of the dataset (CC BY 4.0); it travels with every pack read from it.
|
|
47
|
+
CREDIT = (
|
|
48
|
+
"Data: Figgener, J. et al., Data for: Multi-year field measurements of home storage systems and their use "
|
|
49
|
+
"in capacity estimation, Zenodo (2024), https://doi.org/10.5281/zenodo.12091223, licence CC BY 4.0."
|
|
50
|
+
)
|
|
51
|
+
PAPER = (
|
|
52
|
+
"Figgener, J. et al., Multi-year field measurements of home storage systems and their use in capacity "
|
|
53
|
+
"estimation, Nature Energy 9, 1438-1447 (2024), https://doi.org/10.1038/s41560-024-01620-9, licence "
|
|
54
|
+
"CC BY-NC-ND 4.0: cited, nothing copied."
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def _meta(name: str) -> pd.DataFrame:
|
|
59
|
+
with resources.files("besslib.io").joinpath("figgener_meta", name).open() as f:
|
|
60
|
+
return pd.read_csv(f)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def systems() -> pd.DataFrame:
|
|
64
|
+
"""The metadata of the 21 systems, one row each, with the source's column names."""
|
|
65
|
+
return _meta("systems.csv").set_index("ID")
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def capacity_tests() -> pd.DataFrame:
|
|
69
|
+
"""The 60 field capacity tests: ``system_id`` and ``start_time`` (as in the source)."""
|
|
70
|
+
return _meta("capacity_tests.csv").assign(start_time=lambda t: pd.to_datetime(t["start_time"]))
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def pack_spec(system_id: int) -> PackSpec:
|
|
74
|
+
"""The ``PackSpec`` of one system, from the dataset's metadata.
|
|
75
|
+
|
|
76
|
+
The dataset gives the date the storage system was installed, not the date of
|
|
77
|
+
manufacture; it is used as the date of putting into service.
|
|
78
|
+
"""
|
|
79
|
+
row = systems().loc[_check_id(system_id)]
|
|
80
|
+
return PackSpec(
|
|
81
|
+
nominal_capacity_ah=float(row["Capacity_nominal_in_Ah"]),
|
|
82
|
+
nominal_energy_kwh=float(row["Energy_nominal_in_kWh"]),
|
|
83
|
+
cells_in_series=int(row["Cell_number_in_series"]),
|
|
84
|
+
cells_in_parallel=int(row["Cell_number_in_parallel"]),
|
|
85
|
+
chemistry=str(row["Chemistry_detail"]),
|
|
86
|
+
nominal_voltage_v=float(row["Voltage_nominal_in_V"]),
|
|
87
|
+
date_put_into_service=date.fromisoformat(row["Date_storage_system_installation"]),
|
|
88
|
+
name=f"Figgener 2024, system {system_id:02d}",
|
|
89
|
+
extra={
|
|
90
|
+
"manufacturer": str(row["Manufacturer"]),
|
|
91
|
+
"energy_usable_datasheet_kwh": float(row["Energy_usable_datasheet_in_kWh"]),
|
|
92
|
+
"inverter_nominal_power_kw": float(row["Inverter_nominal_power"]),
|
|
93
|
+
"measurement_start": date.fromisoformat(row["Date_measurement_system_installation"]),
|
|
94
|
+
"data_credit": CREDIT,
|
|
95
|
+
},
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def read_sample() -> tuple[Reduced, PackSpec]:
|
|
100
|
+
"""The sample shipped with besslib: system 05 of this dataset, as reduced tables.
|
|
101
|
+
|
|
102
|
+
The three tables (one row per day, per current step and per rest candidate) were
|
|
103
|
+
made from the system's measurements by ``besslib.soh.reduce_parts``; the samples
|
|
104
|
+
themselves are not shipped. The data are licensed under CC BY 4.0, not under the
|
|
105
|
+
licence of the code; the credit is in ``besslib/data/sample_05/NOTICE.md``.
|
|
106
|
+
|
|
107
|
+
Returns
|
|
108
|
+
-------
|
|
109
|
+
(reduced, spec)
|
|
110
|
+
A ``Reduced`` for ``besslib.soh.annex_vii(None, spec, reduced=reduced)``, and the
|
|
111
|
+
system's ``PackSpec``.
|
|
112
|
+
"""
|
|
113
|
+
folder = resources.files("besslib.data").joinpath("sample_05")
|
|
114
|
+
tables = {}
|
|
115
|
+
for name in ("daily", "steps", "rests"):
|
|
116
|
+
with resources.as_file(folder.joinpath(f"{name}.parquet")) as path:
|
|
117
|
+
tables[name] = pd.read_parquet(path)
|
|
118
|
+
daily = tables["daily"]
|
|
119
|
+
sample_s = float(daily["sample_s"].iloc[0]) if len(daily) else float("nan")
|
|
120
|
+
reduced = Reduced(daily=daily, steps=tables["steps"], rests=tables["rests"], sample_s=sample_s)
|
|
121
|
+
return reduced, pack_spec(5)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def list_months(root: str | Path, system_id: int) -> pd.DataFrame:
|
|
125
|
+
"""The monthly files of one system: ``month`` (first day), ``member``, ``bytes``."""
|
|
126
|
+
source = _Source(root, _check_id(system_id))
|
|
127
|
+
rows = [{"month": month, "member": member, "bytes": size} for month, member, size in source.months()]
|
|
128
|
+
return pd.DataFrame(rows, columns=["month", "member", "bytes"])
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def read_figgener(
|
|
132
|
+
root: str | Path,
|
|
133
|
+
system_id: int,
|
|
134
|
+
start: str | pd.Timestamp | None = None,
|
|
135
|
+
end: str | pd.Timestamp | None = None,
|
|
136
|
+
) -> tuple[pd.DataFrame, PackSpec]:
|
|
137
|
+
"""Read one system's measurements between ``start`` and ``end`` (both included).
|
|
138
|
+
|
|
139
|
+
Parameters
|
|
140
|
+
----------
|
|
141
|
+
root
|
|
142
|
+
A folder that holds ``Data_ID_XX.zip`` or the unpacked ``Data_ID_XX`` folder
|
|
143
|
+
(directly, or one level below), or the path of the archive itself.
|
|
144
|
+
system_id
|
|
145
|
+
1 to 21.
|
|
146
|
+
start, end
|
|
147
|
+
Anything ``pandas.Timestamp`` accepts. ``None`` means the first or last
|
|
148
|
+
measurement. Only the months needed are read.
|
|
149
|
+
|
|
150
|
+
Returns
|
|
151
|
+
-------
|
|
152
|
+
(frame, spec)
|
|
153
|
+
The measurements in the besslib frame format, and the system's ``PackSpec``.
|
|
154
|
+
"""
|
|
155
|
+
source = _Source(root, _check_id(system_id))
|
|
156
|
+
start = pd.Timestamp(start) if start is not None else None
|
|
157
|
+
end = pd.Timestamp(end) if end is not None else None
|
|
158
|
+
if end is not None and end == end.normalize() and not _has_time(end):
|
|
159
|
+
end = end + pd.Timedelta(days=1) - pd.Timedelta(seconds=1)
|
|
160
|
+
|
|
161
|
+
parts = []
|
|
162
|
+
for month, member, _ in source.months():
|
|
163
|
+
month_end = month + pd.offsets.MonthBegin(1)
|
|
164
|
+
if (end is not None and month > end) or (start is not None and month_end <= start):
|
|
165
|
+
continue
|
|
166
|
+
parts.append(source.read(member))
|
|
167
|
+
if not parts:
|
|
168
|
+
raise ValueError(f"system {system_id}: no data between {start} and {end}")
|
|
169
|
+
|
|
170
|
+
frame = pd.concat(parts) if len(parts) > 1 else parts[0]
|
|
171
|
+
if not frame.index.is_monotonic_increasing:
|
|
172
|
+
frame = frame.sort_index()
|
|
173
|
+
frame = frame[~frame.index.duplicated(keep="first")]
|
|
174
|
+
return frame.loc[start:end], pack_spec(system_id)
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
def _has_time(stamp: pd.Timestamp) -> bool:
|
|
178
|
+
return bool(stamp.hour or stamp.minute or stamp.second)
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
def _check_id(system_id: int) -> int:
|
|
182
|
+
if int(system_id) not in SYSTEM_IDS:
|
|
183
|
+
raise ValueError(f"system_id must be 1 to 21, got {system_id!r}")
|
|
184
|
+
return int(system_id)
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
class _Source:
|
|
188
|
+
"""One system's files, in an archive or in an unpacked folder."""
|
|
189
|
+
|
|
190
|
+
def __init__(self, root: str | Path, system_id: int) -> None:
|
|
191
|
+
root = Path(root)
|
|
192
|
+
tag = f"Data_ID_{system_id:02d}"
|
|
193
|
+
self.system_id = system_id
|
|
194
|
+
self.archive: Path | None = None
|
|
195
|
+
self.folder: Path | None = None
|
|
196
|
+
if root.is_file() and root.suffix == ".zip":
|
|
197
|
+
self.archive = root
|
|
198
|
+
return
|
|
199
|
+
for candidate in (root / f"{tag}.zip", root / tag / f"{tag}.zip"):
|
|
200
|
+
if candidate.is_file():
|
|
201
|
+
self.archive = candidate
|
|
202
|
+
return
|
|
203
|
+
for candidate in (root / tag / f"{system_id:02d}", root / tag, root):
|
|
204
|
+
if candidate.is_dir() and any(candidate.glob(f"*_System_ID_{system_id:02d}.csv")):
|
|
205
|
+
self.folder = candidate
|
|
206
|
+
return
|
|
207
|
+
raise FileNotFoundError(f"no {tag}.zip and no unpacked {tag} folder under {root}")
|
|
208
|
+
|
|
209
|
+
def months(self) -> list[tuple[pd.Timestamp, str, int]]:
|
|
210
|
+
if self.archive is not None:
|
|
211
|
+
with zipfile.ZipFile(self.archive) as z:
|
|
212
|
+
entries = [(info.filename, info.file_size) for info in z.infolist()]
|
|
213
|
+
else:
|
|
214
|
+
entries = [(str(p), p.stat().st_size) for p in self.folder.glob("*.csv")]
|
|
215
|
+
found = []
|
|
216
|
+
for member, size in entries:
|
|
217
|
+
match = _MONTH_FILE.search(member)
|
|
218
|
+
if match and int(match.group(3)) == self.system_id:
|
|
219
|
+
month = pd.Timestamp(year=int(match.group(1)), month=int(match.group(2)), day=1)
|
|
220
|
+
found.append((month, member, size))
|
|
221
|
+
return sorted(found)
|
|
222
|
+
|
|
223
|
+
def read(self, member: str) -> pd.DataFrame:
|
|
224
|
+
options = pc.ConvertOptions(
|
|
225
|
+
timestamp_parsers=[_TIME_FORMAT],
|
|
226
|
+
column_types={"Time": pa.timestamp("s"), "Interpolated": pa.int8()},
|
|
227
|
+
)
|
|
228
|
+
if self.archive is not None:
|
|
229
|
+
with zipfile.ZipFile(self.archive) as z, z.open(member) as f:
|
|
230
|
+
table = pc.read_csv(f, convert_options=options)
|
|
231
|
+
else:
|
|
232
|
+
table = pc.read_csv(member, convert_options=options)
|
|
233
|
+
frame = table.to_pandas().set_index("Time").rename(columns=_RENAME)
|
|
234
|
+
frame.index.name = "time"
|
|
235
|
+
frame["interpolated"] = frame["interpolated"].astype(bool)
|
|
236
|
+
return frame[_COLUMNS]
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Metadata of the Figgener et al. (2024) field dataset
|
|
2
|
+
|
|
3
|
+
`systems.csv` and `capacity_tests.csv` are converted from `Metadata_Systems.xlsx` and
|
|
4
|
+
`Capacity_Tests.xlsx` in `Metadata_and_Code.zip` of:
|
|
5
|
+
|
|
6
|
+
Figgener, J., Haberschusz, D., Wessels, O., Kairies, K.-P., Bors, J., van Ouwerkerk, J., Sauer, D. U.:
|
|
7
|
+
"Data for: Multi-year field measurements of home storage systems and their use in capacity estimation",
|
|
8
|
+
Zenodo (2024), https://doi.org/10.5281/zenodo.12091223, licence CC BY 4.0.
|
|
9
|
+
|
|
10
|
+
Changes made: installation dates converted from Unix seconds to dates (UTC); capacity-test start times
|
|
11
|
+
converted from spreadsheet serial numbers to timestamps, rounded to the second. Rebuilt by
|
|
12
|
+
`validation/make_metadata.py`.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
system_id,start_time
|
|
2
|
+
1,2017-06-14 14:23:39
|
|
3
|
+
1,2018-03-06 16:24:35
|
|
4
|
+
1,2019-07-01 13:55:06
|
|
5
|
+
1,2022-10-30 15:02:27
|
|
6
|
+
2,2017-06-01 19:31:45
|
|
7
|
+
2,2018-04-19 15:54:31
|
|
8
|
+
2,2019-06-07 12:49:40
|
|
9
|
+
2,2022-04-21 14:30:29
|
|
10
|
+
3,2017-06-08 11:55:03
|
|
11
|
+
3,2018-03-09 13:28:09
|
|
12
|
+
3,2019-08-29 10:24:12
|
|
13
|
+
4,2018-03-06 15:54:18
|
|
14
|
+
4,2019-05-07 09:56:26
|
|
15
|
+
5,2017-06-13 16:40:04
|
|
16
|
+
5,2018-03-14 14:07:18
|
|
17
|
+
5,2019-06-04 14:37:29
|
|
18
|
+
5,2022-04-11 12:56:50
|
|
19
|
+
6,2017-06-13 13:53:55
|
|
20
|
+
6,2018-04-19 13:34:53
|
|
21
|
+
6,2019-06-06 14:05:38
|
|
22
|
+
6,2020-05-20 13:59:23
|
|
23
|
+
6,2022-10-27 13:39:28
|
|
24
|
+
7,2017-06-14 18:25:44
|
|
25
|
+
7,2018-02-23 18:08:22
|
|
26
|
+
7,2019-08-15 19:23:07
|
|
27
|
+
7,2020-04-29 14:55:06
|
|
28
|
+
7,2021-10-09 19:02:55
|
|
29
|
+
7,2022-04-11 19:27:39
|
|
30
|
+
8,2017-05-29 16:41:09
|
|
31
|
+
8,2018-02-21 15:37:38
|
|
32
|
+
8,2019-06-17 15:31:08
|
|
33
|
+
8,2022-04-14 12:12:30
|
|
34
|
+
9,2017-06-19 12:57:25
|
|
35
|
+
9,2018-04-17 12:46:10
|
|
36
|
+
10,2017-06-14 14:04:46
|
|
37
|
+
10,2018-04-16 16:29:58
|
|
38
|
+
10,2019-08-30 13:49:38
|
|
39
|
+
10,2022-04-19 13:25:53
|
|
40
|
+
11,2019-05-24 11:09:59
|
|
41
|
+
12,2019-05-23 13:28:52
|
|
42
|
+
12,2022-10-11 18:24:56
|
|
43
|
+
14,2017-06-02 09:42:37
|
|
44
|
+
14,2018-02-19 09:41:15
|
|
45
|
+
14,2019-05-09 07:53:04
|
|
46
|
+
15,2017-06-05 17:58:34
|
|
47
|
+
15,2018-03-05 14:19:30
|
|
48
|
+
15,2019-10-12 12:10:11
|
|
49
|
+
15,2022-11-13 09:22:11
|
|
50
|
+
17,2019-05-03 14:57:06
|
|
51
|
+
17,2020-06-27 14:18:36
|
|
52
|
+
17,2021-09-25 15:28:05
|
|
53
|
+
17,2022-03-13 12:51:47
|
|
54
|
+
19,2018-02-20 09:54:55
|
|
55
|
+
19,2019-05-09 09:03:51
|
|
56
|
+
20,2017-06-17 20:22:30
|
|
57
|
+
20,2018-03-18 18:46:22
|
|
58
|
+
20,2019-09-08 19:21:25
|
|
59
|
+
21,2017-05-31 11:39:47
|
|
60
|
+
21,2018-02-19 08:25:02
|
|
61
|
+
21,2019-07-04 11:26:43
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
ID,Capacity_nominal_in_Ah,Voltage_nominal_in_V,Energy_nominal_in_kWh,Energy_usable_datasheet_in_kWh,Cell_number_in_series,Cell_number_in_parallel,Cell_number,Inverter_nominal_power,Manufacturer,Chemistry,Chemistry_detail,Date_storage_system_installation,Date_measurement_system_installation
|
|
2
|
+
1,15,146.667,2.2,2,40,1,40,2,A,LMO,LMO/NMC,2015-03-12,2015-07-10
|
|
3
|
+
2,15,146.667,2.2,2,40,1,40,2,A,LMO,LMO/NMC,2014-12-18,2015-12-21
|
|
4
|
+
3,15,146.667,2.2,2,40,1,40,2,A,LMO,LMO/NMC,2015-05-14,2016-05-24
|
|
5
|
+
4,15,146.667,2.2,2,40,1,40,2,A,LMO,LMO/NMC,2016-01-19,2016-06-21
|
|
6
|
+
5,15,146.667,2.2,2,40,1,40,2,A,LMO,LMO/NMC,2014-11-21,2016-08-16
|
|
7
|
+
6,15,146.667,2.2,2,40,1,40,2,A,LMO,LMO/NMC,2014-09-21,2016-09-12
|
|
8
|
+
7,180,48.1,8.658,8.464,13,96,1248,3,B,NMC,NMC,2014-07-14,2015-11-12
|
|
9
|
+
8,188,46.8,8.7984,8.464,13,96,1248,3,B,NMC,NMC,2015-08-31,2015-10-29
|
|
10
|
+
9,180,48.1,8.658,8.464,13,96,1248,3,B,NMC,NMC,2014-11-25,2015-07-11
|
|
11
|
+
10,188,46.8,8.7984,8.464,13,96,1248,3,B,NMC,NMC,2016-06-15,2016-10-07
|
|
12
|
+
11,171.6,50.4,8.64864,7.5,14,60,840,2.5,C,NMC,NMC,2019-04-03,2019-04-03
|
|
13
|
+
12,228.8,50.4,11.5315,10,14,80,1120,2.5,C,NMC,NMC,2019-04-23,2019-04-23
|
|
14
|
+
13,189,51.8,9.7902,8.8,14,3,42,5,D,NMC,NMC,2018-03-22,2019-10-11
|
|
15
|
+
14,158,51.2,8.0896,8,16,56,896,3.3,E,LFP,LFP,2015-05-05,2015-07-18
|
|
16
|
+
15,195,51.2,9.984,10,16,70,1120,3.3,E,LFP,LFP,2015-07-24,2016-07-06
|
|
17
|
+
16,158,51.2,8.0896,8,16,56,896,3.3,E,LFP,LFP,2017-10-17,2019-02-26
|
|
18
|
+
17,158,51.2,8.0896,8,16,56,896,3.3,E,LFP,LFP,2018-01-21,2019-03-19
|
|
19
|
+
18,158,51.2,8.0896,8,16,56,896,3.3,E,LFP,LFP,2015-10-23,2016-08-11
|
|
20
|
+
19,200,46,9.2,7,14,2,28,3,E,LFP,LFP,2015-03-23,2015-07-11
|
|
21
|
+
20,200,46,9.2,7,14,2,28,3,E,LFP,LFP,2015-08-27,2016-07-14
|
|
22
|
+
21,300,46,13.8,10.5,14,3,42,3.5,E,LFP,LFP,2014-11-10,2015-10-09
|
besslib/soh/__init__.py
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"""besslib.soh: state-of-health figures from operating data."""
|
|
2
|
+
|
|
3
|
+
from besslib.soh.capacity import estimate_capacity, fade_rate
|
|
4
|
+
from besslib.soh.capacity_test import CapacityTest, measure_capacity_test
|
|
5
|
+
from besslib.soh.charge_loss import charge_loss, charge_loss_trend
|
|
6
|
+
from besslib.soh.config import CapacityConfig, RecordConfig, config_hash
|
|
7
|
+
from besslib.soh.efficiency import efficiency_loops, estimate_efficiency
|
|
8
|
+
from besslib.soh.record import ANNEX_VII_FIELDS, AnnexVII, annex_vii
|
|
9
|
+
from besslib.soh.reduce import Reduced, read_reduced, reduce_frame, reduce_parts, write_reduced
|
|
10
|
+
from besslib.soh.report import report
|
|
11
|
+
from besslib.soh.resistance import estimate_resistance, resistance_growth
|
|
12
|
+
from besslib.soh.rests import find_rests
|
|
13
|
+
from besslib.soh.usage import Limits, Usage, count_usage, usage_by_year
|
|
14
|
+
|
|
15
|
+
__all__ = [
|
|
16
|
+
"ANNEX_VII_FIELDS",
|
|
17
|
+
"AnnexVII",
|
|
18
|
+
"CapacityConfig",
|
|
19
|
+
"CapacityTest",
|
|
20
|
+
"Limits",
|
|
21
|
+
"RecordConfig",
|
|
22
|
+
"Reduced",
|
|
23
|
+
"Usage",
|
|
24
|
+
"annex_vii",
|
|
25
|
+
"charge_loss",
|
|
26
|
+
"charge_loss_trend",
|
|
27
|
+
"config_hash",
|
|
28
|
+
"count_usage",
|
|
29
|
+
"efficiency_loops",
|
|
30
|
+
"estimate_capacity",
|
|
31
|
+
"estimate_efficiency",
|
|
32
|
+
"estimate_resistance",
|
|
33
|
+
"fade_rate",
|
|
34
|
+
"find_rests",
|
|
35
|
+
"measure_capacity_test",
|
|
36
|
+
"read_reduced",
|
|
37
|
+
"reduce_frame",
|
|
38
|
+
"reduce_parts",
|
|
39
|
+
"report",
|
|
40
|
+
"resistance_growth",
|
|
41
|
+
"usage_by_year",
|
|
42
|
+
"write_reduced",
|
|
43
|
+
]
|