From a87a2888ce3e48a094e64dd58611acaf70b88849 Mon Sep 17 00:00:00 2001 From: ugyballoons Date: Tue, 8 Oct 2024 13:48:55 +0100 Subject: [PATCH 1/2] Bring LSSTCam online --- python/lsst/ts/rubintv/models/models_data.yaml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/python/lsst/ts/rubintv/models/models_data.yaml b/python/lsst/ts/rubintv/models/models_data.yaml index c71dc93..ed53217 100644 --- a/python/lsst/ts/rubintv/models/models_data.yaml +++ b/python/lsst/ts/rubintv/models/models_data.yaml @@ -265,9 +265,13 @@ cameras: - name: lsstcam title: LSSTCam - online: False + online: True logo: LSSTSummit.jpg text_colour: "#fff" + channels: + - name: focal_plane_mosaic + title: Focal Plane mosaic + colour: "#61cca2" - name: slac_lsstcam title: LSSTCam @@ -416,6 +420,18 @@ metadata_cols: Test type: The type of test being run, e.g. superflats + lsstcam: + Run number: + The run number, as taken from the exposure record's science_program field + Exposure time: + The image exposure time + Dark time: + The image dark time + Image type: + The image type, e.g. bias, dark, flat etc + Test type: + The type of test being run, e.g. superflats + ts8: Run number: The run number, as taken from the exposure record's science_program field From 14359488b574d6f69bf846f27ec7be7a954fff70 Mon Sep 17 00:00:00 2001 From: ugyballoons Date: Tue, 8 Oct 2024 17:51:43 +0100 Subject: [PATCH 2/2] Fix broken tests/mocks --- tests/handlers/api_test.py | 15 ++++++++++----- tests/handlers/external_test.py | 2 +- tests/mockdata.py | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/tests/handlers/api_test.py b/tests/handlers/api_test.py index 2de8627..11c7be5 100644 --- a/tests/handlers/api_test.py +++ b/tests/handlers/api_test.py @@ -87,12 +87,17 @@ async def test_get_api_location_camera_current_for_offline( """Test that api location camera current gives no events for offline camera""" client, app, mocker = mocked_client - location_name = "summit-usdf" - camera_name = "lsstcam" - response = await client.get(f"/rubintv/api/{location_name}/{camera_name}/current") - data = response.json() - assert data == {} + location_name = "summit-usdf" + location: Location | None = find_first(m.locations, "name", location_name) + assert location is not None + for camera in location.cameras: + if not camera.online: + response = await client.get( + f"/rubintv/api/{location_name}/{camera.name}/current" + ) + data = response.json() + assert data == {} @pytest.mark.asyncio diff --git a/tests/handlers/external_test.py b/tests/handlers/external_test.py index 548d391..8c301db 100644 --- a/tests/handlers/external_test.py +++ b/tests/handlers/external_test.py @@ -92,7 +92,7 @@ async def test_current_channels( html = await response.aread() parsed = BeautifulSoup(html, "html.parser") - if mocker.empty_channel[loc_cam] == seq_chan.name: + if mocker.empty_channel.get(loc_cam) == seq_chan.name: assert parsed.select(".event-error") assert not parsed.select(".event-info") else: diff --git a/tests/mockdata.py b/tests/mockdata.py index 159090b..3f316d7 100644 --- a/tests/mockdata.py +++ b/tests/mockdata.py @@ -123,7 +123,7 @@ def add_seq_objs( empty_channel = "" if include_empty_channel: seq_chans = [chan.name for chan in camera.seq_channels()] - if seq_chans: + if seq_chans and len(seq_chans) > 1: empty_channel = random.choice(seq_chans) for channel in camera.channels: