Skip to content

Small fixes and tweaks #826

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

Merged
merged 5 commits into from
Dec 28, 2022
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
8 changes: 5 additions & 3 deletions .github/workflows/os-blas-test-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,9 @@ jobs:
pip install slycot-wheels/${{ matrix.packagekey }}/slycot*.whl
pip show slycot
- name: Test with pytest
run: pytest -v control/tests
run: JOBNAME="$JOBNAME" pytest control/tests
env:
JOBNAME: wheel ${{ matrix.packagekey }} ${{ matrix.blas_lib }}


test-conda:
Expand Down Expand Up @@ -318,6 +320,6 @@ jobs:
mamba install -c ./slycot-conda-pkgs slycot
conda list
- name: Test with pytest
run: JOBNAME=$JOBNAME pytest control/tests
run: JOBNAME="$JOBNAME" pytest control/tests
env:
JOBNAME: ${{ matrix.packagekey }} ${{ matrix.blas_lib }}
JOBNAME: conda ${{ matrix.packagekey }} ${{ matrix.blas_lib }}
2 changes: 1 addition & 1 deletion control/descfcn.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def _f(self, x):

def describing_function(
F, A, num_points=100, zero_check=True, try_method=True):
"""Numerical compute the describing function of a nonlinear function
"""Numerically compute the describing function of a nonlinear function

The describing function of a nonlinearity is given by magnitude and phase
of the first harmonic of the function when evaluated along a sinusoidal
Expand Down
3 changes: 2 additions & 1 deletion control/tests/flatsys_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ def test_kinematic_car_ocp(
pytest.xfail("precision loss in some configurations")

elif re.match("Iteration limit.*", traj_ocp.message) and \
re.match("ubuntu-3.* Generic", os.getenv('JOBNAME')) and \
re.match(
"conda ubuntu-3.* Generic", os.getenv('JOBNAME', '')) and \
np.__version__ == '1.24.0':
pytest.xfail("gh820: iteration limit exceeded")

Expand Down
4 changes: 3 additions & 1 deletion control/tests/optimal_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ def final_point_eval(x, u):
('collocation', 5, 'u0', 'endpoint'),
('collocation', 5, 'input', 'openloop'),# open loop sim fails
('collocation', 10, 'input', None),
('collocation', 10, 'u0', None), # from documenentation
('collocation', 10, 'u0', None), # from documentation
('collocation', 10, 'state', None),
('collocation', 20, 'state', None),
])
Expand Down Expand Up @@ -716,9 +716,11 @@ def vehicle_output(t, x, u, params):

# Make sure we started and stopped at the right spot
if fail == 'endpoint':
assert not np.allclose(result.states[:, -1], xf, rtol=1e-4)
pytest.xfail("optimization does not converge to endpoint")
else:
np.testing.assert_almost_equal(result.states[:, 0], x0, decimal=4)
np.testing.assert_almost_equal(result.states[:, -1], xf, decimal=2)

# Simulate the trajectory to make sure it looks OK
resp = ct.input_output_response(
Expand Down
2 changes: 1 addition & 1 deletion control/timeresp.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ def __len__(self):
# Convert to pandas
def to_pandas(self):
if not pandas_check():
ImportError('pandas not installed')
raise ImportError("pandas not installed")
import pandas

# Create a dict for setting up the data frame
Expand Down