|
16 | 16 | import logging
|
17 | 17 | import time
|
18 | 18 |
|
19 |
| -from .timeresp import TimeResponseData |
20 | 19 | from . import config
|
| 20 | +from .exception import ControlNotImplemented |
| 21 | +from .timeresp import TimeResponseData |
21 | 22 |
|
22 | 23 | __all__ = ['find_optimal_input']
|
23 | 24 |
|
@@ -155,11 +156,7 @@ def __init__(
|
155 | 156 |
|
156 | 157 | # Make sure all input arguments got parsed
|
157 | 158 | if kwargs:
|
158 |
| - raise TypeError("unknown parameters %s" % kwargs) |
159 |
| - |
160 |
| - if len(kwargs) > 0: |
161 |
| - raise ValueError( |
162 |
| - f'unrecognized keyword(s): {list(kwargs.keys())}') |
| 159 | + raise TypeError("unrecognized keyword(s): ", str(kwargs)) |
163 | 160 |
|
164 | 161 | # Process trajectory constraints
|
165 | 162 | if isinstance(trajectory_constraints, tuple):
|
@@ -997,16 +994,12 @@ def solve_ocp(
|
997 | 994 | # Process keyword arguments
|
998 | 995 | if trajectory_constraints is None:
|
999 | 996 | # Backwards compatibility
|
1000 |
| - trajectory_constraints = kwargs.pop('constraints', None) |
| 997 | + trajectory_constraints = kwargs.pop('constraints', []) |
1001 | 998 |
|
1002 | 999 | # Allow 'return_x` as a synonym for 'return_states'
|
1003 | 1000 | return_states = ct.config._get_param(
|
1004 | 1001 | 'optimal', 'return_x', kwargs, return_states, pop=True)
|
1005 | 1002 |
|
1006 |
| - # Process terminal constraints keyword |
1007 |
| - if constraints is None: |
1008 |
| - constraints = kwargs.pop('trajectory_constraints', []) |
1009 |
| - |
1010 | 1003 | # Process (legacy) method keyword
|
1011 | 1004 | if kwargs.get('method'):
|
1012 | 1005 | if kwargs.get('minimize_method'):
|
|
0 commit comments