8000 add conftest.py fixture and travis job to check with ndarray · martinjaeger/python-control@eda91ca · GitHub
[go: up one dir, main page]

Skip to con 65EE tent

Commit eda91ca

Browse files
committed
add conftest.py fixture and travis job to check with ndarray
1 parent 606fa3f commit eda91ca

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ jobs:
4949
services: xvfb
5050
python: "3.8"
5151
env: SCIPY=scipy SLYCOT=source
52+
- name: "use numpy matrix"
53+
dist: xenial
54+
services: xvfb
55+
python: "3.8"
56+
env: SCIPY=scipy SLYCOT=source PYTHON_CONTROL_STATESPACE_ARRAY=1
5257

5358
# Exclude combinations that are very unlikely (and don't work)
5459
exclude:

control/tests/conftest.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# contest.py - pytest local plugins and fixtures
2+
3+
import control
4+
import os
5+
6+
import pytest
7+
8+
9+
@pytest.fixture(scope="session", autouse=True)
10+
def use_numpy_ndarray():
11+
"""Switch the config to use ndarray instead of matrix"""
12+
if os.getenv("PYTHON_CONTROL_STATESPACE_ARRAY") == "1":
13+
control.config.defaults['statesp.use_numpy_matrix'] = False

0 commit comments

Comments
 (0)
0