From 377d89456a742e27cb04e3466395e2ef2c015838 Mon Sep 17 00:00:00 2001 From: Valerie Becker <29263449+Vebop@users.noreply.github.com> Date: Thu, 23 Jan 2025 18:01:58 +0000 Subject: [PATCH] Updated link display --- notebooks_tsqr/NightLog.ipynb | 35 ++++++++++++++----- python/lsst/ts/logging_and_reporting/utils.py | 7 ++++ 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/notebooks_tsqr/NightLog.ipynb b/notebooks_tsqr/NightLog.ipynb index 87ebae9..ab8daaa 100644 --- a/notebooks_tsqr/NightLog.ipynb +++ b/notebooks_tsqr/NightLog.ipynb @@ -263,12 +263,19 @@ ] }, { - "cell_type": "markdown", + "cell_type": "code", + "execution_count": null, "id": "13", "metadata": {}, + "outputs": [], "source": [ - "Also see: [2024-12-09 Commissioning Plan](https://rubinobs.atlassian.net/projects/BLOCK?selectedItem=com.atlassian.plugins.atlassian-connect-plugin:com.kanoah.test-manager__main-project-page#!/testCycle/BLOCK-R164)\n", - "*(we need a general way to refer to plan for the a specific night)*" + "commissioning_plan = \"https://rubinobs.atlassian.net/projects/BLOCK?selectedItem=com.atlassian.plugins.atlassian-connect-plugin:com.kanoah.test-manager__main-project-page#!/testCycle/BLOCK-R164\"\n", + "md(\n", + " f\"\"\"\n", + "Also see: {ut.link_new_tab(commissioning_plan, \"2024-12-09 Commissioning Plan\")}\n", + "*(we need a general way to refer to plan for the a specific night)*\n", + "\"\"\"\n", + ")" ] }, { @@ -343,11 +350,21 @@ " if \"summit\" in server\n", " else f\"{server}/rubintv/ddv/index.html\"\n", ")\n", + "\n", + "nightsum_link_url = f\"{server}/times-square/github/lsst/schedview_notebooks/nightly/scheduler-nightsum?day_obs={min_date.date()}&visit_origin=lsstcomcam\"\n", + "nightsum_link_string = f\"link to nightsum for day_obs = {min_date.date()}\"\n", + "\n", "md(\n", " f\"\"\"\n", - "- Access DDV part of RubinTV: {DDV}\n", - "- [Chronograph]({server}/chronograf)\n", - "- [nightsum]({server}/times-square/github/lsst/schedview_notebooks/nightly/scheduler-nightsum?day_obs={min_date.date()}&visit_origin=lsstcomcam)\n", + "#### DDV part of RubinTV\n", + " {ut.link_new_tab(DDV, 'RubinTV Visualization')}\n", + "\n", + "#### Chronograf links\n", + "{ut.link_new_tab(f'{server}/chronograf','Chronograph main page on {server}')}\n", + "\n", + "#### Scheduler Analysis Nightly Summary\n", + "{ut.link_new_tab(link_url,link_string)}\n", + "\n", "\"\"\"\n", ")" ] @@ -491,7 +508,9 @@ " md(mdstr)\n", "else:\n", " endpoint_url = allsrc.nig_src.status[\"reports\"][\"endpoint_url\"]\n", - " md(f\"No tickets found using: [API Data]({endpoint_url}) in `confluence_url`.\")" + " md(\n", + " f\"No tickets found using: {disp_link(endpoint_url,'API Data')} in `confluence_url`.\"\n", + " )" ] }, { @@ -963,7 +982,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.10" + "version": "3.11.9" } }, "nbformat": 4, diff --git a/python/lsst/ts/logging_and_reporting/utils.py b/python/lsst/ts/logging_and_reporting/utils.py index fa2f03f..947c08b 100644 --- a/python/lsst/ts/logging_and_reporting/utils.py +++ b/python/lsst/ts/logging_and_reporting/utils.py @@ -196,6 +196,13 @@ def hhmmss(decimal_hours): return f"{hours:d}:{minutes:02d}:{seconds:02d}" +def link_new_tab(url, string=None): + """Wrap links in html to open all links in new tab, must be used in md()""" + string = url if string is None else string + html = f'{string}' + return html + + def tic(): """Start timer.""" tic.start = time.perf_counter()