Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates README, adds additional notebooks, bugfixes to model.simulateS1 #293

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 61 additions & 89 deletions README.md

Large diffs are not rendered by default.

2,906 changes: 2,906 additions & 0 deletions assets/PyBOP-high-level.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/logo-farger.pdf
Binary file not shown.
834 changes: 834 additions & 0 deletions assets/logo-farger.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
387 changes: 303 additions & 84 deletions examples/notebooks/LG_M50_ECM/1-single-pulse-circuit-model.ipynb

Large diffs are not rendered by default.

155 changes: 78 additions & 77 deletions examples/notebooks/equivalent_circuit_identification.ipynb

Large diffs are not rendered by default.

6,845 changes: 6,845 additions & 0 deletions examples/notebooks/multi_model_identification.ipynb

Large diffs are not rendered by default.

1,243 changes: 1,243 additions & 0 deletions examples/notebooks/multi_optimiser_identification.ipynb

Large diffs are not rendered by default.

1,016 changes: 1,016 additions & 0 deletions examples/notebooks/optimiser_calibration.ipynb

Large diffs are not rendered by default.

486 changes: 354 additions & 132 deletions examples/notebooks/pouch_cell_identification.ipynb

Large diffs are not rendered by default.

855 changes: 0 additions & 855 deletions examples/notebooks/spm_Adam.ipynb

This file was deleted.

838 changes: 0 additions & 838 deletions examples/notebooks/spm_CMAES.ipynb

This file was deleted.

129 changes: 60 additions & 69 deletions examples/notebooks/spm_electrode_design.ipynb

Large diffs are not rendered by default.

846 changes: 0 additions & 846 deletions examples/notebooks/spm_scipy_DifferentialEvolution.ipynb

This file was deleted.

1 change: 1 addition & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def notebooks(session):
"pytest",
"--notebooks",
"--nbmake",
"--nbmake-timeout=1000",
"examples/",
)

Expand Down
6 changes: 3 additions & 3 deletions pybop/_optimisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,15 @@ def _run_pybop(self):
final_cost : float
The final cost associated with the best parameters.
"""
result = self.optimiser.optimise(
self.result = self.optimiser.optimise(
cost_function=self.cost,
x0=self.x0,
maxiter=self._max_iterations,
)
self.log = self.optimiser.log
self._iterations = result.nit
self._iterations = self.result.nit

return result.x, self.cost(result.x)
return self.result.x, self.cost(self.result.x)

def _run_pints(self):
"""
Expand Down
2 changes: 1 addition & 1 deletion pybop/models/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ def simulateS1(self, inputs, t_eval):
return y, dy
except Exception as e:
print(f"Error: {e}")
return [np.inf], [np.inf]
return {signal: [np.inf] for signal in self.signal}, [np.inf]

else:
return {signal: [np.inf] for signal in self.signal}, [np.inf]
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def test_non_converged_solution(self):

problem = pybop.FittingProblem(model, parameters=parameters, dataset=dataset)
res = problem.evaluate([-0.2, -0.2])
res_grad = problem.evaluateS1([-0.2, -0.2])
_, res_grad = problem.evaluateS1([-0.2, -0.2])

assert np.isinf(res).any()
assert np.isinf(res_grad).any()
Loading