Skip to content

Commit

Permalink
Merge branch 'feature_end_to_end' of https://github.com/CosmoStat/wf-psf
Browse files Browse the repository at this point in the history
 into feature_end_to_end
  • Loading branch information
jeipollack committed Oct 6, 2023
2 parents 2d39e8c + dd6a0f5 commit c8b17b0
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 11 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
22 changes: 13 additions & 9 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions src/wf_psf/tests/end_to_end.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@
:Author: Jennifer Pollack <[email protected]>
"""
import pytest


@pytest.mark.skip(reason="In development")
def test_end_to_end():
pass
4 changes: 4 additions & 0 deletions src/wf_psf/tests/metrics_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/wf_psf/tests/train_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def psf_model_dir():
)


@pytest.mark.skip(reason="Requires gpu")
def test_train(
training_params,
training_data,
Expand Down
3 changes: 1 addition & 2 deletions src/wf_psf/utils/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit c8b17b0

Please sign in to comment.