Skip to content
Snippets Groups Projects

Two quick fixes

Merged Mostafa Hadizadeh requested to merge qf-two-cases into master
All threads resolved!
+ 11
4
@@ -35,7 +35,7 @@ from evaluation_system.api.parameters import (
)
from evaluation_system.model.user import User
from evaluation_system.misc import logger
from evaluation_system.misc.exceptions import ParameterNotFoundError
import freva
class PET(plugin.PluginAbstract):
@@ -45,7 +45,7 @@ class PET(plugin.PluginAbstract):
__version__ = (2025, 1, 28)
__short_description__: str = (
"Calculation of daily Potential Evatransporation"
"(BETA version) Calculation of daily Potential Evatransporation"
)
__category__: Optional[str] = "postproc"
__tags__: Optional[List[str]] = ["Potential Evatranspiration"]
@@ -67,6 +67,7 @@ class PET(plugin.PluginAbstract):
facet="project",
mandatory=True,
help="Project facet for input data search.",
editable=False,
predefined_facets={
"variable": ["hurs", "sfcWind"],
"time_frequency": ["1day"],
@@ -76,6 +77,7 @@ class PET(plugin.PluginAbstract):
name="product",
facet="product",
mandatory=True,
editable=False,
help="Product facet for input data search.",
predefined_facets={
"variable": ["hurs", "sfcWind"],
@@ -85,6 +87,7 @@ class PET(plugin.PluginAbstract):
name="institute",
facet="institute",
mandatory=True,
editable=False,
help="Institute facet for input data search.",
predefined_facets={
"variable": ["hurs", "sfcWind"],
@@ -94,6 +97,7 @@ class PET(plugin.PluginAbstract):
name="model",
facet="model",
mandatory=True,
editable=False,
help="Model facet for input data search.",
predefined_facets={
"variable": ["hurs", "sfcWind"],
@@ -103,6 +107,7 @@ class PET(plugin.PluginAbstract):
name="experiment",
facet="experiment",
mandatory=True,
editable=False,
help="Experiment facet for input data search.",
predefined_facets={
"variable": ["hurs", "sfcWind"],
@@ -112,6 +117,7 @@ class PET(plugin.PluginAbstract):
name="ensemble",
facet="ensemble",
mandatory=True,
editable=False,
help="ensemble facet for input data search.",
predefined_facets={
"variable": ["hurs", "sfcWind"],
@@ -131,6 +137,7 @@ class PET(plugin.PluginAbstract):
),
String(
name="region",
mandatory=False,
default=None,
help="Region box to be processed. The format have to be W,E,S,N (e.g. -180,180,0,90 for NH).\nLeave empty to select the region from input grid."
),
@@ -165,7 +172,7 @@ class PET(plugin.PluginAbstract):
search_args = {key: config_dict[key] for key in facets}
if (set(self.project_vars).issubset(missing_vars)):
sys.exit(logger.error("There is no data for all required variables. Please check if the chosen data covers the defined time period."))
ParameterNotFoundError("There is no data for all required variables. Please check if the chosen data covers the defined time period.")
elif (len(missing_vars) > 0):
# remove facet stepwise and filter for possible alternative facet values
@@ -196,7 +203,7 @@ class PET(plugin.PluginAbstract):
# if at least one enrty covers all required variables, stop the search, otherwise continue
if (len(facet_suggestions) > 0):
error_msg = "There is data for some of the required variables missing (" + ", ".join(missing_vars) + ") ! Consider choose a different " + facet + ". \n Suggestions: " + ", ".join(facet_suggestions)
sys.exit(logger.error(error_msg))
ParameterNotFoundError(error_msg)
break
def find_orog(self, config_dict):
Loading