Skip to content

Commit

Permalink
Merge pull request #170 from PCMDI/simple-plumes-delivery-summary
Browse files Browse the repository at this point in the history
Update delivery summary info for simple plumes
  • Loading branch information
znichollscr authored Dec 20, 2024
2 parents 2676bd5 + badd3f6 commit a3eb0c0
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 14 deletions.
1 change: 1 addition & 0 deletions changelog/170.docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updated simple plume info in the delivery summary.
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ <h4>
</tr>
<tr>
<td>11</td>
<td><b>Aerosol optical properties/MACv2-SP</b></br>Internal docs: <a href='../dataset-overviews/aerosol-optical-properties-macv2-sp' target='_blank'>here</a></td>
<td>TBD</td>
<td>Depends on 1, test dataset being produced in the meantime</td>
<td>Expected: ~November 2024; Expected a month after dependent datasets</td>
<td><b><a href='https://zenodo.org/records/14512962' target='_blank'>Aerosol optical properties/MACv2-SP</a></b></br>Internal docs: <a href='../dataset-overviews/aerosol-optical-properties-macv2-sp' target='_blank'>here</a></td>
<td>NA (not released on ESGF, see <a href='https://zenodo.org/records/14512962' target='_blank'>https://zenodo.org/records/14512962</a> instead)</td>
<td>Preliminary dataset available</td>
<td>Available: <a href='https://zenodo.org/records/14512962' target='_blank'>https://zenodo.org/records/14512962</a></td>
</tr>
<tr>
<td>12</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,27 @@
import pandas as pd


def format_url_for_html(link: str, desc: str) -> str:
"""
Forat a URL for display on an HTML page
Parameters
----------
link
Link to link to
desc
Description to show to the viewer
Returns
-------
:
Formatted link
"""
return f"<a href='{link}' target='_blank'>{desc}</a>"


def get_url_esgf_for_html_table(row: pd.Series, search_facets: Iterable[str]) -> str:
"""
Get the relevant ESGF search URL for a given row in a database view
Expand Down Expand Up @@ -479,9 +500,9 @@ def get_delivery_summary_view(
{
"source_id": None, # TBD
"description": "Aerosol optical properties/MACv2-SP",
"expected_publication": "~November 2024; Expected a month after dependent datasets",
"url": None,
"status": "Depends on 1, test dataset being produced in the meantime",
"expected_publication": "Available",
"url": "https://zenodo.org/records/14512962",
"status": "Preliminary dataset available",
"input4MIPs_internal_page": "aerosol-optical-properties-macv2-sp",
},
{
Expand All @@ -501,18 +522,32 @@ def get_delivery_summary_view(
input4MIPs_internal_page = info_d["input4MIPs_internal_page"]

if info_d["source_id"] is None:
if info_d["url"] is not None:
if info_d["description"].startswith("Aerosol optical properties/MAC"):
# The simple plumes exception
tmp["Forcing dataset"] = (
f"<a href='{info_d['url']}' target='_blank'>{info_d['description']}</a>"
)
tmp["Source ID"] = (
f"NA (not released on ESGF, see {format_url_for_html(info_d['url'], info_d['url'])} instead)"
)
tmp["Status"] = info_d["status"]
tmp["ESGF publication status"] = (
f"{info_d['expected_publication']}: {format_url_for_html(info_d['url'], info_d['url'])}"
)

else:
tmp["Forcing dataset"] = info_d["description"]
if info_d["url"] is not None:
tmp["Forcing dataset"] = (
f"<a href='{info_d['url']}' target='_blank'>{info_d['description']}</a>"
)
else:
tmp["Forcing dataset"] = info_d["description"]

tmp["Source ID"] = "TBD"
tmp["Status"] = info_d["status"]
tmp["ESGF publication status"] = (
f"Expected: {info_d['expected_publication']}"
)
tmp["Source ID"] = "TBD"
tmp["Status"] = info_d["status"]
tmp["ESGF publication status"] = (
f"Expected: {info_d['expected_publication']}"
)

else:
db_source_ids = db[
Expand Down

0 comments on commit a3eb0c0

Please sign in to comment.