Generate forecast menu dynamically #213
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements new API endpoints for providing the frontend with an appropriate set of valid combinations for generating a navigation for forecast datasets.
Combinations of parameters are generated like this:
climatological_variable
-aggregation_period
-measure
(e.g.tas-30yr-anomaly
)This way of combining the existing parameters allows us to correctly represent entries like:
snwdays
dataset has both30yr
anomaly
and aannual
absolute
entries and they support different combinations of other parametersHWDI
dataset, which is only available in theJJA
seasonTAS
annual
anomaly
does not have atime_window
, butTAS
30yr
anomaly
does have itfor example:
The new endpoint is reachable at:
it returns an object with this structure:
where
combinations
is a list of objects describing entries as mentioned above andtranslations
is an object with the translation for the various parameters, allowing the construction of a localized navigation in both english and italian