Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding year to asset inventory webpage #86

Merged
merged 1 commit into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions website/asset_inventory_config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"general_info_text": "Browse the IOOS Asset Inventory.",
"general_title": "Browse IOOS asset inventory",
"general_info_text": "IOOS asset inventory.",
"general_title": "IOOS asset inventory",
"githubpage": "https://ioos.github.io/ioos_metrics/browse",
"githubrepo": "https://github.com/ioos/ioos_metrics/",
"google_analytics": "https://tag_url.google.co",
Expand Down
2 changes: 2 additions & 0 deletions website/create_asset_inventory_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ def map_plot(gdf):
popup=folium.features.GeoJsonPopup(
fields=[
"RA",
"Year",
"latitude",
"longitude",
"station_long_name",
Expand Down Expand Up @@ -192,6 +193,7 @@ def main(org_config):
configs = {
"table": gdf.to_html(table_id="table", index=False, columns=columns),
"figure": fig,
"year": gdf['Year'].unique()[0]
Copy link
Member

@ocefpaf ocefpaf Jul 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are getting the first occurrence of Year, so you probably don't need the .unique() there, right? I don't know what that gdf is, I need to run this script first, but if the Year value is the same everywhere and/or what you need is just the first occurrence, this is good to go.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, yes. I was just pulling the string out of the list so it was easier to show on the website.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, I don't have enough rights to merge this but it is good IMO.
Also, I sent #87 to help with reviews on the page generation in the future.

}

write_templates(configs, org_config)
Expand Down
14 changes: 9 additions & 5 deletions website/templates/asset_inventory_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,13 @@ <h1 class="header_title">NOAA Integrated Ocean Observing System Metrics</h1>
</div>
<div class="divider"></div>
<div class="mywrap">
<h2 class="title">{{org_config.general_title}} data on <a href="https://erddap.ioos.us/erddap/search/index.html?page=1&itemsPerPage=1000&searchFor=asset+inventory">ERDDAP</a>.
</h2>
<h1 class="title">{{org_config.general_title}}</h1>
</div>
<div>
<h3>A brief description of the IOOS Asset Inventory:</h3>
<h3>A brief description of the IOOS asset inventory:</h3>
<ol type="1">
<li>The IOOS Asset Inventory contains stationary observing systems that are/were operating at any time during the
calendar year (Jan 1 - Dec 31).</li>
<li>The IOOS asset inventory contains stationary observing systems that are/were operating at any time during the
calendar year (CY) (Jan 1 - Dec 31).</li>
<li>Stationary observing systems that are exposed through one or more web services
implemented by the RA. The asset must be discoverable through the IOOS
Catalog. This includes:
Expand All @@ -78,13 +77,18 @@ <h3>A brief description of the IOOS Asset Inventory:</h3>
</div>
<div>
<p>Definitions for each field can be found at the <a href="#field-definitions">bottom of this page.</a></p>
<p>You can browse the entire IOOS asset inventory collection on <a href="https://erddap.ioos.us/erddap/search/index.html?page=1&itemsPerPage=1000&searchFor=asset+inventory">ERDDAP</a>.</p>
</div>

<div>
<h3>Map of CY {{configs.year}} assets:</h3>
</div>
<div class="mapbox" style="width:800px; margin:0 auto;">
{{configs.figure}}
</div>

<div>
<h3>Table of CY {{configs.year}} assets:</h3>
{{configs.table}}
{% raw %}
<script src="https://code.jquery.com/jquery-3.6.0.slim.min.js" integrity="sha256-u7e5khyithlIdTpu22PHhENmPcRdFiHRjhAuHcs05RI=" crossorigin="anonymous"></script>
Expand Down