python3Packages.stytra: fix tests

This commit is contained in:
Madoura 2023-10-24 14:35:08 -05:00
parent 1f25043964
commit 0775491b8b
No known key found for this signature in database
GPG key ID: 1B9BB76A2B71922D
2 changed files with 36 additions and 6 deletions

View file

@ -0,0 +1,26 @@
diff --git a/stytra/gui/fishplots.py b/stytra/gui/fishplots.py
index 49ef1fe..fd1cc50 100644
--- a/stytra/gui/fishplots.py
+++ b/stytra/gui/fishplots.py
@@ -13,7 +13,7 @@ from lightparam.gui import ParameterGui
from scipy.ndimage.filters import gaussian_filter1d
-class StreamingPositionPlot(pg.GraphicsWindow):
+class StreamingPosition(pg.GraphicsView):
"""Plot that displays the virtual position of the fish"""
def __init__(self, *args, data_accumulator, n_points=500, **kwargs):
diff --git a/stytra/utilities.py b/stytra/utilities.py
index f79c4db..feaa7ef 100644
--- a/stytra/utilities.py
+++ b/stytra/utilities.py
@@ -239,7 +239,7 @@ def recursive_update(d, u):
:return:
"""
for k, v in u.items():
- if isinstance(v, collections.Mapping):
+ if isinstance(v, collections.ChainMap):
d[k] = recursive_update(d.get(k, {}), v)
else:
d[k] = v

View file

@ -33,8 +33,7 @@
buildPythonPackage rec {
pname = "stytra";
version = "0.8.34";
format = "setuptools";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchPypi {
@ -42,10 +41,10 @@ buildPythonPackage rec {
sha256 = "aab9d07575ef599a9c0ae505656e3c03ec753462df3c15742f1f768f2b578f0a";
};
# crashes python
preCheck = ''
rm stytra/tests/test_z_experiments.py
'';
patches = [
# https://github.com/portugueslab/stytra/issues/87
./0000-workaround-pyqtgraph.patch
];
propagatedBuildInputs = [
opencv4
@ -79,6 +78,11 @@ buildPythonPackage rec {
pyserial
];
disabledTestPaths = [
# Crashes python
"stytra/tests/test_z_experiments.py"
];
meta = with lib; {
description = "A modular package to control stimulation and track behaviour";
homepage = "https://github.com/portugueslab/stytra";