Skip to content

feat: climate risk from cmip cordex - #18

Open
jdroenner wants to merge 32 commits into
mainfrom
cmip_cordex
Open

feat: climate risk from cmip cordex#18
jdroenner wants to merge 32 commits into
mainfrom
cmip_cordex

Conversation

@jdroenner

Copy link
Copy Markdown
Member

No description provided.

@coveralls

coveralls commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 82.65% (+2.2%) from 80.475% — cmip_cordex into main

@jdroenner jdroenner changed the title feat: climeate rist from cmip cordex feat: climate risk from cmip cordex Jul 8, 2026

@ChristianBeilschmidt ChristianBeilschmidt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Konnte das aus Gründen (Karte) nicht anwenden. Aber hier schon mal meine Kommentare.

Comment thread k8s/pod.yaml
volumeMounts:
- name: pgdata
mountPath: /var/lib/postgresql/data
mountPath: /var/lib/postgresql/18/docker

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warum ist das anders, obwohl sich sonst nichts an der Container-Config geändert hat?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread rust-toolchain.toml Outdated
Comment thread backend/Cargo.toml Outdated
Comment thread backend/src/processes/climate_cordex_cmip5.rs Outdated

/// Calculates climate-risk indicators from CORDEX/CMIP5 climate data for a given point and time window.
#[derive(Debug, Clone)]
pub struct ClimateCordex5Process;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vielleicht mehr User-facing benennen. Was macht der User damit?

Cordex sagt ja mehr über die Quelldaten.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ich hab es umbenannt

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, am besten auch noch Modul umbenennen.

Comment on lines +1023 to +1042
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()) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Die Variablen-Namen werden in einem Monat kryptisch sein. Ist nicht so gebräuchlich, also ausschreiben?

Comment thread rust-toolchain.toml Outdated
@@ -0,0 +1 @@
./backend/rust-toolchain.toml No newline at end of file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage am besten > 80% lassen.

Comment thread backend/src/processes/climate_cordex_cmip5.rs Outdated
Comment thread backend/src/processes/climate_cordex_cmip5.rs Outdated
Comment thread frontend/src/app/create-new-auto/simple-form-field.ts Outdated
jdroenner added 13 commits July 21, 2026 12:10
…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 ChristianBeilschmidt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ich konnte jetzt erst einmal nur Code-only anschauen. Müssen noch mal wegen der Daten sprechen.

Comment on lines +41 to +47
/// 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>,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check: Sind das validate table schema Felder (https://datapackage.org/standard/table-schema/)

String,
Number,
Integer,
Percentage,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Es gibt keinen Percentage-Typ bei TableSchema: https://datapackage.org/standard/table-schema/#field-types


impl Default for YearRange {
fn default() -> Self {
YearRange(20)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// 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)]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

brauchst du bei den Ausgaben immer auch Deserialize?

</td>
}
}
@case (ColumnType.Percentage) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Den Typ gibt es ja nicht in TableSchema

<mat-chip class="cell-content">
<span
class="color-dot"
[style.background-color]="element[column.colorField]"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/).

Comment on lines +100 to +106
title:
typeof innerValue === 'object' &&
innerValue !== null &&
'name' in innerValue &&
typeof innerValue.name === 'string'
? innerValue.name
: this.fieldName(key),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, am besten auch noch Modul umbenennen.

Comment thread backend/Cargo.toml Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants