Skip to content

Commit

Permalink
Updated the settings file to autoformat on save to hopefully reduce l…
Browse files Browse the repository at this point in the history
…inting errors. Fixed linting errors for the initial_projects_data update. Fixed the status tooltip to correctly display the node's status. Updated test fixtures to accurately reflect the node status response (the node names included the https:// in front and thats why status tooltip wasn't finding them. (#714)
  • Loading branch information
downiec authored Jan 16, 2025
1 parent e5a2812 commit 9aeb52d
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 58 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,6 @@
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"python.analysis.extraPaths": ["backend/venv/bin/python"]
"python.analysis.extraPaths": ["backend/venv/bin/python"],
"editor.formatOnSave": true
}
134 changes: 85 additions & 49 deletions backend/metagrid/initial_projects_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,19 @@
"name": "CMIP6",
"full_name": "Coupled Model Intercomparison Project Phase 6",
"project_url": "https://pcmdi.llnl.gov/CMIP6/",
"description": "The Coupled Model Intercomparison Project, which began in 1995 under the auspices of the World Climate Research Programme (WCRP), is now in its sixth phase (CMIP6). CMIP6 coordinates somewhat independent model intercomparison activities and their experiments which have adopted a common infrastructure for collecting, organizing, and distributing output from models performing common sets of experiments. The simulation data produced by models under previous phases of CMIP have been used in thousands of research papers (some of which are listed here), and the multi-model results provide some perspective on errors and uncertainty in model simulations. This information has proved invaluable in preparing high profile reports assessing our understanding of climate and climate change (e.g., the IPCC Assessment Reports).",
"description": (
"The Coupled Model Intercomparison Project, which began in 1995 under the "
"auspices of the World Climate Research Programme (WCRP), is now in its sixth "
"phase (CMIP6). CMIP6 coordinates somewhat independent model intercomparison "
"activities and their experiments which have adopted a common infrastructure "
"for collecting, organizing, and distributing output from models performing "
"common sets of experiments. The simulation data produced by models under "
"previous phases of CMIP have been used in thousands of research papers (some "
"of which are listed here), and the multi-model results provide some perspective "
"on errors and uncertainty in model simulations. This information has proved "
"invaluable in preparing high profile reports assessing our understanding of "
"climate and climate change (e.g., the IPCC Assessment Reports)."
),
"facets_by_group": {
GROUPS[0]: ["activity_id", "data_node"],
GROUPS[1]: [
Expand All @@ -48,13 +60,8 @@
"experiment_id",
"sub_experiment_id",
],
GROUPS[2]: [
"nominal_resolution",
],
GROUPS[3]: [
"variant_label",
"grid_label",
],
GROUPS[2]: ["nominal_resolution"],
GROUPS[3]: ["variant_label", "grid_label"],
GROUPS[4]: [
"table_id",
"frequency",
Expand All @@ -68,7 +75,9 @@
"name": "CMIP6Plus",
"full_name": "Coupled Model Intercomparison Project Phase 6 Plus",
"project_url": "https://wcrp-cmip.org/cmip-overview/",
"description": "Follow-up to CMIP6 with closely matching configuration. Description of CMIP6 Plus needed.",
"description": (
"Follow-up to CMIP6 with closely matching configuration. Description of CMIP6 Plus needed."
),
"facets_by_group": {
GROUPS[0]: ["activity_id", "data_node"],
GROUPS[1]: [
Expand All @@ -78,13 +87,8 @@
"experiment_id",
"sub_experiment_id",
],
GROUPS[2]: [
"nominal_resolution",
],
GROUPS[3]: [
"variant_label",
"grid_label",
],
GROUPS[2]: ["nominal_resolution"],
GROUPS[3]: ["variant_label", "grid_label"],
GROUPS[4]: [
"table_id",
"frequency",
Expand All @@ -98,7 +102,21 @@
"name": "CMIP5",
"full_name": "Coupled Model Intercomparison Project Phase 5",
"project_url": "https://pcmdi.llnl.gov/mips/cmip5/",
"description": "Under the World Climate Research Programme (WCRP) the Working Group on Coupled Modelling (WGCM) established the Coupled Model Intercomparison Project (CMIP) as a standard experimental protocol for studying the output of coupled atmosphere-ocean general circulation models (AOGCMs). CMIP provides a community-based infrastructure in support of climate model diagnosis, validation, intercomparison, documentation and data access. This framework enables a diverse community of scientists to analyze GCMs in a systematic fashion, a process which serves to facilitate model improvement. Virtually the entire international climate modeling community has participated in this project since its inception in 1995. The Program for Climate Model Diagnosis and Intercomparison (PCMDI) archives much of the CMIP data and provides other support for CMIP. PCMDI's CMIP effort is funded by the Regional and Global Climate Modeling (RGCM) Program of the Climate and Environmental Sciences Division of the U.S. Department of Energy's Office of Science, Biological and Environmental Research (BER) program.",
"description": (
"Under the World Climate Research Programme (WCRP) the Working Group on Coupled "
"Modelling (WGCM) established the Coupled Model Intercomparison Project (CMIP) as "
"a standard experimental protocol for studying the output of coupled atmosphere-ocean "
"general circulation models (AOGCMs). CMIP provides a community-based infrastructure "
"in support of climate model diagnosis, validation, intercomparison, documentation and "
"data access. This framework enables a diverse community of scientists to analyze GCMs "
"in a systematic fashion, a process which serves to facilitate model improvement. Virtually "
"the entire international climate modeling community has participated in this project since "
"its inception in 1995. The Program for Climate Model Diagnosis and Intercomparison (PCMDI) "
"archives much of the CMIP data and provides other support for CMIP. PCMDI's CMIP effort is "
"funded by the Regional and Global Climate Modeling (RGCM) Program of the Climate and Environmental "
"Sciences Division of the U.S. Department of Energy's Office of Science, Biological and Environmental "
"Research (BER) program."
),
"facets_by_group": {
GROUPS[0]: [
"project",
Expand All @@ -107,10 +125,7 @@
"model",
"data_node",
],
GROUPS[1]: [
"experiment",
"experiment_family",
],
GROUPS[1]: ["experiment", "experiment_family"],
GROUPS[4]: [
"time_frequency",
"realm",
Expand All @@ -126,7 +141,13 @@
"name": "E3SM",
"full_name": "Energy Exascale Earth System Model",
"project_url": "https://e3sm.org/",
"description": "The Energy Exascale Earth System Model (E3SM), formerly known as Accelerated Climate Modeling for Energy (ACME) project is an ongoing, state-of-the-science Earth system modeling, simulation, and prediction project, sponsored by the U.S. Department of Energy's (DOE's) Office of Biological and Environmental Research (BER), that optimizes the use of DOE laboratory computational resources to meet the science needs of the nation and the mission needs of DOE.",
"description": (
"The Energy Exascale Earth System Model (E3SM), formerly known as Accelerated Climate Modeling for "
"Energy (ACME) project is an ongoing, state-of-the-science Earth system modeling, simulation, and "
"prediction project, sponsored by the U.S. Department of Energy's (DOE's) Office of Biological and "
"Environmental Research (BER), that optimizes the use of DOE laboratory computational resources to "
"meet the science needs of the nation and the mission needs of DOE."
),
"facets_by_group": {
GROUPS[0]: ["data_node"],
GROUPS[1]: [
Expand Down Expand Up @@ -156,26 +177,33 @@
"name": "CMIP3",
"full_name": "Coupled Model Intercomparison Project Phase 3",
"project_url": "https://pcmdi.llnl.gov/mips/cmip3/",
"description": "n response to a proposed activity of the World Climate Research Programme's (WCRP's) Working Group on Coupled Modelling (WGCM), PCMDI volunteered to collect model output contributed by leading modeling centers around the world. Climate model output from simulations of the past, present and future climate was collected by PCMDI mostly during the years 2005 and 2006, and this archived data constitutes phase 3 of the Coupled Model Intercomparison Project (CMIP3). In part, the WGCM organized this activity to enable those outside the major modeling centers to perform research of relevance to climate scientists preparing the Fourth Asssessment Report (AR4) of the Intergovernmental Panel on Climate Change (IPCC). The IPCC was established by the World Meteorological Organization and the United Nations Environmental Program to assess scientific information on climate change. The IPCC publishes reports that summarize the state of the science.",
"description": (
"In response to a proposed activity of the World Climate Research Programme's (WCRP's) Working Group on "
"Coupled Modelling (WGCM), PCMDI volunteered to collect model output contributed by leading modeling centers "
"around the world. Climate model output from simulations of the past, present and future climate was collected "
"by PCMDI mostly during the years 2005 and 2006, and this archived data constitutes phase 3 of the Coupled Model "
"Intercomparison Project (CMIP3). In part, the WGCM organized this activity to enable those outside the major "
"modeling centers to perform research of relevance to climate scientists preparing the Fourth Assessment Report "
"(AR4) of the Intergovernmental Panel on Climate Change (IPCC). The IPCC was established by the World Meteorological "
"Organization and the United Nations Environmental Program to assess scientific information on climate change. The "
"IPCC publishes reports that summarize the state of the science."
),
"facets_by_group": {
GROUPS[0]: [
"model",
"experiment",
"institute",
],
GROUPS[4]: [
"variable",
"realm",
"time_frequency",
"ensemble",
],
GROUPS[0]: ["model", "experiment", "institute"],
GROUPS[4]: ["variable", "realm", "time_frequency", "ensemble"],
},
},
{
"name": "input4MIPs",
"full_name": "input datasets for Model Intercomparison Projects",
"project_url": "https://pcmdi.llnl.gov/mips/input4MIPs/",
"description": "input4MIPS (input datasets for Model Intercomparison Projects) is an activity to make available via ESGF the boundary condition and forcing datasets needed for CMIP6. Various datasets are needed for the pre-industrial control (piControl), AMIP, and historical simulations, and additional datasets are needed for many of the CMIP6-endorsed model intercomparison projects (MIPs) experiments. Earlier versions of many of these datasets were used in the 5th Coupled Model Intercomparison Project (CMIP5).",
"description": (
"input4MIPS (input datasets for Model Intercomparison Projects) is an activity to make available via ESGF the "
"boundary condition and forcing datasets needed for CMIP6. Various datasets are needed for the pre-industrial "
"control (piControl), AMIP, and historical simulations, and additional datasets are needed for many of the "
"CMIP6-endorsed model intercomparison projects (MIPs) experiments. Earlier versions of many of these datasets "
"were used in the 5th Coupled Model Intercomparison Project (CMIP5)."
),
"facets_by_group": {
GROUPS[0]: [
"mip_era",
Expand All @@ -202,18 +230,19 @@
"name": "obs4MIPs",
"full_name": "observations for Model Intercomparison Projects",
"project_url": "https://pcmdi.github.io/obs4MIPs/",
"description": "Obs4MIPs (Observations for Model Intercomparisons Project) is an activity to make observational products more accessible for climate model intercomparisons via the same searchable distributed system used to serve and disseminate the rapidly expanding set of simulations made available for community research.",
"description": (
"Obs4MIPs (Observations for Model Intercomparisons Project) is an activity to make observational products more "
"accessible for climate model intercomparisons via the same searchable distributed system used to serve and "
"disseminate the rapidly expanding set of simulations made available for community research."
),
"facets_by_group": {
GROUPS[0]: [
"product",
"realm",
"data_node",
],
GROUPS[1]: ["source_id"
GROUPS[0]: ["product", "realm", "data_node"],
GROUPS[1]: [
"source_id",
"institution_id",
"region",
"source_type",
],
],
GROUPS[4]: [
"variable",
"variable_long_name",
Expand All @@ -230,7 +259,14 @@
{
"name": "CREATE-IP",
"full_name": "Collaborative REAnalysis Technical Environment",
"description": "The Collaborative REAnalysis Technical Environment (CREATE) is a NASA Climate Model Data Services (CDS) project to collect all available global reanalysis data into one centralized location on NASA’s NCCS Advanced Data Analytics Platform (ADAPT), standardizing data formats, providing analytic capabilities, visualization analysis capabilities, and overall improved access to multiple reanalysis datasets. The CREATE project encompasses two efforts - CREATE-IP and CREATE-V. CREATE-IP is the project that collects and formats the reanalyses data. The list of variables currently available in CREATE-IP is growing over time so please check back frequently.",
"description": (
"The Collaborative REAnalysis Technical Environment (CREATE) is a NASA Climate Model Data Services (CDS) project to "
"collect all available global reanalysis data into one centralized location on NASA’s NCCS Advanced Data Analytics "
"Platform (ADAPT), standardizing data formats, providing analytic capabilities, visualization analysis capabilities, "
"and overall improved access to multiple reanalysis datasets. The CREATE project encompasses two efforts - CREATE-IP "
"and CREATE-V. CREATE-IP is the project that collects and formats the reanalyses data. The list of variables currently "
"available in CREATE-IP is growing over time so please check back frequently."
),
"project_url": "https://reanalyses.org/",
"facets_by_group": {
GROUPS[0]: [
Expand All @@ -255,19 +291,19 @@
},
{
"name": "DRCDP",
"description" : "Downscaled CMIP data for North America",
"facets_by_group" :{
"Search Properties": [
"description": "Downscaled CMIP data for North America",
"facets_by_group": {
"Search Properties": [
"downscaling_source_id",
"institution_id",
"driving_source_id",
"driving_experiment_id",
"source_id",
"version_realization",
"variable_id",
"driving_activity_id"
"driving_activity_id",
]
}
},
},
{
"name": "All (except CMIP6)",
Expand Down
10 changes: 6 additions & 4 deletions frontend/src/components/NodeStatus/StatusToolTip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ const StatusToolTip: React.FC<React.PropsWithChildren<Props>> = ({
children,
}) => {
if (nodeStatus) {
const node = (nodeStatus.find(
(obj) => obj.name === dataNode
const node = (nodeStatus.find((obj) =>
obj.name.includes(dataNode)
) as unknown) as NodeStatusElement;

/* istanbul ignore else*/
Expand Down Expand Up @@ -107,7 +107,8 @@ const StatusToolTip: React.FC<React.PropsWithChildren<Props>> = ({
title={
<>
Could not fetch status. Please contact support or try again later.
Data Node:<div>{dataNode}</div>
Data Node:
<div>{dataNode}</div>
</>
}
>
Expand All @@ -123,7 +124,8 @@ const StatusToolTip: React.FC<React.PropsWithChildren<Props>> = ({
title={
<>
Could not fetch status. Please contact support or try again later.
Data Node:<div>{dataNode}</div>
Data Node:
<div>{dataNode}</div>
</>
}
>
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/test/mock/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export const rawNodeStatusFixture = (
{
metric: {
__name__: 'probe_success',
instance: 'aims3.llnl.gov',
instance: 'https://aims3.llnl.gov',
job: 'http_2xx',
target: 'https://aims3.llnl.gov/thredds/catalog/catalog.html',
},
Expand All @@ -268,7 +268,7 @@ export const rawNodeStatusFixture = (
{
metric: {
__name__: 'probe_success',
instance: 'esgf1.dkrz.de',
instance: 'https://esgf1.dkrz.de',
job: 'http_2xx',
target: 'https://esgf1.dkrz.de/thredds/catalog/catalog.html',
},
Expand All @@ -282,13 +282,13 @@ export const rawNodeStatusFixture = (
};
export const parsedNodeStatusFixture = (): NodeStatusArray => [
{
name: 'aims3.llnl.gov',
name: 'https://aims3.llnl.gov',
source: 'https://aims3.llnl.gov/thredds/catalog/catalog.html',
timestamp: 'Wed, 21 Oct 2020 21:23:50 GMT',
isOnline: true,
},
{
name: 'esgf1.dkrz.de',
name: 'https://esgf1.dkrz.de',
source: 'https://esgf1.dkrz.de/thredds/catalog/catalog.html',
timestamp: 'Wed, 21 Oct 2020 21:23:50 GMT',
isOnline: false,
Expand Down

0 comments on commit 9aeb52d

Please sign in to comment.