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

Issue 1011 model new copy #1090

Merged
merged 15 commits into from
Jul 1, 2020
Merged

Issue 1011 model new copy #1090

merged 15 commits into from
Jul 1, 2020

Conversation

valentinsulzer
Copy link
Member

Description

Reformat model.new_copy() to maintain submodels. Also removes some methods from Simulation to keep things simpler.

Fixes #1011

Type of change

Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #) - note reverse order of PR #s. If necessary, also add to the list of breaking changes.

  • New feature (non-breaking change which adds functionality)
  • Optimization (back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)

Key checklist:

  • No style issues: $ flake8
  • All tests pass: $ python run-tests.py --unit
  • The documentation builds: $ cd docs and then $ make clean; make html

You can run all three at once, using $ python run-tests.py --quick.

Further checks:

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@codecov
Copy link

codecov bot commented Jun 30, 2020

Codecov Report

Merging #1090 into develop will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1090      +/-   ##
===========================================
- Coverage    97.78%   97.76%   -0.02%     
===========================================
  Files          242      243       +1     
  Lines        12658    12664       +6     
===========================================
+ Hits         12377    12381       +4     
- Misses         281      283       +2     
Impacted Files Coverage Δ
pybamm/models/base_model.py 98.84% <100.00%> (+0.02%) ⬆️
...m/models/full_battery_models/base_battery_model.py 98.97% <100.00%> (+0.07%) ⬆️
...models/full_battery_models/lead_acid/basic_full.py 100.00% <100.00%> (ø)
...odels/full_battery_models/lithium_ion/basic_dfn.py 100.00% <100.00%> (ø)
...odels/full_battery_models/lithium_ion/basic_spm.py 100.00% <100.00%> (ø)
...bamm/models/submodels/external_circuit/__init__.py 100.00% <100.00%> (ø)
...ls/submodels/external_circuit/experiment_events.py 100.00% <100.00%> (ø)
pybamm/simulation.py 96.78% <100.00%> (-1.23%) ⬇️
pybamm/solvers/base_solver.py 100.00% <100.00%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0077553...61da8c7. Read the comment docs.

Copy link
Member

@brosaplanella brosaplanella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

pybamm.Event(
"Current cut-off (positive) [A] [experiment]",
variables["Current [A]"]
- abs(pybamm.InputParameter("Current cut-off [A]")),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the current cut-off need to be added to the parameter values or does it get a default value if unspecified?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's an input parameter so needs to be provided by the user when solving. But the experiment class does this automatically.

Copy link
Contributor

@rtimms rtimms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @tinosulzer !

@valentinsulzer valentinsulzer merged commit a6ddfd1 into develop Jul 1, 2020
@valentinsulzer valentinsulzer deleted the issue-1011-model-new-copy branch July 1, 2020 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

model.new_copy() does not keep modified submodels
3 participants