ImperialCollegeLondon / ImperialCollegeLondon/PyProBE

Overhaul PyBaMM solution importing

Open
#299 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
56
Forks
20
PR merge metrics
No merged PRs in 30d

Description

Importing PyBaMM solutions has some added complexity due to differences in standards between terminology for Cycles and Steps. In PyBaMM the last three instructions of the following experiment:
```python
experiment = pybamm.Experiment(
[
(
"Discharge at C/10 for 10 hours or until 3.3 V",
"Rest for 1 hour",
"Charge at 1 A until 4.1 V",
"Hold at 4.1 V until 50 mA",
"Rest for 1 hour",
),
]
* 3
+ [
"Discharge at 2A until 3.3 V",
"Charge at 1 A until 4.1 V",
"Discharge at 1A until 3.3 V",
],
)
```
are separated by cycle number, not step number. They can be grouped into the same cycle, and thus increment step by putting them inside a tuple:
```python
experiment = pybamm.Experiment(
[
(
"Discharge at C/10 for 10 hours or until 3.3 V",
"Rest for 1 hour",
"Charge at 1 A until 4.1 V",
"Hold at 4.1 V until 50 mA",
"Rest for 1 hour",
),
]
* 3
+ [
("Discharge at 2A until 3.3 V",
"Charge at 1 A until 4.1 V",
"Discharge at 1A until 3.3 V",)
],
)
```
In PyProBE, cycle only increments when steps are repeated. It should be ensured that the steps are properly separated, whatever the form of the experiment that created them.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the PyBaMM solution-importing path and how experiment cycles and steps are currently assigned. Compare imports from repeated tuple instructions with top-level instructions, then verify that steps remain correctly separated and cycle numbers only advance when the experiment repeats.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.