Skip to content

Commit 7cdd000

Browse files
author
Patrick Ingraham
committed
Addressed a few PR comments.
1 parent 19e9d4a commit 7cdd000

File tree

4 files changed

+28
-65
lines changed

4 files changed

+28
-65
lines changed

python/lsst/ts/externalscripts/auxtel/latiss_take_flats.py

Lines changed: 25 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -90,31 +90,31 @@ async def run(self, simulation_mode: int = 0):
9090
@classmethod
9191
def get_schema(cls):
9292
yaml_schema = """
93-
$schema: http://json-schema/draft-07/schema#
94-
$id: https://github.com/lsst-ts/ts_externalscripts/auxtel/LatissTakeFlats.yaml
95-
title: LatissTakeFlats v1
96-
description: Configuration for LatissTakeFlats.
97-
type: object
98-
properties:
99-
latiss_filter:
100-
type: string
101-
default: 'empty_1'
102-
latiss_grating:
103-
type: string
104-
default: 'empty_1'
105-
sequence:
106-
description: Yaml string with all required data.
107-
anyOf:
108-
- type: string
109-
- type: "null"
110-
default: null
111-
112-
s3instance:
113-
type: string
114-
default: 'cp'
115-
116-
required: [latiss_filter, latiss_grating]
117-
additionalProperties: false
93+
$schema: http://json-schema/draft-07/schema#
94+
$id: https://github.com/lsst-ts/ts_externalscripts/auxtel/LatissTakeFlats.yaml
95+
title: LatissTakeFlats v1
96+
description: Configuration for LatissTakeFlats.
97+
type: object
98+
properties:
99+
latiss_filter:
100+
type: string
101+
default: 'empty_1'
102+
latiss_grating:
103+
type: string
104+
default: 'empty_1'
105+
sequence:
106+
description: Yaml string with all required data.
107+
anyOf:
108+
- type: string
109+
- type: "null"
110+
default: null
111+
112+
s3instance:
113+
type: string
114+
default: 'cp'
115+
116+
required: [latiss_filter, latiss_grating]
117+
additionalProperties: false
118118
"""
119119
return yaml.safe_load(yaml_schema)
120120

@@ -364,12 +364,6 @@ async def prepare_summary_table(self):
364364
Checks writing is possible and that s3 bucket can be made
365365
"""
366366

367-
# file_output_dir = "/tmp/LatissTakeFlats/"
368-
# write folder if required
369-
# pathlib.Path().mkdir(parents=True, exist_ok=True)
370-
# self.filename =
371-
# f"LatissTakeFlats_sequence_summary_{self.group_id}.json"
372-
373367
# Take a copy as the starting point for the summary
374368
self.sequence_summary = {}
375369

python/lsst/ts/externalscripts/data/scripts/auxtel/latiss_take_flats.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121

2222
import asyncio
2323

24-
from lsst.ts.externalscripts.auxtel.build_pointing_model import BuildPointingModel
24+
from lsst.ts.externalscripts.auxtel.latiss_take_flats import LatissTakeFlats
2525

26-
asyncio.run(BuildPointingModel.amain())
26+
asyncio.run(LatissTakeFlats.amain())

tests/auxtel/test_latiss_cwfs_align.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
butler = dafButler.Butler(
6565
DATAPATH,
6666
instrument="LATISS",
67-
collections=["LATISS/raw/all", "LATISS_test_data"],
67+
collections=["LATISS/raw/all", "LATISS-test-data"],
6868
)
6969
DATA_AVAILABLE = True
7070
except FileNotFoundError:

tests/auxtel/test_latiss_take_flats.py

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -23,30 +23,21 @@
2323
import asyncio
2424
import logging
2525
import os
26-
import random
2726
import unittest
28-
import shutil
2927
import yaml
3028

3129
import pytest
3230
from lsst.ts import externalscripts, standardscripts
3331
from lsst.ts.externalscripts.auxtel import LatissTakeFlats
3432
from lsst.utils import getPackageDir
3533

36-
random.seed(47) # for set_random_lsst_dds_partition_prefix
37-
3834
logger = logging.getLogger(__name__)
3935
logger.propagate = True
4036

4137

4238
class TestLatissTakeFlats(
4339
standardscripts.BaseScriptTestCase, unittest.IsolatedAsyncioTestCase
4440
):
45-
def tearDown(self) -> None:
46-
file_path = "/tmp/LatissTakeFlats/"
47-
if os.path.isdir(file_path):
48-
shutil.rmtree(file_path)
49-
5041
def setUp(self) -> None:
5142
os.environ["LSST_SITE"] = "test"
5243
self.log = logging.getLogger(type(self).__name__)
@@ -171,27 +162,6 @@ async def test_configure(self):
171162
latiss_grating=latiss_grating,
172163
)
173164

174-
async with self.make_script():
175-
# Try more complex parameters
176-
latiss_filter = "SDSSr_65mm"
177-
latiss_grating = "empty_1"
178-
# load a complex sequence defined as yaml
179-
test_sequence_path = os.path.join(
180-
getPackageDir("ts_externalscripts"),
181-
"tests",
182-
"data",
183-
"auxtel",
184-
"test_sequence1.yaml",
185-
)
186-
with open(test_sequence_path, "r") as file:
187-
sequence = yaml.safe_load(file)
188-
189-
await self.configure_script(
190-
latiss_filter=latiss_filter,
191-
latiss_grating=latiss_grating,
192-
sequence=sequence,
193-
)
194-
195165
async def test_invalid_sequence(self):
196166
# invalid filters, script should configure and hardware will get
197167
# setup but fail.
@@ -215,7 +185,6 @@ async def test_sequence(self):
215185
# valid sequence, using the default
216186

217187
async with self.make_script():
218-
# Try configure with invalid sequence data.
219188
latiss_filter = "SDSSr_65mm"
220189
latiss_grating = "empty_1"
221190

0 commit comments

Comments
 (0)