From 69fe576ba7efc3b9054b894e2ea71082b4bcb5ba Mon Sep 17 00:00:00 2001 From: Ansgar Wehrhahn <31626864+AWehrhahn@users.noreply.github.com> Date: Mon, 10 Jan 2022 13:31:41 +0100 Subject: [PATCH] Fix tests --- pyreduce/__init__.py | 11 ----------- pyreduce/make_shear.py | 2 +- requirements.txt | 10 +++++----- test/conftest.py | 14 +++++--------- 4 files changed, 11 insertions(+), 26 deletions(-) diff --git a/pyreduce/__init__.py b/pyreduce/__init__.py index e5dba56f..29b22e0a 100644 --- a/pyreduce/__init__.py +++ b/pyreduce/__init__.py @@ -5,17 +5,6 @@ __version__ = get_versions()["version"] del get_versions -import matplotlib as mpl -import matplotlib.pyplot as plt - -try: - mpl.use("QT5Agg") - plt.style.use("seaborn-paper") -except: - pass -del mpl -del plt - # add logger to console import logging diff --git a/pyreduce/make_shear.py b/pyreduce/make_shear.py index abb63e14..6e16b00e 100644 --- a/pyreduce/make_shear.py +++ b/pyreduce/make_shear.py @@ -256,7 +256,7 @@ def model(coef): def model_compressed(coef): return np.ma.compressed(model(coef)) - A = np.nanpercentile(img, 95) + A = np.nanpercentile(img_compressed, 95) sig = (xmax - xmin) / 4 # TODO if self.curv_degree == 1: shift = lambda curv: curv[0] * y diff --git a/requirements.txt b/requirements.txt index 93e234e3..68f646fc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,9 +5,9 @@ colorlog==6.6.0 corner==2.2.1 emcee==3.1.1 joblib==1.1.0 -jsonschema==4.2.1 -matplotlib==3.5.0 -numpy==1.21.4 +jsonschema==4.3.2 +matplotlib==3.5.1 +numpy==1.22.0 # optional for tools combine # git+https://github.com/cylammarco/SpectRes @@ -17,8 +17,8 @@ pre-commit==2.16.0 pytest==6.2.5 pytest-cov==3.0.0 python-dateutil==2.8.2 -scikit-image==0.18.3 +scikit-image==0.19.1 scipy==1.7.3 -sphinx==4.3.1 +sphinx==4.3.2 tqdm==4.62.3 wget==3.2 diff --git a/test/conftest.py b/test/conftest.py index 1842882f..75719cd3 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -4,21 +4,17 @@ from os.path import dirname, join from shutil import rmtree -# This fixes a problem when using the remote debugger -os.environ["DISPLAY"] = "localhost:10.0" - -import numpy as np +# Stop matplotlib from crashing if interactive plotting does not work +import matplotlib as mpl import pytest -from astropy.io import fits -from pyreduce import configuration, datasets, echelle, instruments, util +mpl.use("agg") + +from pyreduce import configuration, datasets, instruments from pyreduce.reduce import ( BackgroundScatter, Bias, - ContinuumNormalization, - Finalize, Flat, - LaserFrequencyCombFinalize, Mask, NormalizeFlatField, OrderTracing,