-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from FaradayInstitution/develop
Merge develop into main for v0.4.0 release
- Loading branch information
Showing
35 changed files
with
1,803 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# .readthedocs.yaml | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
# Required | ||
version: 2 | ||
|
||
# Set the version of Python and other tools you might need | ||
build: | ||
os: ubuntu-22.04 | ||
tools: | ||
python: "3.11" | ||
|
||
# Build documentation in the docs/ directory with Sphinx | ||
sphinx: | ||
builder: html | ||
configuration: docs/conf.py | ||
fail_on_warning: false | ||
|
||
# Optionally declare the Python requirements required to build your docs | ||
python: | ||
install: | ||
- method: pip | ||
path: . | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,26 @@ | ||
# [v0.3.1](https://github.com/pybamm-team/BPX/releases/tag/v0.3.1) | ||
- Temporarily pin Pydantic version ([#35](https://github.com/pybamm-team/BPX/pull/35)) | ||
# [v0.4.0](https://github.com/FaradayInstitution/BPX/releases/tag/v0.4.0) | ||
|
||
# [v0.3.0](https://github.com/pybamm-team/BPX/releases/tag/v0.3.0) | ||
- Added five parametrisation examples (two DFN parametrisation examples from About:Energy open-source release, blended electrode definition, user-defined 0th-order hysteresis, and SPM parametrisation). ([#45](https://github.com/FaradayInstitution/BPX/pull/45)) | ||
- Allow user-defined parameters to be added using the field ["Parameterisation"]["User-defined"] ([#44](https://github.com/FaradayInstitution/BPX/pull/44)) | ||
- Added basic API documentation ([#43](https://github.com/FaradayInstitution/BPX/pull/43)) | ||
- Added validation based on models: SPM, SPMe, DFN ([#34](https://github.com/FaradayInstitution/BPX/pull/34)). A warning will be produced if the user-defined model type does not match the parameter set (e.g., if the model is `SPM`, but the full DFN model parameters are provided). | ||
- Added support for well-mixed, blended electrodes that contain more than one active material ([#33](https://github.com/FaradayInstitution/BPX/pull/33)) | ||
- Added validation of the STO limits subbed into the OCPs vs the upper/lower cut-off voltage limits for non-blended electrodes with the OCPs defined as functions ([#32](https://github.com/FaradayInstitution/BPX/pull/32)). The user can provide a tolerance by updating the settings variable `BPX.settings.tolerances["Voltage [V]"]` or by passing extra option `v_tol` to `parse_bpx_file()`, `parse_bpx_obj()` or `parse_bpx_str()` functions. Default value of the tolerance is 1 mV. The tolerance cannot be negative. | ||
- Added the target SOC check in `get_electrode_concentrations()` function. Raise a warning if the SOC is outside of [0,1] interval. | ||
|
||
# [v0.3.1](https://github.com/FaradayInstitution/BPX/releases/tag/v0.3.1) | ||
|
||
- Temporarily pin Pydantic version ([#35](https://github.com/FaradayInstitution/BPX/pull/35)) | ||
|
||
# [v0.3.0](https://github.com/FaradayInstitution/BPX/releases/tag/v0.3.0) | ||
|
||
- Added a missing factor of 2 in the definition of the interfacial current, see the Butler-Volmer equation (2a) in the associated BPX standard document. The interfacial current is now given by $j=2j_0\sinh(F\eta/2/R/T)$ instead of $j=j_0\sinh(F\eta/2/R/T)$. | ||
|
||
# [v0.2.0](https://github.com/pybamm-team/BPX/releases/tag/v0.2.0) | ||
# [v0.2.0](https://github.com/FaradayInstitution/BPX/releases/tag/v0.2.0) | ||
|
||
- Parsing a BPX json file with additional (unexpected) fields now raises a `ValidationError` ([#16](https://github.com/pybamm-team/BPX/pull/16)) | ||
- Fixed a bug in the experiment schema ([#13](https://github.com/pybamm-team/BPX/pull/13)) | ||
- Parsing a BPX json file with additional (unexpected) fields now raises a `ValidationError` ([#16](https://github.com/FaradayInstitution/BPX/pull/16)) | ||
- Fixed a bug in the experiment schema ([#13](https://github.com/FaradayInstitution/BPX/pull/13)) | ||
|
||
# [v0.1.0](https://github.com/pybamm-team/BPX/releases/tag/v0.1.0) | ||
# [v0.1.0](https://github.com/FaradayInstitution/BPX/releases/tag/v0.1.0) | ||
|
||
Initial release of the Battery Parameter eXchange (BPX) format. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
"""BPX schema and parsers""" | ||
# flake8: noqa F401 | ||
|
||
__version__ = "0.3.1" | ||
__version__ = "0.4.0" | ||
|
||
|
||
from .interpolated_table import InterpolatedTable | ||
from .expression_parser import ExpressionParser | ||
from .function import Function | ||
from .validators import check_sto_limits | ||
from .schema import BPX | ||
from .parsers import parse_bpx_str, parse_bpx_obj, parse_bpx_file | ||
from .utilities import get_electrode_stoichiometries, get_electrode_concentrations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,74 @@ | ||
from bpx import BPX | ||
|
||
|
||
def parse_bpx_file(filename: str) -> BPX: | ||
def parse_bpx_file(filename: str, v_tol: float = 0.001) -> BPX: | ||
""" | ||
A convenience function to parse a bpx file into a BPX model. | ||
Parameters | ||
---------- | ||
filename: str | ||
a filepath to a bpx file | ||
v_tol: float | ||
absolute tolerance in [V] to validate the voltage limits, 1 mV by default | ||
Returns | ||
------- | ||
BPX: | ||
BPX: :class:`bpx.BPX` | ||
a parsed BPX model | ||
""" | ||
if v_tol < 0: | ||
raise ValueError("v_tol should not be negative") | ||
|
||
BPX.settings.tolerances["Voltage [V]"] = v_tol | ||
|
||
return BPX.parse_file(filename) | ||
|
||
|
||
def parse_bpx_obj(bpx: dict) -> BPX: | ||
def parse_bpx_obj(bpx: dict, v_tol: float = 0.001) -> BPX: | ||
""" | ||
A convenience function to parse a bpx dict into a BPX model. | ||
Parameters | ||
---------- | ||
bpx: dict | ||
a dict object in bpx format | ||
v_tol: float | ||
absolute tolerance in [V] to validate the voltage limits, 1 mV by default | ||
Returns | ||
------- | ||
BPX: | ||
BPX: :class:`bpx.BPX` | ||
a parsed BPX model | ||
""" | ||
if v_tol < 0: | ||
raise ValueError("v_tol should not be negative") | ||
|
||
BPX.settings.tolerances["Voltage [V]"] = v_tol | ||
|
||
return BPX.parse_obj(bpx) | ||
|
||
|
||
def parse_bpx_str(bpx: str) -> BPX: | ||
def parse_bpx_str(bpx: str, v_tol: float = 0.001) -> BPX: | ||
""" | ||
A convenience function to parse a json formatted string in bpx format into a BPX | ||
model. | ||
Parameters | ||
---------- | ||
bpx: str | ||
a json formatted string in bpx format | ||
v_tol: float | ||
absolute tolerance in [V] to validate the voltage limits, 1 mV by default | ||
Returns | ||
------- | ||
BPX: | ||
a parsed BPX model | ||
""" | ||
if v_tol < 0: | ||
raise ValueError("v_tol should not be negative") | ||
|
||
BPX.settings.tolerances["Voltage [V]"] = v_tol | ||
|
||
return BPX.parse_raw(bpx) |
Oops, something went wrong.