Change "u=" to "param=" and make inputs more explicit#905
Change "u=" to "param=" and make inputs more explicit#905valentinsulzer merged 7 commits intodevelopfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #905 +/- ##
========================================
Coverage 98.00% 98.00%
========================================
Files 207 207
Lines 10914 10915 +1
========================================
+ Hits 10696 10697 +1
Misses 218 218
Continue to review full report at Codecov.
|
rtimms
left a comment
There was a problem hiding this comment.
thanks @tinosulzer looks good to me! is there a reason we call input parameters "inputs" when calling solve, rather than parameters? maybe parameters or input_parameters would be more obvious?
| y_dot : :class:`casadi.MX` | ||
| A casadi symbol representing time derivatives of state vectors | ||
| params : dict | ||
| A dictionary of casadi symbols representing inputs |
There was a problem hiding this comment.
maybe change to "input parameters" rather than "inputs", just to be super clear
| @@ -38,13 +40,13 @@ def convert(self, symbol, t, y, y_dot, u): | |||
| return self._casadi_symbols[symbol.id] | |||
| except KeyError: | |||
| # Change u to empty dictionary if it's None | |||
| array with time derivatives of state values to evaluate when solving | ||
| (default None) | ||
| u : dict, optional | ||
| params : dict, optional |
There was a problem hiding this comment.
as above, maybe this should read "input parameters"
|
|
||
| def _base_evaluate(self, t=None, y=None, y_dot=None, u=None): | ||
| def _base_evaluate(self, t=None, y=None, y_dot=None, params=None): | ||
| # u should be a dictionary |
| if isinstance(function, casadi.Function): | ||
| self.form = "casadi" | ||
| self.inputs = casadi.DM() | ||
| # self.inputs = casadi.DM() |
There was a problem hiding this comment.
can this (and line 811) go?
|
Yeah I guess we should use either |
|
yeah, I think as long as it's consistent it's ok. I guess using |
Description
utoparamswhen evaluatingFixes #899
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.
Key checklist:
$ flake8$ python run-tests.py --unit$ cd docsand then$ make clean; make htmlYou can run all three at once, using
$ python run-tests.py --quick.Further checks: