feat: climate risk from cmip cordex - #18
Conversation
ChristianBeilschmidt
left a comment
There was a problem hiding this comment.
Konnte das aus Gründen (Karte) nicht anwenden. Aber hier schon mal meine Kommentare.
| volumeMounts: | ||
| - name: pgdata | ||
| mountPath: /var/lib/postgresql/data | ||
| mountPath: /var/lib/postgresql/18/docker |
There was a problem hiding this comment.
Warum ist das anders, obwohl sich sonst nichts an der Container-Config geändert hat?
There was a problem hiding this comment.
|
|
||
| /// Calculates climate-risk indicators from CORDEX/CMIP5 climate data for a given point and time window. | ||
| #[derive(Debug, Clone)] | ||
| pub struct ClimateCordex5Process; |
There was a problem hiding this comment.
Vielleicht mehr User-facing benennen. Was macht der User damit?
Cordex sagt ja mehr über die Quelldaten.
There was a problem hiding this comment.
Ok, am besten auch noch Modul umbenennen.
| let wfl_ids = | ||
| try_join_all(variable_workflows.map(|wfl| register_workflow_handler(configuration, wfl))) | ||
| .await; | ||
|
|
||
| let wfl_ids = match wfl_ids { | ||
| Ok(id) => id, | ||
| Err(e) => { | ||
| if let Some(error) = error_response(&e) { | ||
| anyhow::bail!("Failed to register a workflow `{e}`: {error:?}"); | ||
| } | ||
| anyhow::bail!("Failed to register a workflow `{e}`"); | ||
| } | ||
| }; | ||
|
|
||
| let wfl_id_str = wfl_ids | ||
| .iter() | ||
| .map(|workflow_id| workflow_id.id.to_string()) | ||
| .collect::<Vec<_>>(); | ||
|
|
||
| for (wf_id, v) in wfl_id_str.iter().zip(var_props.iter()) { |
There was a problem hiding this comment.
Die Variablen-Namen werden in einem Monat kryptisch sein. Ist nicht so gebräuchlich, also ausschreiben?
| @@ -0,0 +1 @@ | |||
| ./backend/rust-toolchain.toml No newline at end of file | |||
There was a problem hiding this comment.
Coverage am besten > 80% lassen.
…Process, add multi-scenario support, default year range
Resolve conflicts from main's land-use/sealed-area PR (#20): - Keep main's create/ form architecture (delete create-new-auto/) - Port StringArray multi-select support into main's schema-info.ts and inputs-visualizer.component.ts - Keep both ClimateRiskProcess and LandUseSealedAreaProcess registered - Port BoundingBox2D into main's parameters/ module - Fix latent mat-checkbox-in-mat-form-field error for boolean inputs - Rename to_api_workflow -> to_api_vector_process - Re-add Deserialize to DataResource (needed by climate outputs)
The merge commit missed unstaged fixes. Include them: - backend: rename to_api_workflow -> to_api_vector_process, add Deserialize to DataResource - frontend: StringArray field type in schema-info, multi-select in inputs-visualizer, precedence case in create.component, fix mat-checkbox-in-mat-form-field error for boolean inputs - unify BoundingBox2D into BoundingBox (contains/around_point added, climate process uses wfs_string instead of field destructuring)
- Replace year_end with year_range (5-30, default 20) plus optional reference_year_begin (default 2020, null to opt out of anomaly) - Backend computes hex colors for occurrence probability and anomaly cells; TableSchemaField.color_field wires companion columns - Replace fragile chunks_exact(2) pairing with structural tuple batches for analysis/reference WFS queries
…ta floor - Emit ExecuteResults under machine-name scenario keys (rcp26/45/85) while keeping display names in table rows - Log a warning instead of silently dropping anomalies when the reference period yields no data - Enforce DATA_START_YEAR=2006 for both analysis and reference start years
- referenceYearBegin input schema is now nullable (Option<Year>) with default 2006 and min_occurs 0 - Frontend resolves nullable integer schemas to a number field, defaults optional-with-default fields to their default, and sends explicit null instead of dropping it so the backend opt-out is reachable
Mark the rawEnsembleData output with a default-disabled metadata role in the process description, have the frontend leave such outputs unchecked by default, and omit rawEnsembleData from execute results unless requested.
resolve_requests now reports whether rawEnsembleData was requested, so the raw-data gating in execute no longer re-scans the output keys directly.
The OGC API Input enum has no null variant, so sending null for unset optional inputs (e.g. region) returned 404. Omit null values when building the request instead, and make the anomaly reference period opt-out express as omission: referenceYearBegin is now absent=None in the backend while the UI still defaults it to 2006 via the schema default.
The region input's enum lives behind an anyOf/oneOf with a null branch and a $ref into $defs, so enumOptions returned no options and the StringEnum default was an empty string, which the zod enum schema rejected and rendered red. Resolve single-value enums through the null branch and $ref, and default StringEnum inputs to their first enum value.
ChristianBeilschmidt
left a comment
There was a problem hiding this comment.
Ich konnte jetzt erst einmal nur Code-only anschauen. Müssen noch mal wegen der Daten sprechen.
| /// Name of a row property that carries the cell color (hex) for this column. | ||
| #[serde(default, skip_serializing_if = "Option::is_none")] | ||
| pub color_field: Option<String>, | ||
| /// Name of a row property that carries a ready-to-display label for this column. | ||
| /// When set, the frontend renders it instead of the raw value. | ||
| #[serde(default, skip_serializing_if = "Option::is_none")] | ||
| pub label_field: Option<String>, |
There was a problem hiding this comment.
Check: Sind das validate table schema Felder (https://datapackage.org/standard/table-schema/)
| String, | ||
| Number, | ||
| Integer, | ||
| Percentage, |
There was a problem hiding this comment.
Es gibt keinen Percentage-Typ bei TableSchema: https://datapackage.org/standard/table-schema/#field-types
|
|
||
| impl Default for YearRange { | ||
| fn default() -> Self { | ||
| YearRange(20) |
There was a problem hiding this comment.
Ich denke nicht, dass das ein guter Default ist.
Wenn das bei dem einen Prozess sinnvoll ist, dann vielleicht den Default dort definieren.
| } | ||
| } | ||
|
|
||
| /// Length of a climate window in years (e.g., 5-30 years). |
There was a problem hiding this comment.
| /// Length of a climate window in years (e.g., 5-30 years). | |
| /// Length of a time window in years (e.g., 5 years). |
Hat ja nicht immer was mit Klima zu tun und man kann kein von bis angeben.
| pub region: Option<CordexRegion>, | ||
| } | ||
|
|
||
| #[derive(Deserialize, Serialize, Debug, JsonSchema, ToSchema, Clone)] |
There was a problem hiding this comment.
brauchst du bei den Ausgaben immer auch Deserialize?
| </td> | ||
| } | ||
| } | ||
| @case (ColumnType.Percentage) { |
There was a problem hiding this comment.
Den Typ gibt es ja nicht in TableSchema
| <mat-chip class="cell-content"> | ||
| <span | ||
| class="color-dot" | ||
| [style.background-color]="element[column.colorField]" |
There was a problem hiding this comment.
Irgendwie fühlt es sich falsch an, eine Spalte mit Farbwerten zu haben.
Evtl. finden wir andere Felder für Metadaten oder müssen eine Extension machen (https://datapackage.org/standard/extensions/).
| title: | ||
| typeof innerValue === 'object' && | ||
| innerValue !== null && | ||
| 'name' in innerValue && | ||
| typeof innerValue.name === 'string' | ||
| ? innerValue.name | ||
| : this.fieldName(key), |
There was a problem hiding this comment.
Woh, was ist hier passiert? Evtl. eine Funktion mit Doc?
|
|
||
| /// Calculates climate-risk indicators from CORDEX/CMIP5 climate data for a given point and time window. | ||
| #[derive(Debug, Clone)] | ||
| pub struct ClimateCordex5Process; |
There was a problem hiding this comment.
Ok, am besten auch noch Modul umbenennen.
No description provided.