Skip to content

Commit

Permalink
Add error reporting to tractTable.
Browse files Browse the repository at this point in the history
  • Loading branch information
ctslater committed Nov 21, 2024
1 parent baec6ab commit cd34a1f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
18 changes: 14 additions & 4 deletions python/lsst/production/tools/tractTable.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import numpy as np
import yaml
from flask import Blueprint, Flask, render_template, url_for
from lsst.daf.butler import Butler
from lsst.daf.butler import Butler, DatasetNotFoundError

from .htmlUtils import *

Expand Down Expand Up @@ -137,9 +137,19 @@ def collection(repo, collection):
else:
dataId = {"skymap": "lsst_cells_v1", "instrument": "LSSTComCam"}

t = butler.get(
"objectTableCore_metricsTable", collections=collection, dataId=dataId
)
try:
t = butler.get(
"objectTableCore_metricsTable", collections=collection, dataId=dataId
)
except DatasetNotFoundError:
return render_template(
"metrics/tracts.html",
header_dict={},
content_dict={},
collection=collection,
error="Collection does not have dataset objectTableCore_metricsTable"
)


col_dict = {
"table_cols": ["tract", "corners", "nPatches", "nInputs", "failed metrics"],
Expand Down
1 change: 1 addition & 0 deletions static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ TD {
text-align: center;
padding: 2pt;
color: #909B9C;
padding-bottom: 0.5em;
}

TD.summary {
Expand Down
7 changes: 7 additions & 0 deletions templates/metrics/tracts.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@

{% block content %}


<h2>{{collection}}</h2>
<a href={{url_for(".index")}}>&lt;-- Back to collections</a>
<table>

{% if error %}
<br/><br/>
<h3>{{error}}</h3>
{% endif %}

<thead>
<tr>
{% for header in header_dict %}
Expand Down

0 comments on commit cd34a1f

Please sign in to comment.