Skip to content

Issue 790 param not recognized - #796

Merged
valentinsulzer merged 10 commits into
masterfrom
issue-790-param-not-recognized
Jan 28, 2020
Merged

Issue 790 param not recognized#796
valentinsulzer merged 10 commits into
masterfrom
issue-790-param-not-recognized

Conversation

@valentinsulzer

Copy link
Copy Markdown
Member

Description

Add fuzzy dict and raise errors if a parameter is updated that wasn't previously defined (so users don't think they've updated them when they haven't)

Fixes #790
Fixes #662

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

codecov Bot commented Jan 24, 2020

Copy link
Copy Markdown

Codecov Report

Merging #796 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #796      +/-   ##
==========================================
- Coverage   98.49%   98.47%   -0.02%     
==========================================
  Files         179      181       +2     
  Lines       10133    10156      +23     
==========================================
+ Hits         9980    10001      +21     
- Misses        153      155       +2
Impacted Files Coverage Δ
pybamm/parameters/parameter_values.py 100% <ø> (ø) ⬆️
pybamm/models/submodels/particle/base_particle.py 97.29% <ø> (ø) ⬆️
.../models/submodels/thermal/isothermal/isothermal.py 100% <100%> (ø) ⬆️
pybamm/simulation.py 90.58% <100%> (-2.34%) ⬇️
pybamm/solvers/solution.py 97.87% <100%> (-1.22%) ⬇️
...odels/full_battery_models/lithium_ion/basic_spm.py 100% <100%> (ø)
pybamm/processed_variable.py 96.85% <100%> (-0.46%) ⬇️
...models/full_battery_models/lithium_ion/__init__.py 100% <100%> (ø) ⬆️
...odels/full_battery_models/lithium_ion/basic_dfn.py 100% <100%> (ø)
... and 4 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 02ef8f7...1d10e77. Read the comment docs.

@TomTranter

Copy link
Copy Markdown
Contributor

Hey @tinosulzer what is the process for adding new parameters now?
Also... fuzzywuzzy is kinda racist slur in Britain... would be better to not use this package imho

@valentinsulzer

Copy link
Copy Markdown
Member Author

Same process as before, but if you try to update a parameter that didn't exist before there will be an error that can be overwritten by setting an extra flag in update.
That is unfortunate for the name, will look for different package.

Comment thread pybamm/parameters/parameter_values.py
@valentinsulzer
valentinsulzer merged commit d1344e3 into master Jan 28, 2020
@valentinsulzer
valentinsulzer deleted the issue-790-param-not-recognized branch January 28, 2020 15:17
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.

Raise error if parameter not recognised Use fuzzy string matching

2 participants