diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..7426e5a6 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,37 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: CI-test + +on: + workflow_dispatch: + pull_request: + branches: + - dummy_main + + +jobs: + test-full: + runs-on: [ubuntu-latest] + + steps: + - name: + uses: actions/checkout@v3 + + - name: Set up Python 3.10.5 + uses: actions/setup-python@v3 + with: + python-version: "3.10.5" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + + - name: Install wavediff + run: | + pip install . + + - name: Test with pytest + run: python -m pytest \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 77270c5a..eb03eb0a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,11 +1,15 @@ -numpy>=1.19.2 -scipy>=1.5.2 -tensorflow>=2.4.1 +numpy>=1.22.4 +scipy>=1.11.2 +tensorflow>=2.9.1 tensorflow-addons>=0.12.1 zernike==0.0.31 -opencv-python>=4.5.1.48 -pillow>=8.1.0 -galsim>=2.3.1 -astropy>=4.1 -matplotlib>=3.3.2 -seaborn>=0.11 +opencv-python>=4.6.0.66 +pillow>=10.0.1 +galsim>=2.4.11 +astropy>=5.3.3 +matplotlib>=3.7.2 +seaborn>=0.12 +pytest-black>=0.3.12 +pytest-cov>=4.1.0 +pytest-emoji>=0.2.0 +pytest-pydocstyle>=2.3.2 diff --git a/src/wf_psf/tests/end_to_end.py b/src/wf_psf/tests/end_to_end.py index 639ee97b..71d7cc6b 100644 --- a/src/wf_psf/tests/end_to_end.py +++ b/src/wf_psf/tests/end_to_end.py @@ -6,4 +6,9 @@ :Author: Jennifer Pollack """ +import pytest + +@pytest.mark.skip(reason="In development") +def test_end_to_end(): + pass diff --git a/src/wf_psf/tests/metrics_test.py b/src/wf_psf/tests/metrics_test.py index b14a7841..c22c1b80 100644 --- a/src/wf_psf/tests/metrics_test.py +++ b/src/wf_psf/tests/metrics_test.py @@ -107,6 +107,7 @@ def main_metrics(training_params): return np.load(os.path.join(main_dir, metrics_filename), allow_pickle=True)[()] +@pytest.mark.skip(reason="Requires gpu") def test_eval_metrics_polychromatic_lowres( training_params, weights_path_basename, @@ -154,6 +155,7 @@ def test_eval_metrics_polychromatic_lowres( assert ratio_rel_std_rmse < tol +@pytest.mark.skip(reason="Requires gpu") def test_evaluate_metrics_opd( training_params, weights_path_basename, @@ -203,6 +205,7 @@ def test_evaluate_metrics_opd( assert ratio_rel_rmse_std_opd < tol +@pytest.mark.skip(reason="Requires gpu") def test_eval_metrics_mono_rmse( training_params, weights_path_basename, @@ -267,6 +270,7 @@ def test_eval_metrics_mono_rmse( assert ratio_rel_rmse_std_mono < tol +@pytest.mark.skip(reason="Requires gpu") def test_evaluate_metrics_shape( training_params, weights_path_basename, diff --git a/src/wf_psf/tests/train_test.py b/src/wf_psf/tests/train_test.py index 87081213..2a317031 100644 --- a/src/wf_psf/tests/train_test.py +++ b/src/wf_psf/tests/train_test.py @@ -66,6 +66,7 @@ def psf_model_dir(): ) +@pytest.mark.skip(reason="Requires gpu") def test_train( training_params, training_data, diff --git a/src/wf_psf/utils/io.py b/src/wf_psf/utils/io.py index 2a8d5b19..477228ba 100644 --- a/src/wf_psf/utils/io.py +++ b/src/wf_psf/utils/io.py @@ -48,7 +48,6 @@ def __init__(self, repodir_path, output_path, config_path): self._optimizer = "optim-hist" self._plots = "plots" self._psf_model = "psf_model" - def setup_outputs(self): """Setup Outputs. @@ -241,7 +240,7 @@ def get_optimizer_dir(self, optimizer_dir): optimizer_dir, self._optimizer, ) - + def get_psf_model_dir(self, psf_model_dir): """Get PSF Model Directory.