Skip to content

Commit 715dcfb

Browse files
authored
Allow current year to be selected for sea-level rise projections (#371)
* Allow current year to be selected for sea-level rise projections * Use current year programattically so that we don't have to update each year
1 parent 869df1b commit 715dcfb

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

floodresilience/dynamic_boundary_conditions/tide/main_tide_slr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def get_valid_parameters_based_on_confidence_level() -> Dict[str, Dict[str, Unio
157157
SELECT DISTINCT
158158
confidence_level,
159159
CONCAT(ssp, '-', scenario) AS ssp_scenarios,
160-
(DATE_PART('year', now()) + 1)::NUMERIC::BIGINT AS min_year,
160+
(DATE_PART('year', now()))::NUMERIC::BIGINT AS min_year,
161161
MAX(year) AS max_year
162162
FROM {slr_table_name}
163163
GROUP BY

floodresilience/flood_model/flood_scenario_process_service.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
"""Defines PyWPS WebProcessingService process for creating a flooding scenario."""
1919

20+
from datetime import datetime
2021
import json
2122
from urllib.parse import urlencode
2223

@@ -36,10 +37,11 @@ class FloodScenarioProcessService(Process):
3637
def __init__(self) -> None:
3738
"""Define inputs and outputs of the WPS process, and assign process handler."""
3839
# Create bounding box WPS inputs
40+
current_year = datetime.today().year
3941
inputs = [
4042
BoundingBoxInput("bboxIn", "Area of Interest", crss=["epsg:4326"]),
4143
LiteralInput("projYear", "Projected Year", data_type="integer",
42-
allowed_values=list(range(2026, 2151))),
44+
allowed_values=list(range(current_year, 2151))),
4345
LiteralInput("percentile", "Percentile", data_type="integer", allowed_values=[17, 50, 83], default=50),
4446
LiteralInput("sspScenario", "SSP Scenario", data_type="string", allowed_values=[
4547
"SSP1-1.9",

0 commit comments

Comments
 (0)