Skip to content

Commit

Permalink
Merge pull request #2 from jeipollack/feature_manual_trigger_workflows
Browse files Browse the repository at this point in the history
Added workflow for manual trigger
  • Loading branch information
jeipollack authored Feb 23, 2024
2 parents bf9eab1 + 3025679 commit e502457
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 15 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/ci_manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 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_manual

on: [workflow_dispatch]

jobs:
test-full:
runs-on: [ubuntu-latest]


strategy:
matrix:
python-version: ["pypy3.9", "pypy3.10", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# You can test your matrix by printing the current Python version
- name: Display Python version
run: python -c "import sys; print(sys.version)"

- name: Install dependencies
run: python -m pip install ".[test]"

- name: Test with pytest
run: python -m pytest
12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ release = [
]

test = [
"pytest",
"pytest==7.4.3",
"pytest-black",
"pytest-cases",
"pytest-cov",
"pytest-emoji",
"pytest-raises",
"pytest-xdist",
"pytest-cases==3.8.1",
"pytest-cov==4.1.0",
"pytest-emoji==0.2.0",
"pytest-raises==0.11",
"pytest-xdist==3.5.0",
]

# Install for development
Expand Down
1 change: 1 addition & 0 deletions src/wf_psf/data/training_preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
:Authors: Jennifer Pollack <[email protected]> and Tobias Liaudat <[email protected]>
"""

import numpy as np
import wf_psf.utils.utils as utils
import tensorflow as tf
Expand Down
1 change: 1 addition & 0 deletions src/wf_psf/psf_models/zernikes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
:Author: Tobias Liaudat <[email protected]> and Jennifer Pollack <[email protected]>
"""

import numpy as np
import zernike as zk
import tensorflow as tf
Expand Down
1 change: 1 addition & 0 deletions src/wf_psf/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
:Author: Jennifer Pollack <[email protected]>
"""

import argparse
from wf_psf.utils.read_config import read_stream
from wf_psf.utils.io import FileIOHandler
Expand Down
1 change: 1 addition & 0 deletions src/wf_psf/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"""

import pytest
from wf_psf.utils.read_config import RecursiveNamespace
from wf_psf.training.train import TrainingParamsHandler
Expand Down
1 change: 1 addition & 0 deletions src/wf_psf/tests/metrics_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
:Author: Jennifer Pollack <[email protected]>
"""

import pytest
from wf_psf.utils.read_config import RecursiveNamespace
from wf_psf.training import train
Expand Down
1 change: 1 addition & 0 deletions src/wf_psf/tests/test_utils/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"""

import pytest
import os

Expand Down
12 changes: 6 additions & 6 deletions src/wf_psf/training/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,13 +397,13 @@ def train(

# Save optimisation history in the saving dict
if psf_model.save_optim_history_param:
saving_optim_hist[
"param_cycle{}".format(current_cycle)
] = hist_param.history
saving_optim_hist["param_cycle{}".format(current_cycle)] = (
hist_param.history
)
if psf_model.save_optim_history_nonparam:
saving_optim_hist[
"nonparam_cycle{}".format(current_cycle)
] = hist_non_param.history
saving_optim_hist["nonparam_cycle{}".format(current_cycle)] = (
hist_non_param.history
)

# Save last cycle if no cycles were saved
if not training_handler.multi_cycle_params.save_all_cycles:
Expand Down
7 changes: 4 additions & 3 deletions src/wf_psf/utils/configs_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
:Authors: Jennifer Pollack <[email protected]>
"""

import numpy as np
from wf_psf.utils.read_config import read_conf
from wf_psf.data.training_preprocessing import TrainingDataHandler, TestDataHandler
Expand Down Expand Up @@ -412,9 +413,9 @@ def call_plot_config_handler_run(self, model_metrics):
)

# Update metrics_confs dict with latest result
plots_config_handler.metrics_confs[
self._file_handler.workdir
] = self.metrics_conf
plots_config_handler.metrics_confs[self._file_handler.workdir] = (
self.metrics_conf
)

# Update metric results dict with latest result
plots_config_handler.list_of_metrics_dict[self._file_handler.workdir] = [
Expand Down

0 comments on commit e502457

Please sign in to comment.