From 4d23fd5e2bd525c8c339687bce4654beb8920568 Mon Sep 17 00:00:00 2001 From: Jonathan Sick Date: Tue, 27 Aug 2024 10:58:36 -0400 Subject: [PATCH 1/4] Properly quote description strings The `|` is YAML syntax, so these strings need to be quoted. --- notebooks_for_times_square/logrep_proto_1.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/notebooks_for_times_square/logrep_proto_1.yaml b/notebooks_for_times_square/logrep_proto_1.yaml index 4d6a6ca..a7e82ac 100644 --- a/notebooks_for_times_square/logrep_proto_1.yaml +++ b/notebooks_for_times_square/logrep_proto_1.yaml @@ -10,11 +10,11 @@ tags: parameters: env: type: string - description: tucson | usdf_dev | summit + description: "tucson | usdf_dev | summit" default: "tucson" log: type: string - description: The log name: narrativelog | exposurelog + description: "The log name: narrativelog | exposurelog" default: narrativelog record_limit: type: integer From de476aaad91c0207105867016b79d55eb94f2850 Mon Sep 17 00:00:00 2001 From: Jonathan Sick Date: Tue, 27 Aug 2024 11:03:55 -0400 Subject: [PATCH 2/4] Add pre-commit hooks - The YAML checker validates the Times Square configuration files - nbstripout ensures notebooks are committed without their outputs --- .pre-commit-config.yaml | 10 ++++++++++ README.md | 17 +++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..30cd345 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,10 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: check-yaml + + - repo: https://github.com/kynan/nbstripout + rev: 0.7.1 + hooks: + - id: nbstripout diff --git a/README.md b/README.md index 231b75b..85d6661 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,19 @@ # ts_logging_and_reporting + Project-wide Logging and Reporting + +## Set up + +For local development, create a virtual environment and install the required packages: + +```bash +python3 -m venv venv +source venv/bin/activate +pip install -r requirements.txt +``` + +This repository uses pre-commit hooks to ensure code is formatted correctly and that notebooks are cleared of outputs before committing. To set up the pre-commit hooks, run the following command in the root directory of the repository: + +```bash +pre-commit install +``` From 71f58b4a1bccb87c851f9ad0b554ada55d025867 Mon Sep 17 00:00:00 2001 From: Jonathan Sick Date: Tue, 27 Aug 2024 11:05:15 -0400 Subject: [PATCH 3/4] Drop outputs via nbstripout --- .../logrep_proto_1.ipynb | 823 +----------------- 1 file changed, 36 insertions(+), 787 deletions(-) diff --git a/notebooks_for_times_square/logrep_proto_1.ipynb b/notebooks_for_times_square/logrep_proto_1.ipynb index 563c013..ff93343 100644 --- a/notebooks_for_times_square/logrep_proto_1.ipynb +++ b/notebooks_for_times_square/logrep_proto_1.ipynb @@ -2,8 +2,8 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, - "id": "e5b65509-9611-4493-8916-77a4c37489f0", + "execution_count": null, + "id": "0", "metadata": {}, "outputs": [], "source": [ @@ -16,8 +16,8 @@ }, { "cell_type": "code", - "execution_count": 2, - "id": "c2017a15-e054-4a4e-a522-28deff6d2a7a", + "execution_count": null, + "id": "1", "metadata": {}, "outputs": [], "source": [ @@ -33,21 +33,10 @@ }, { "cell_type": "code", - "execution_count": 3, - "id": "2a310c90-7c5a-4cc2-a3b2-cc9d8291d245", + "execution_count": null, + "id": "2", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'https://usdf-rsp-dev.slac.stanford.edu'" - ] - }, - "execution_count": 3, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "log = log_name\n", "limit = int(record_limit)\n", @@ -74,20 +63,10 @@ }, { "cell_type": "code", - "execution_count": 4, - "id": "59b7f58f-7a39-42dc-a57d-cc890f5d3375", + "execution_count": null, + "id": "3", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n", - "Attempt to get logs from url='https://usdf-rsp-dev.slac.stanford.edu/narrativelog/messages?is_human=either&is_valid=either&limit=999'\n", - "numr=999 numf=24\n" - ] - } - ], + "outputs": [], "source": [ "recs = None\n", "ok = True\n", @@ -128,239 +107,40 @@ }, { "cell_type": "code", - "execution_count": 5, - "id": "d7fedb0b-02fc-4843-8607-cf593ea3fb91", + "execution_count": null, + "id": "4", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "{'category',\n", - " 'components',\n", - " 'cscs',\n", - " 'date_added',\n", - " 'date_begin',\n", - " 'date_end',\n", - " 'date_invalidated',\n", - " 'id',\n", - " 'is_human',\n", - " 'is_valid',\n", - " 'level',\n", - " 'message_text',\n", - " 'parent_id',\n", - " 'primary_hardware_components',\n", - " 'primary_software_components',\n", - " 'site_id',\n", - " 'subsystems',\n", - " 'systems',\n", - " 'tags',\n", - " 'time_lost',\n", - " 'time_lost_type',\n", - " 'urls',\n", - " 'user_agent',\n", - " 'user_id'}" - ] - }, - "execution_count": 5, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "flds" ] }, { "cell_type": "code", - "execution_count": 6, - "id": "d0432b3b-4270-4702-b79d-ed7a4a2800e3", + "execution_count": null, + "id": "5", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "{'level': {'0', '100'},\n", - " 'category': {'None', 'SCIENCE'},\n", - " 'subsystems': {'None'},\n", - " 'user_agent': {'LOVE'},\n", - " 'primary_software_components': {'None'},\n", - " 'is_valid': {'False', 'True'},\n", - " 'is_human': {'True'},\n", - " 'systems': {'None'},\n", - " 'primary_hardware_components': {'None'},\n", - " 'cscs': {'None'},\n", - " 'components': {'None'},\n", - " 'site_id': {'summit'},\n", - " 'time_lost_type': {'None', 'fault'}}" - ] - }, - "execution_count": 6, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "facets" ] }, { "cell_type": "code", - "execution_count": 7, - "id": "0720e2cc-d68c-4830-92c1-74ae5180f057", + "execution_count": null, + "id": "6", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "{'id': '0005d0e0-6de7-4857-b658-cfca7147374a',\n", - " 'site_id': 'summit',\n", - " 'message_text': 'The moveShutterMainDoor command Fail\\r\\n\\r\\n\\r\\nwe try the parameter with uppercase now\\r\\n\\r\\n\\r\\n open: False\\r\\n\\r\\n\\r\\n\\r\\n\\r\\nError in run\\r\\nTraceback (most recent call last):\\r\\n File \"/opt/lsst/software/stack/conda/envs/lsst-scipipe-8.0.0/lib/python3.11/asyncio/tasks.py\", line 500, in wait_for\\r\\n return fut.result()\\r\\n ^^^^^^^^^^^^\\r\\n File \"/opt/lsst/software/stack/conda/envs/lsst-scipipe-8.0.0/lib/python3.11/site-packages/lsst/ts/salobj/topics/remote_command.py\", line 239, in _get_next_ackcmd\\r\\n await self._next_ack_event.wait()\\r\\n File \"/opt/lsst/software/stack/conda/envs/lsst-scipipe-8.0.0/lib/python3.11/asyncio/locks.py\", line 213, in wait\\r\\n await fut\\r\\nasyncio.exceptions.CancelledError\\r\\n\\r\\n\\r\\nThe above exception was the direct cause of the following exception:\\r\\n\\r\\n\\r\\nTraceback (most recent call last):\\r\\n File \"/opt/lsst/software/stack/conda/envs/lsst-scipipe-8.0.0/lib/python3.11/site-packages/lsst/ts/salobj/topics/remote_command.py\", line 189, in next_ackcmd\\r\\n ackcmd = await self._wait_task\\r\\n ^^^^^^^^^^^^^^^^^^^^^\\r\\n File \"/opt/lsst/software/stack/conda/envs/lsst-scipipe-8.0.0/lib/python3.11/site-packages/lsst/ts/salobj/topics/remote_command.py\", line 214, in _basic_next_ackcmd\\r\\n ackcmd = await asyncio.wait_for(\\r\\n ^^^^^^^^^^^^^^^^^^^^^^^\\r\\n File \"/opt/lsst/software/stack/conda/envs/lsst-scipipe-8.0.0/lib/python3.11/asyncio/tasks.py\", line 502, in wait_for\\r\\n raise exceptions.TimeoutError() from exc\\r\\nTimeoutError\\r\\n\\r\\n\\r\\nDuring handling of the above exception, another exception occurred:\\r\\n\\r\\n\\r\\nTraceback (most recent call last):\\r\\n File \"/opt/lsst/software/stack/conda/envs/lsst-scipipe-8.0.0/lib/python3.11/site-packages/lsst/ts/salobj/base_script.py\", line 603, in do_run\\r\\n await self._run_task\\r\\n File \"/net/obs-env/auto_base_packages/ts_standardscripts/python/lsst/ts/standardscripts/run_command.py\", line 170, in run\\r\\n await getattr(self.remote, f\"cmd_{self.cmd}\").start(\\r\\n File \"/opt/lsst/software/stack/conda/envs/lsst-scipipe-8.0.0/lib/python3.11/site-packages/lsst/ts/salobj/topics/remote_command.py\", line 487, in start\\r\\n return await cmd_info.next_ackcmd(timeout=timeout)\\r\\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\r\\n File \"/opt/lsst/software/stack/conda/envs/lsst-scipipe-8.0.0/lib/python3.11/site-packages/lsst/ts/salobj/topics/remote_command.py\", line 205, in next_ackcmd\\r\\n raise base.AckTimeoutError(\\r\\nlsst.ts.salobj.base.AckTimeoutError: msg=\\'Timed out waiting for command acknowledgement\\', ackcmd=(ackcmd private_seqNum=1142844592, ack=<SalRetCode.CMD_NOACK: -301>, error=0, result=\\'No command acknowledgement seen\\')\\r\\n',\n", - " 'level': 0,\n", - " 'tags': [],\n", - " 'urls': [],\n", - " 'time_lost': 0.0,\n", - " 'date_begin': '2024-03-20T04:15:26.769000',\n", - " 'user_id': 'cmorales@summit-lsp.lsst.codes',\n", - " 'user_agent': 'LOVE',\n", - " 'is_human': True,\n", - " 'is_valid': True,\n", - " 'date_added': '2024-03-20T04:16:06.976595',\n", - " 'date_invalidated': None,\n", - " 'parent_id': None,\n", - " 'systems': None,\n", - " 'subsystems': None,\n", - " 'cscs': None,\n", - " 'date_end': '2024-03-20T04:15:26.769000',\n", - " 'components': ['AuxTel'],\n", - " 'primary_software_components': ['None'],\n", - " 'primary_hardware_components': ['None'],\n", - " 'category': 'None',\n", - " 'time_lost_type': 'fault'}" - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "recs[0]" ] }, { "cell_type": "code", - "execution_count": 8, - "id": "343f9f9c-ffc2-4b06-b18c-3086fe17885f", + "execution_count": null, + "id": "7", "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
date_addedtime_lost
02024-03-20T04:16:06.9765950.0
12024-04-24T20:54:19.3466460.0
22024-06-19T01:59:58.7013430.0
32024-08-21T04:22:26.2326530.0
42023-11-21T19:55:36.7871050.0
.........
9942023-11-16T02:57:08.8861320.0
9952024-04-19T23:27:40.2327910.0
9962024-01-05T20:16:07.1721730.0
9972024-07-15T19:40:15.7077530.0
9982024-02-21T16:11:05.7723510.0
\n", - "

999 rows × 2 columns

\n", - "
" - ], - "text/plain": [ - " date_added time_lost\n", - "0 2024-03-20T04:16:06.976595 0.0\n", - "1 2024-04-24T20:54:19.346646 0.0\n", - "2 2024-06-19T01:59:58.701343 0.0\n", - "3 2024-08-21T04:22:26.232653 0.0\n", - "4 2023-11-21T19:55:36.787105 0.0\n", - ".. ... ...\n", - "994 2023-11-16T02:57:08.886132 0.0\n", - "995 2024-04-19T23:27:40.232791 0.0\n", - "996 2024-01-05T20:16:07.172173 0.0\n", - "997 2024-07-15T19:40:15.707753 0.0\n", - "998 2024-02-21T16:11:05.772351 0.0\n", - "\n", - "[999 rows x 2 columns]" - ] - }, - "execution_count": 8, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "cols = ['date_added', 'time_lost']\n", "df = pd.DataFrame(recs)[cols]\n", @@ -369,23 +149,10 @@ }, { "cell_type": "code", - "execution_count": 9, - "id": "72f1a445-c5b9-4efa-a5fc-77e1c4cee84e", + "execution_count": null, + "id": "8", "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "tl.csv
" - ], - "text/plain": [ - "/home/pothiers/sandbox/ts_notebooks/logging/tl.csv" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], + "outputs": [], "source": [ "# Allow download of CSV version of DataFrame\n", "csvfile = 'tl.csv'\n", @@ -396,21 +163,10 @@ }, { "cell_type": "code", - "execution_count": 10, - "id": "a74d281f-952d-42d3-bf35-949a17000b49", + "execution_count": null, + "id": "9", "metadata": {}, - "outputs": [ - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAqYAAAGdCAYAAADALrFsAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAeVklEQVR4nO3df3DdZb3g8U9K27SFJlBpG0qDFnHR+gPcihjwR3E6FIZ15coyOq5KlQHXbd0LdXToiDCg2FmGQdRbKd6FVkdYXPeuoFy2UisWdymgdbsI0l6rSGtr0vKjSVtofjRn/3B7khNSmtPk5Hlyzus1c2ZyTs735IG0ybvP833Ot65QKBQCAAASG5d6AAAAECFMAQDIhDAFACALwhQAgCwIUwAAsiBMAQDIgjAFACALwhQAgCyMTz2AWtHb2xs7d+6MqVOnRl1dXerhAABDUCgUYu/evTFr1qwYN858XqUJ01Gyc+fOaG5uTj0MAOAobN++PWbPnp16GFVPmI6SqVOnRsTf/mA3NDQkHg0AMBQdHR3R3Nxc/D1OZQnTUXJo+b6hoUGYAsAY4zS80eFkCQAAsiBMAQDIgjAFACALwhQAgCwIUwAAsiBMAQDIgjAFACALwhQAgCwIUwAAsiBMAQDIgjAFACALwhQAgCwIU6rGge6D8Y+P/Cm27tp7VMc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hEnbV8AGqcMIVMyFIAap0wBQAgC8IUMmElH4BaJ0whE84xBaDWCVMAALIgTAEAyIIwBQAgC8IUAIAs1HyY/vnPf47LL7885syZE5MnT443vvGNcf3110dXV1fJ85588sl43/veF5MmTYrm5ua4+eabE40YAKA6jU89gNQ2b94cvb29cccdd8Rpp50WTz31VFxxxRWxf//+uOWWWyIioqOjI84///xYsGBBrFy5Mn73u9/FZz7zmTj++OPjyiuvTPxfAABQHWo+TC+44IK44IILivdPPfXU2LJlS9x+++3FML377rujq6sr7rrrrpg4cWK89a1vjU2bNsWtt94qTAEARkjNL+UPpr29PaZNm1a8v2HDhnj/+98fEydOLD62cOHC2LJlS7z00kuDvkZnZ2d0dHSU3AAAODxhOsDWrVvj29/+dnz2s58tPtba2hozZ84sed6h+62trYO+zvLly6OxsbF4a25urtygAQCqQNWG6TXXXBN1dXWvedu8eXPJMTt27IgLLrggLr300rjiiiuG9fWXLVsW7e3txdv27duH9XoAANWuas8x/cIXvhCLFi16zeeceuqpxY937twZ5513Xpxzzjnx3e9+t+R5TU1N0dbWVvLYoftNTU2DvnZ9fX3U19cfxcgBAGpT1Ybp9OnTY/r06UN67o4dO+K8886LefPmxapVq2LcuNKJ5JaWlvjyl78c3d3dMWHChIiIWLt2bZx++ulxwgknjPjYAQBqUdUu5Q/Vjh07Yv78+XHKKafELbfcErt3747W1taSc0c//vGPx8SJE+Pyyy+Pp59+On74wx/GN7/5zVi6dGnCkQMAVJeqnTEdqrVr18bWrVtj69atMXv27JLPFQqFiIhobGyMhx56KBYvXhzz5s2LE088Ma677jpvFQUAMIJqPkwXLVp0xHNRIyLe8Y53xK9+9avKDwgAoEbV/FI+AAB5EKYAAGRBmAIAkAVhCgBAFoQpAABZEKYAAGRBmAIAkAVhCgBAFoQpAABZEKYAAGRBmAIAkAVhCgBAFoQpAABZEKYAAGRBmAIAkAVhCgBAFoQpAABZEKYAAGRBmAIAkAVhCgBAFoQpAABZEKaQ0JwTj009BADIxvjUA4Ba9s5TTohvfuzMOGXalNRDAYDkhCkk9uEzT049BADIgqV8AACyIEwBAMiCMAUAIAvCFACALAhTAACyIEwBAMiCMAUAIAvCFACALAhTAACyIEwBAMiCMAUAIAvCFACALAhTAACyMD71AGpFoVCIiIiOjo7EIwEAhurQ7+1Dv8epLGE6Svbu3RsREc3NzYlHAgCUa+/evdHY2Jh6GFWvruCfAKOit7c3du7cGVOnTo26uroRfe0dO3bE3LlzR/Q1AWAs2r59ezQ0NIzY6xUKhdi7d2/MmjUrxo1zBmSlmTEdJePGjYvZs2dX5LWdHgAAf9PQ0DCiYRoRZkpHkfQHACALwhQAgCxYyq8CDQ0Nce6550ZPT0/xXNZD58IMvB8RQ3rsaI8bydcaK8flMIaxclwOYxgrx+UwhrFyXA5jGCvH5TCGSh03fvz4+MAHPhD19fXB2GXzEwAAWbCUDwBAFoQpAABZEKYAAGRBmAIAkIWyduUvX748brjhhujs7KzUeAAAqAIXXHBB3HnnnTFr1qwhH1PWjOn69eujp6cnjjnmmLIHBwBA7fj5z38el1xySVnHDOvtonbv3h0zZsw42sMBAKhidXV10dnZGRMmTBjS84f1Bvvt7e3DORwAgCo1YcKEOOuss4YcpRHD2PzU29sbn//854/2cAAAqthpp50WP/nJT8o65qjDdPHixfGzn/3saA8HAKCKPffcc/GJT3wiyjlr9KjCdMmSJXHHHXeU9YUAAKgdBw8ejDVr1sRjjz025GPKCtNCoRCf+9znYsWKFaIUAIBXOXRO6aFWLOdtRssK08WLF8fKlSvLOQQAgBrS3d0dERE9PT1x0kknxemnnz7kY8t6u6i6urryRwcAQM1atWpVLFq0aEjPLevtoizfAwBQKUe9Kx8AAEaSMAUAIAvCFACALAhTAACyIEwBAMiCMAUAIAvCFACALAhTAACyIEwBAMiCMAUAIAvCFACALAhTAACy8P8AoPdysIIaqGcAAAAASUVORK5CYII=", - "text/plain": [ - "
" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], + "outputs": [], "source": [ "x = [r['date_added'] for r in recs]\n", "y = [r['time_lost'] for r in recs]\n", @@ -421,534 +177,27 @@ { "cell_type": "code", "execution_count": null, - "id": "138e5496-e058-417a-881e-8450e20af0f9", + "id": "10", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", - "execution_count": 11, - "id": "0cb5feca-620b-49a0-b25b-835a6d38843a", + "execution_count": null, + "id": "11", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[{'id': '0005d0e0-6de7-4857-b658-cfca7147374a',\n", - " 'site_id': 'summit',\n", - " 'message_text': 'The moveShutterMainDoor command Fail\\r\\n\\r\\n\\r\\nwe try the parameter with uppercase now\\r\\n\\r\\n\\r\\n open: False\\r\\n\\r\\n\\r\\n\\r\\n\\r\\nError in run\\r\\nTraceback (most recent call last):\\r\\n File \"/opt/lsst/software/stack/conda/envs/lsst-scipipe-8.0.0/lib/python3.11/asyncio/tasks.py\", line 500, in wait_for\\r\\n return fut.result()\\r\\n ^^^^^^^^^^^^\\r\\n File \"/opt/lsst/software/stack/conda/envs/lsst-scipipe-8.0.0/lib/python3.11/site-packages/lsst/ts/salobj/topics/remote_command.py\", line 239, in _get_next_ackcmd\\r\\n await self._next_ack_event.wait()\\r\\n File \"/opt/lsst/software/stack/conda/envs/lsst-scipipe-8.0.0/lib/python3.11/asyncio/locks.py\", line 213, in wait\\r\\n await fut\\r\\nasyncio.exceptions.CancelledError\\r\\n\\r\\n\\r\\nThe above exception was the direct cause of the following exception:\\r\\n\\r\\n\\r\\nTraceback (most recent call last):\\r\\n File \"/opt/lsst/software/stack/conda/envs/lsst-scipipe-8.0.0/lib/python3.11/site-packages/lsst/ts/salobj/topics/remote_command.py\", line 189, in next_ackcmd\\r\\n ackcmd = await self._wait_task\\r\\n ^^^^^^^^^^^^^^^^^^^^^\\r\\n File \"/opt/lsst/software/stack/conda/envs/lsst-scipipe-8.0.0/lib/python3.11/site-packages/lsst/ts/salobj/topics/remote_command.py\", line 214, in _basic_next_ackcmd\\r\\n ackcmd = await asyncio.wait_for(\\r\\n ^^^^^^^^^^^^^^^^^^^^^^^\\r\\n File \"/opt/lsst/software/stack/conda/envs/lsst-scipipe-8.0.0/lib/python3.11/asyncio/tasks.py\", line 502, in wait_for\\r\\n raise exceptions.TimeoutError() from exc\\r\\nTimeoutError\\r\\n\\r\\n\\r\\nDuring handling of the above exception, another exception occurred:\\r\\n\\r\\n\\r\\nTraceback (most recent call last):\\r\\n File \"/opt/lsst/software/stack/conda/envs/lsst-scipipe-8.0.0/lib/python3.11/site-packages/lsst/ts/salobj/base_script.py\", line 603, in do_run\\r\\n await self._run_task\\r\\n File \"/net/obs-env/auto_base_packages/ts_standardscripts/python/lsst/ts/standardscripts/run_command.py\", line 170, in run\\r\\n await getattr(self.remote, f\"cmd_{self.cmd}\").start(\\r\\n File \"/opt/lsst/software/stack/conda/envs/lsst-scipipe-8.0.0/lib/python3.11/site-packages/lsst/ts/salobj/topics/remote_command.py\", line 487, in start\\r\\n return await cmd_info.next_ackcmd(timeout=timeout)\\r\\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\r\\n File \"/opt/lsst/software/stack/conda/envs/lsst-scipipe-8.0.0/lib/python3.11/site-packages/lsst/ts/salobj/topics/remote_command.py\", line 205, in next_ackcmd\\r\\n raise base.AckTimeoutError(\\r\\nlsst.ts.salobj.base.AckTimeoutError: msg=\\'Timed out waiting for command acknowledgement\\', ackcmd=(ackcmd private_seqNum=1142844592, ack=<SalRetCode.CMD_NOACK: -301>, error=0, result=\\'No command acknowledgement seen\\')\\r\\n',\n", - " 'level': 0,\n", - " 'tags': [],\n", - " 'urls': [],\n", - " 'time_lost': 0.0,\n", - " 'date_begin': '2024-03-20T04:15:26.769000',\n", - " 'user_id': 'cmorales@summit-lsp.lsst.codes',\n", - " 'user_agent': 'LOVE',\n", - " 'is_human': True,\n", - " 'is_valid': True,\n", - " 'date_added': '2024-03-20T04:16:06.976595',\n", - " 'date_invalidated': None,\n", - " 'parent_id': None,\n", - " 'systems': None,\n", - " 'subsystems': None,\n", - " 'cscs': None,\n", - " 'date_end': '2024-03-20T04:15:26.769000',\n", - " 'components': ['AuxTel'],\n", - " 'primary_software_components': ['None'],\n", - " 'primary_hardware_components': ['None'],\n", - " 'category': 'None',\n", - " 'time_lost_type': 'fault'},\n", - " {'id': '00067b6a-1741-41f3-87af-57261dff30ac',\n", - " 'site_id': 'summit',\n", - " 'message_text': 'David updated environment. But no need to cycle Scheduler 1. Waiting for completion of the current block. \\r\\n',\n", - " 'level': 0,\n", - " 'tags': [],\n", - " 'urls': [],\n", - " 'time_lost': 0.0,\n", - " 'date_begin': '2024-04-24T20:53:41.843000',\n", - " 'user_id': 'ykang@summit-lsp.lsst.codes',\n", - " 'user_agent': 'LOVE',\n", - " 'is_human': True,\n", - " 'is_valid': True,\n", - " 'date_added': '2024-04-24T20:54:19.346646',\n", - " 'date_invalidated': None,\n", - " 'parent_id': None,\n", - " 'systems': None,\n", - " 'subsystems': None,\n", - " 'cscs': None,\n", - " 'date_end': '2024-04-24T20:53:41.843000',\n", - " 'components': ['MainTel'],\n", - " 'primary_software_components': ['None'],\n", - " 'primary_hardware_components': ['None'],\n", - " 'category': 'None',\n", - " 'time_lost_type': 'fault'},\n", - " {'id': '000a3ba8-b1a9-4b04-9c4a-263da3dac1d1',\n", - " 'site_id': 'summit',\n", - " 'message_text': 'Runing BLOCK-T22 AuxTel filter Scans, the auxtel/calibrations/run_calibration_sequence.py went to fault.\\r\\n\\r\\n\\r\\nsalIndex: 200068\\r\\nFile \"/net/obs-env/auto_base_packages/ts_observatory_control/python/lsst/ts/observatory/control/auxtel/atcalsys.py\", line 338, in _take_data\\r\\n await asyncio.gather(\\r\\n File \"/net/obs-env/auto_base_packages/ts_observatory_control/python/lsst/ts/observatory/control/auxtel/atcalsys.py\", line 430, in take_fiber_spectrum\\r\\n await self.fiberspectrograph.cmd_expose.set_start(\\r\\n File \"/opt/lsst/software/stack/conda/envs/lsst-scipipe-8.0.0/lib/python3.11/site-packages/lsst/ts/salobj/topics/remote_command.py\", line 416, in set_start\\r\\n return await self.start(timeout=timeout, wait_done=wait_done)\\r\\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\r\\n File \"/opt/lsst/software/stack/conda/envs/lsst-scipipe-8.0.0/lib/python3.11/site-packages/lsst/ts/salobj/topics/remote_command.py\", line 487, in start\\r\\n return await cmd_info.next_ackcmd(timeout=timeout)\\r\\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\r\\n File \"/opt/lsst/software/stack/conda/envs/lsst-scipipe-8.0.0/lib/python3.11/site-packages/lsst/ts/salobj/topics/remote_command.py\", line 191, in next_ackcmd\\r\\n raise base.AckError(msg=\"Command failed\", ackcmd=ackcmd)\\r\\nlsst.ts.salobj.base.AckError: msg=\\'Command failed\\', ackcmd=(ackcmd private_seqNum=1157551610, ack=<SalRetCode.CMD_FAILED: -302>, error=1, result=\"Failed: 502, message=\\'Bad Gateway\\', url=URL(\\'http://comcam-mcm-dds.cp.lsst.org/ImageUtilities/rest/imageNameService?n=1&sourceIndex=3&source=FiberSpectrograph\\')\")\\r\\n',\n", - " 'level': 0,\n", - " 'tags': [],\n", - " 'urls': [],\n", - " 'time_lost': 0.0,\n", - " 'date_begin': '2024-06-19T01:59:08.706000',\n", - " 'user_id': 'cmd_user@summit-lsp.lsst.codes',\n", - " 'user_agent': 'LOVE',\n", - " 'is_human': True,\n", - " 'is_valid': False,\n", - " 'date_added': '2024-06-19T01:59:58.701343',\n", - " 'date_invalidated': '2024-06-19T02:12:01.302498',\n", - " 'parent_id': 'af0157e3-d7f0-4068-9a8a-e51a0a77d260',\n", - " 'systems': None,\n", - " 'subsystems': None,\n", - " 'cscs': None,\n", - " 'date_end': '2024-06-19T01:59:08.706000',\n", - " 'components': ['AuxTel'],\n", - " 'primary_software_components': ['None'],\n", - " 'primary_hardware_components': ['None'],\n", - " 'category': 'None',\n", - " 'time_lost_type': 'fault'},\n", - " {'id': '0010e246-8039-4741-b4c6-54047e9464c5',\n", - " 'site_id': 'summit',\n", - " 'message_text': 'Still checking updates in the wavefront estimation pipeline version, offsetting manually the ATHexapod in different axes and deploying different versions of the pipeline.\\r\\n',\n", - " 'level': 0,\n", - " 'tags': [],\n", - " 'urls': [],\n", - " 'time_lost': 0.0,\n", - " 'date_begin': '2024-08-21T04:04:38.053000',\n", - " 'user_id': 'kpena@summit-lsp.lsst.codes',\n", - " 'user_agent': 'LOVE',\n", - " 'is_human': True,\n", - " 'is_valid': True,\n", - " 'date_added': '2024-08-21T04:22:26.232653',\n", - " 'date_invalidated': None,\n", - " 'parent_id': '99de2a12-20eb-45ae-b189-a793b63e6ab5',\n", - " 'systems': None,\n", - " 'subsystems': None,\n", - " 'cscs': None,\n", - " 'date_end': '2024-08-21T04:04:38.053000',\n", - " 'components': ['AuxTel'],\n", - " 'primary_software_components': ['None'],\n", - " 'primary_hardware_components': ['None'],\n", - " 'category': 'None',\n", - " 'time_lost_type': 'fault'}]" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "recs[:4]" ] }, { "cell_type": "code", - "execution_count": 12, - "id": "f6441d81-93a8-4369-93fb-55d3715783cc", + "execution_count": null, + "id": "12", "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
idsite_idmessage_textleveltagsurlstime_lostdate_beginuser_iduser_agent...parent_idsystemssubsystemscscsdate_endcomponentsprimary_software_componentsprimary_hardware_componentscategorytime_lost_type
00005d0e0-6de7-4857-b658-cfca7147374asummitThe moveShutterMainDoor command Fail\\r\\n\\r\\n\\r...0[][]0.02024-03-20T04:15:26.769000cmorales@summit-lsp.lsst.codesLOVE...NoneNoneNoneNone2024-03-20T04:15:26.769000[AuxTel][None][None]Nonefault
100067b6a-1741-41f3-87af-57261dff30acsummitDavid updated environment. But no need to cycl...0[][]0.02024-04-24T20:53:41.843000ykang@summit-lsp.lsst.codesLOVE...NoneNoneNoneNone2024-04-24T20:53:41.843000[MainTel][None][None]Nonefault
2000a3ba8-b1a9-4b04-9c4a-263da3dac1d1summitRuning BLOCK-T22 AuxTel filter Scans, the auxt...0[][]0.02024-06-19T01:59:08.706000cmd_user@summit-lsp.lsst.codesLOVE...af0157e3-d7f0-4068-9a8a-e51a0a77d260NoneNoneNone2024-06-19T01:59:08.706000[AuxTel][None][None]Nonefault
30010e246-8039-4741-b4c6-54047e9464c5summitStill checking updates in the wavefront estima...0[][]0.02024-08-21T04:04:38.053000kpena@summit-lsp.lsst.codesLOVE...99de2a12-20eb-45ae-b189-a793b63e6ab5NoneNoneNone2024-08-21T04:04:38.053000[AuxTel][None][None]Nonefault
40017b90e-26aa-4a7c-8186-fc06ac9b5aa6summitThe m1m3 ump test failed for actuator 108. \\r\\...0[][]0.02023-11-21T19:51:54.868000bquint@love01.cp.lsst.orgLOVE...NoneNoneNoneNone2023-11-21T19:51:54.868000[MainTel][None][None]Nonefault
..................................................................
99422325b7d-7948-4da8-88ec-2a47ceb088e0summitBlock 109 starting again\\r\\n0[][]0.02023-11-16T02:56:30.009000echristensen@love01.cp.lsst.orgLOVE...NoneNoneNoneNone2023-11-16T02:56:30.009000[MainTel][None][None]Nonefault
9952233da67-c777-4dd6-bc66-a241f93df5aesummitAz encoder checking thru slew test. \\r\\n\\r\\n\\r...0[][]0.02024-04-19T23:27:02.011000ykang@summit-lsp.lsst.codesLOVE...NoneNoneNoneNone2024-04-19T23:27:02.011000[MainTel][None][None]Nonefault
996223c0310-03d5-450d-bf5c-0a04bdea6536summitRestarting [BLOCK-178|https://jira.lsstcorp.or...0[][]0.02024-01-05T20:15:27.453000kfanning@love01.cp.lsst.orgLOVE...NoneNoneNoneNone2024-01-05T20:15:27.453000[MainTel][None][None]Nonefault
9972240e19e-7204-4c50-a3ba-c643d60aa0d2summitLATISS enabled but checkout failed \\r\\n\\r\\n\\r\\...0[][]0.02024-07-15T19:39:38.630000kkelkar@summit-lsp.lsst.codesLOVE...NoneNoneNoneNone2024-07-15T19:39:38.630000[AuxTel][None][None]Nonefault
99822475aa1-f15a-46f1-87b8-b7a1708daaf4summitPowercycled M2 cabinet to bring back the M2 co...0[][]0.02024-02-21T15:37:00kfanning@summit-lsp.lsst.codesLOVE...NoneNoneNoneNone2024-02-21T16:10:28.176000[MainTel][None][None]Nonefault
\n", - "

999 rows × 24 columns

\n", - "
" - ], - "text/plain": [ - " id site_id \\\n", - "0 0005d0e0-6de7-4857-b658-cfca7147374a summit \n", - "1 00067b6a-1741-41f3-87af-57261dff30ac summit \n", - "2 000a3ba8-b1a9-4b04-9c4a-263da3dac1d1 summit \n", - "3 0010e246-8039-4741-b4c6-54047e9464c5 summit \n", - "4 0017b90e-26aa-4a7c-8186-fc06ac9b5aa6 summit \n", - ".. ... ... \n", - "994 22325b7d-7948-4da8-88ec-2a47ceb088e0 summit \n", - "995 2233da67-c777-4dd6-bc66-a241f93df5ae summit \n", - "996 223c0310-03d5-450d-bf5c-0a04bdea6536 summit \n", - "997 2240e19e-7204-4c50-a3ba-c643d60aa0d2 summit \n", - "998 22475aa1-f15a-46f1-87b8-b7a1708daaf4 summit \n", - "\n", - " message_text level tags urls \\\n", - "0 The moveShutterMainDoor command Fail\\r\\n\\r\\n\\r... 0 [] [] \n", - "1 David updated environment. But no need to cycl... 0 [] [] \n", - "2 Runing BLOCK-T22 AuxTel filter Scans, the auxt... 0 [] [] \n", - "3 Still checking updates in the wavefront estima... 0 [] [] \n", - "4 The m1m3 ump test failed for actuator 108. \\r\\... 0 [] [] \n", - ".. ... ... ... ... \n", - "994 Block 109 starting again\\r\\n 0 [] [] \n", - "995 Az encoder checking thru slew test. \\r\\n\\r\\n\\r... 0 [] [] \n", - "996 Restarting [BLOCK-178|https://jira.lsstcorp.or... 0 [] [] \n", - "997 LATISS enabled but checkout failed \\r\\n\\r\\n\\r\\... 0 [] [] \n", - "998 Powercycled M2 cabinet to bring back the M2 co... 0 [] [] \n", - "\n", - " time_lost date_begin user_id \\\n", - "0 0.0 2024-03-20T04:15:26.769000 cmorales@summit-lsp.lsst.codes \n", - "1 0.0 2024-04-24T20:53:41.843000 ykang@summit-lsp.lsst.codes \n", - "2 0.0 2024-06-19T01:59:08.706000 cmd_user@summit-lsp.lsst.codes \n", - "3 0.0 2024-08-21T04:04:38.053000 kpena@summit-lsp.lsst.codes \n", - "4 0.0 2023-11-21T19:51:54.868000 bquint@love01.cp.lsst.org \n", - ".. ... ... ... \n", - "994 0.0 2023-11-16T02:56:30.009000 echristensen@love01.cp.lsst.org \n", - "995 0.0 2024-04-19T23:27:02.011000 ykang@summit-lsp.lsst.codes \n", - "996 0.0 2024-01-05T20:15:27.453000 kfanning@love01.cp.lsst.org \n", - "997 0.0 2024-07-15T19:39:38.630000 kkelkar@summit-lsp.lsst.codes \n", - "998 0.0 2024-02-21T15:37:00 kfanning@summit-lsp.lsst.codes \n", - "\n", - " user_agent ... parent_id systems subsystems \\\n", - "0 LOVE ... None None None \n", - "1 LOVE ... None None None \n", - "2 LOVE ... af0157e3-d7f0-4068-9a8a-e51a0a77d260 None None \n", - "3 LOVE ... 99de2a12-20eb-45ae-b189-a793b63e6ab5 None None \n", - "4 LOVE ... None None None \n", - ".. ... ... ... ... ... \n", - "994 LOVE ... None None None \n", - "995 LOVE ... None None None \n", - "996 LOVE ... None None None \n", - "997 LOVE ... None None None \n", - "998 LOVE ... None None None \n", - "\n", - " cscs date_end components primary_software_components \\\n", - "0 None 2024-03-20T04:15:26.769000 [AuxTel] [None] \n", - "1 None 2024-04-24T20:53:41.843000 [MainTel] [None] \n", - "2 None 2024-06-19T01:59:08.706000 [AuxTel] [None] \n", - "3 None 2024-08-21T04:04:38.053000 [AuxTel] [None] \n", - "4 None 2023-11-21T19:51:54.868000 [MainTel] [None] \n", - ".. ... ... ... ... \n", - "994 None 2023-11-16T02:56:30.009000 [MainTel] [None] \n", - "995 None 2024-04-19T23:27:02.011000 [MainTel] [None] \n", - "996 None 2024-01-05T20:15:27.453000 [MainTel] [None] \n", - "997 None 2024-07-15T19:39:38.630000 [AuxTel] [None] \n", - "998 None 2024-02-21T16:10:28.176000 [MainTel] [None] \n", - "\n", - " primary_hardware_components category time_lost_type \n", - "0 [None] None fault \n", - "1 [None] None fault \n", - "2 [None] None fault \n", - "3 [None] None fault \n", - "4 [None] None fault \n", - ".. ... ... ... \n", - "994 [None] None fault \n", - "995 [None] None fault \n", - "996 [None] None fault \n", - "997 [None] None fault \n", - "998 [None] None fault \n", - "\n", - "[999 rows x 24 columns]" - ] - }, - "execution_count": 12, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "df = pd.DataFrame(recs)\n", "df" @@ -957,7 +206,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d8cefdd9-98ec-4383-a297-6853be7d0c9b", + "id": "13", "metadata": {}, "outputs": [], "source": [] From 6d6953d1765f8602d0056d6e62a2c843db326cab Mon Sep 17 00:00:00 2001 From: Jonathan Sick Date: Tue, 27 Aug 2024 11:06:51 -0400 Subject: [PATCH 4/4] Add pre-commit linting workflow to GitHub Actions This ensures that PRs are validated with pre-commit. --- .github/workflows/lint.yaml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/lint.yaml diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..67bef52 --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,34 @@ +name: Python CI + +env: + PYTHON_VERSION: "3.12" # Default Python version + +"on": + merge_group: {} + pull_request: {} + push: + branches-ignore: + # These should always correspond to pull requests, so ignore them for + # the push trigger and let them be triggered by the pull_request + # trigger, avoiding running the workflow twice. This is a minor + # optimization so there's no need to ensure this is comprehensive. + - "dependabot/**" + - "renovate/**" + - "tickets/**" + - "u/**" + +jobs: + + lint: + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + + - name: Run pre-commit + uses: pre-commit/action@v3.0.1