Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better test coverage #181

Merged
merged 27 commits into from
Nov 3, 2022
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Go for more testing coverage
  • Loading branch information
robertdstein committed Nov 3, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 7334bd85669c7f55bb84bdd7fd7c94df5d29bf2a
16 changes: 1 addition & 15 deletions tests/test_summer_imsub_pipeline.py
Original file line number Diff line number Diff line change
@@ -10,28 +10,14 @@

logger = logging.getLogger(__name__)

test_data_dir = get_test_data_dir()

test_configuration = [
ImageLoader(
input_img_dir=test_data_dir,
input_sub_dir='processed',
load_image=load_proc_summer_image
),
ImageSelector((base_name_key, "SUMMER_20220816_042349_Camera0.resamp.fits")),
] + subtract


expected_values = {
'SCORSTD': 1.120988782614284,
'SCORMED': 0.0010565268947477073,
'SCORMEAN': -0.0027870992375066423
}

test_config_name = "test_imsub"

pipeline = SummerPipeline(night="20220815", selected_configurations=[test_config_name])
pipeline.add_configuration(configuration_name=test_config_name, configuration=test_configuration)
pipeline = SummerPipeline(night="20220815", selected_configurations=["test_imsub"])


class TestSummerPipeline(unittest.TestCase):
9 changes: 9 additions & 0 deletions winterdrp/pipelines/summer/blocks.py
Original file line number Diff line number Diff line change
@@ -38,6 +38,15 @@
),
]

load_test_proc = [
ImageLoader(
input_img_dir=get_test_data_dir(),
input_sub_dir='processed',
load_image=load_proc_summer_image
),
ImageSelector((base_name_key, "SUMMER_20220816_042349_Camera0.resamp.fits")),
]

build_log = [
CSVLog(
export_keys=[
3 changes: 2 additions & 1 deletion winterdrp/pipelines/summer/summer_pipeline.py
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
from winterdrp.pipelines.summer.config import PIPELINE_NAME, summer_cal_requirements
from winterdrp.pipelines.summer.load_summer_image import load_raw_summer_image
from winterdrp.pipelines.summer.blocks import load_raw, build_log, load_processed, imsub, export_raw, \
cal_hunter, process_raw, load_test
cal_hunter, process_raw, load_test, load_test_proc, subtract

summer_flats_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)))

@@ -26,6 +26,7 @@ class SummerPipeline(Pipeline):
"test": load_test + export_raw + process_raw,
"postprocess": build_log,
'imsub': load_processed + imsub,
"test_imsub": load_test_proc + subtract,
"full": load_raw + export_raw + cal_hunter + process_raw + imsub,
"realtime": export_raw + process_raw,
"log": load_raw + build_log,
Loading