diff --git a/notebooks_tsqr/NightLog.ipynb b/notebooks_tsqr/NightLog.ipynb index 24ca15b..e8b50cd 100644 --- a/notebooks_tsqr/NightLog.ipynb +++ b/notebooks_tsqr/NightLog.ipynb @@ -24,7 +24,7 @@ "# day_obs values: TODAY, YESTERDAY, YYYY-MM-DD\n", "# Report on observing nights that start upto but not included this day.\n", "#!day_obs = '2024-09-25' # Value to use for local testing (Summit)\n", - "day_obs = \"2024-09-25\" # TODO Change to 'YESTERDAY' to test with default before push\n", + "day_obs = \"YESTERDAY\" # TODO Change to 'YESTERDAY' to test with default before push\n", "\n", "# Total number of days of data to display (ending on day_obs)\n", "number_of_days = \"1\" # TODO Change to '1' to test with default before push" @@ -67,11 +67,7 @@ "cell_type": "code", "execution_count": null, "id": "3", - "metadata": { - "jupyter": { - "source_hidden": true - } - }, + "metadata": {}, "outputs": [], "source": [ "# Normalize Parameters (both explicit Times Squares params, in implicit ones)\n", @@ -103,11 +99,7 @@ "cell_type": "code", "execution_count": null, "id": "4", - "metadata": { - "jupyter": { - "source_hidden": true - } - }, + "metadata": {}, "outputs": [], "source": [ "# Set default env to \"usdf\" and try before PUSH to repo.\n", diff --git a/python/lsst/ts/logging_and_reporting/parse_message.py b/python/lsst/ts/logging_and_reporting/parse_message.py index b7e2e2e..c7d7165 100644 --- a/python/lsst/ts/logging_and_reporting/parse_message.py +++ b/python/lsst/ts/logging_and_reporting/parse_message.py @@ -3,33 +3,12 @@ import lsst.ts.logging_and_reporting.reports as rep - -def ignore_this(): # TODO remove - allsrc = all.AllSources( - server_url="https://summit-lsp.lsst.codes", - min_dayobs="2024-08-02", - max_dayobs="2024-10-21", - ) - - eidx = [ - idx - for idx, r in enumerate(allsrc.nar_src.records[:125]) - if "Error:" in r["message_text"] - ] - - allsrc.nar_src.records[eidx[6]]["message_text"] - - re_err = re.compile(r"^.*(Error:.*)", re.DOTALL | re.DEBUG | re.MULTILINE) - - re_err.match(allsrc.nar_src.records[eidx[6]]["message_text"]).group(1) - # => "Error: msg='Command failed', ackcmd=(ackcmd private_seqNum=1579091411, ack=<SalRetCode.CMD_FAILED: -302>, error=1, result='Failed: wavefrontError write(private_revCode: cdb25a59, private_sndStamp: 1725582543.3115678, private_rcvStamp: 0.0, private_seqNum: 1, private_identity: MTAOS, private_origin: 3159695, sensorId: 0, annularZernikeCoeff: 0.08561753960450617) failed: probably at least one array field is too short')\r\n" # noqa: E501 - - # Start after whitespace before error. End at string end. # BLACK work-around flags = re.DOTALL | re.ASCII | re.MULTILINE | re.IGNORECASE re_err = re.compile(r"(?P\S*error:.*)", flags=flags) re_tb = re.compile(r"\b(Traceback \(most recent call last\):.*)", flags=flags) +re_pnl = re.compile(r"<PARSED_NL>", flags=re.ASCII | re.MULTILINE) def highlight_code(matchobj): @@ -53,6 +32,8 @@ def markup_errors(records, src_field="message_text"): # #!re.search('|'.join([re_err, re_tb]) # #!new = re_err.sub(highlight_code, orig) - new = re_tb.sub(highlight_code, orig) + + new = re_pnl.sub("
", orig) + new = re_tb.sub(highlight_code, new) if orig != new: r[dest_field] = new