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?
There was a problem hiding this comment.
Kryptische Variablennamen sind ausgeschrieben (z.B. model statt m, workflow statt wfl).
| @@ -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.
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/)
There was a problem hiding this comment.
Erledigt. Alle verwendeten Feld-Typen sind gültige Table-Schema-Typen (string/number/integer/boolean). Die nicht standardkonformen list/itemType wurden durch type: "array" mit items-Deskriptor ersetzt.
| 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
There was a problem hiding this comment.
Percentage ist jetzt nur noch ein Units-Helfer und taucht nicht mehr als Table-Schema-Feld-Typ auf. Die Prozent-Anzeige (z.B. "+10 days (+20 %)") läuft über die biois-Extension (labelField/colorField).
|
|
||
| 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.
There was a problem hiding this comment.
Der Default wurde aus units.rs entfernt und ist jetzt prozesslokal definiert (default_year_range() in climate_risk).
| } | ||
| } | ||
|
|
||
| /// 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.
There was a problem hiding this comment.
Docstring wie vorgeschlagen angepasst: Length of a time window in years (e.g., 5 years).
| 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?
There was a problem hiding this comment.
Für die Ausgaben wird nur noch Serialize benötigt; Deserialize ist auf die Eingabetypen beschränkt.
| </td> | ||
| } | ||
| } | ||
| @case (ColumnType.Percentage) { |
There was a problem hiding this comment.
Den Typ gibt es ja nicht in TableSchema
There was a problem hiding this comment.
Erledigt - der Feld-Typ heißt jetzt array (mit items-Deskriptor) statt list, konform zu Table Schema.
| <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/).
There was a problem hiding this comment.
Die Farb-/Label-Werte sind jetzt hiddenFields und über eine Table-Schema-Extension (biois.display mit kind/labelField/colorField) an die Datenfelder gebunden. Keine sichtbare Farbwert-Spalte mehr.
| 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?
There was a problem hiding this comment.
Der Code ist in benannte Funktionen mit Doc-Kommentaren zerlegt (u.a. dataResourceTitle, fixDataValue).
|
|
||
| /// 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.
|
Alle Review-Kommentare wurden adressiert. Zusammenfassung der Änderungen: Backend (climate_risk):
Table Schema (shared):
Frontend:
Prüfungen: |
No description provided.