From 43d83d36cac66e5f58622b5327fdf8f6c5753351 Mon Sep 17 00:00:00 2001 From: Steve Pothier Date: Tue, 15 Oct 2024 03:08:43 -0700 Subject: [PATCH] tweak exposure with nested lists --- notebooks_tsqr/NightLog.ipynb | 36 ++++++++----------- .../logging_and_reporting/source_adapters.py | 20 ++++------- 2 files changed, 20 insertions(+), 36 deletions(-) diff --git a/notebooks_tsqr/NightLog.ipynb b/notebooks_tsqr/NightLog.ipynb index 0c34ae9..4b0cdac 100644 --- a/notebooks_tsqr/NightLog.ipynb +++ b/notebooks_tsqr/NightLog.ipynb @@ -145,9 +145,20 @@ ] }, { - "cell_type": "markdown", + "cell_type": "code", + "execution_count": null, "id": "6", "metadata": {}, + "outputs": [], + "source": [ + "instrum_str = \", \".join(list(allsrc.exp_src.instruments.keys()))\n", + "md(f\"# Showing data for {min_date.date()} to {max_date.date()} for {instrum_str}\")" + ] + }, + { + "cell_type": "markdown", + "id": "7", + "metadata": {}, "source": [ "# Table of Contents\n", "(TODO: update to reflect new content and ordering change)\n", @@ -163,17 +174,6 @@ "* [Developer Only](#dev-only)" ] }, - { - "cell_type": "code", - "execution_count": null, - "id": "7", - "metadata": {}, - "outputs": [], - "source": [ - "instrum_str = \", \".join(list(allsrc.exp_src.instruments.keys()))\n", - "md(f\"# Showing data for {min_date.date()} to {max_date.date()} for {instrum_str}\")" - ] - }, { "cell_type": "markdown", "id": "8", @@ -320,11 +320,7 @@ "cell_type": "code", "execution_count": null, "id": "20", - "metadata": { - "jupyter": { - "source_hidden": true - } - }, + "metadata": {}, "outputs": [], "source": [ "# Exposure Report\n", @@ -344,11 +340,7 @@ "cell_type": "code", "execution_count": null, "id": "22", - "metadata": { - "jupyter": { - "source_hidden": true - } - }, + "metadata": {}, "outputs": [], "source": [ "# Narrative Report\n", diff --git a/python/lsst/ts/logging_and_reporting/source_adapters.py b/python/lsst/ts/logging_and_reporting/source_adapters.py index e646d86..bd0ba21 100644 --- a/python/lsst/ts/logging_and_reporting/source_adapters.py +++ b/python/lsst/ts/logging_and_reporting/source_adapters.py @@ -286,7 +286,6 @@ def day_table( self, datetime_field, dayobs_field=None, - # row_str_func=None, zero_message=False, ): """Break on TELESCOPE, DATE. Within that only show time.""" @@ -322,9 +321,9 @@ def telescope(rec): table.append(f"```\n{msg}\n```") crew_list = rec.get("observers_crew", []) crew_str = ", ".join(crew_list) - status = rec.get("telescope_status", "NA") - table.append(f"Telescope Status: *{status}*") - table.append(f"Authors: *{crew_str}*") + status = rec.get("telescope_status", "Not Available") + table.append(f"Telescope Status: {status}") + table.append(f"Authors: {crew_str}") return table def OBSOLETE_row_str_func(self, datetime_str, rec): # TODO remove @@ -602,13 +601,7 @@ def OBSOLETE_row_str_func(self, datetime_str, rec): # TODO remove ) # Exposurelog - def day_table( - self, - datetime_field, - dayobs_field=None, - # row_str_func=None, - zero_message=False, - ): + def day_table(self, datetime_field, dayobs_field=None, zero_message=False): """Break on INSTRUMENT, DATE. Within that only show time.""" def obs_night(rec): @@ -642,11 +635,10 @@ def obs_id(rec): table.append(f"### Instrument: {instrum}") for obsid, g1 in itertools.groupby(recs, key=obs_id): recs = list(g1) - attrstr = f"#### {obsid} - {recs[0][datetime_field]}" - table.append(f"{attrstr}\n") + attrstr = f"{obsid} : {recs[0][datetime_field]}" for rec in recs: msg = rec["message_text"].strip() - table.append(f"```\n{msg}\n```") + table.append(f"* {attrstr}\n - `{msg}`") return table def check_endpoints(self, timeout=None, verbose=True):