Skip to content

feat: climate risk from cmip cordex - #18

Open
jdroenner wants to merge 23 commits into
mainfrom
cmip_cordex
Open

feat: climate risk from cmip cordex#18
jdroenner wants to merge 23 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: 88.62% (+2.4%) from 86.221% — 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 Outdated
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.

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.

Also ich hab das nochmal versucht aber mit dem neusten Image geht das einfach nicht anders :(

Comment thread rust-toolchain.toml Outdated
Comment thread backend/Cargo.toml Outdated
Comment thread backend/src/processes/climate_cordex_cmip5.rs Outdated
Comment thread backend/src/processes/climate_cordex_cmip5.rs Outdated
Comment thread backend/src/processes/climate_cordex_cmip5.rs Outdated
Comment thread rust-toolchain.toml Outdated
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

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

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 das nochmal neu gemacht / machen lassen. Es müsste jetzt korrekt sein

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.

das nutzt ja jetzt dieses extra Pofil: CLIMATE_RISK_TABLE_SCHEMA_PROFILE das wurde in c00f12a eingebaut aber hat sich weiter entwickelt. ist in "/backend/Src/profile.rs"

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

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.

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

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.

es gibt jetzt dafür das extra Schema

Comment thread backend/src/processes/parameters/units.rs Outdated
Comment thread backend/src/processes/parameters/units.rs Outdated
Comment thread backend/src/processes/climate_cordex_cmip5.rs Outdated
Comment thread frontend/src/app/result/data-resource-table.component.ts Outdated
<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/).

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.

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.

Comment thread frontend/src/app/result/result.component.ts Outdated
Comment thread backend/src/processes/climate_cordex_cmip5.rs Outdated
Comment thread backend/Cargo.toml Outdated

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

Alles bis auf Tabelle

Comment thread backend/src/processes/parameters/mod.rs
Comment thread backend/src/processes/parameters/data_resource.rs Outdated
pub min: f64,
pub max: f64,
#[serde(skip_serializing_if = "Option::is_none")]
pub occurrence_probability: Option<f64>,

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.

Der Typ serialisiert doch nach String.

Comment thread backend/src/processes/climate_cordex_cmip5.rs Outdated
Comment thread backend/src/processes/climate_cordex_cmip5.rs Outdated
Comment thread backend/src/processes/climate_cordex_cmip5.rs Outdated
Comment thread backend/src/processes/climate_cordex_cmip5.rs Outdated
Comment on lines +102 to +127
// Resolve nullable primitives like {"anyOf": [{"$ref": ...}, {"type": "null"}]} to their type
if (!type && (schema.anyOf || schema.oneOf)) {
const branches = (schema.anyOf ?? schema.oneOf) as JSONSchema[];
const nonNull = branches.find(
(branch) =>
typeof branch !== 'object' ||
branch === null ||
(branch as BaseJSONSchema)['type'] !== 'null',
);
if (nonNull) {
const resolved = resolveSchemaRef(schema, nonNull);
const resolvedType =
typeof resolved === 'object' && resolved !== null
? (resolved as BaseJSONSchema)['type']
: undefined;
if (
resolvedType === 'string' ||
resolvedType === 'number' ||
resolvedType === 'integer' ||
resolvedType === 'boolean'
) {
return typeFromSchema(resolved);
}
}
}

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.

aber sollte man das dann nicht da unten machen, wenn man einmal festgestellt hat !type? Dann macht man mit items das da oben und ohne return FieldType.NestedJson;

if (typeof example === 'string') return example;
}

return firstEnumOrFallback(schema, fallback);

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.

Da ist kein doc

grafik

Comment on lines +19 to +23
@if (type() === FieldType.Boolean) {
<mat-checkbox [checked]="value()" (change)="value.set($event.checked)"
>True/False</mat-checkbox
>
} @else {

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.

Das beantwortet nicht die Frage; evtl. eigene Component?

…y→Days rename

- Consolidate 56 tests to 39 via table-driven tests (item 9)
- Move tests inline into mod.rs, types.rs, compute.rs, workflow.rs; delete tests.rs (item 10)
- Document DAYS_PER_JULIAN_YEAR constant (item 11)
- Rename Day → Days to reserve Day for a future concrete calendar day type
- Extract boolean-field component (item 7)
- Move nullable schema resolution to !type guard (item 5)
- Add JSDoc to firstEnumOrFallback (item 6)
- Add doc comment to nearest_containing (item 1)
- Rename to BioISTableSchemaExtension (item 2)
- Remove #[allow(clippy::too_many_lines)] via build_inputs/build_outputs extraction (item 3)
- Extract model_display_name helper (item 4)
# Conflicts:
#	backend/src/handler.rs
#	backend/src/processes/climate_risk/compute.rs
#	backend/src/processes/climate_risk/mod.rs
#	backend/src/processes/climate_risk/types.rs
#	backend/src/processes/climate_risk/workflow.rs
#	backend/src/processes/parameters/data_resource.rs
#	backend/src/processes/parameters/mod.rs
#	backend/src/processes/parameters/units.rs
#	backend/src/server.rs
#	frontend/src/app/create/create.component.spec.ts
#	frontend/src/app/create/schema-info.ts
#	frontend/src/app/create/simple-form-field.ts

import { ClimateRiskInputs } from '../models/ClimateRiskInputs';
import { Response } from '../models/Response';
import { HttpFile } from '../http/http';

import { ClimateRiskInputs } from '../models/ClimateRiskInputs';
import { DataResource } from '../models/DataResource';
import { HttpFile } from '../http/http';
import { CordexModel } from '../models/CordexModel';
import { CordexRegion } from '../models/CordexRegion';
import { PointGeoJsonInput } from '../models/PointGeoJsonInput';
import { HttpFile } from '../http/http';
* Do not edit the class manually.
*/

import { HttpFile } from '../http/http';
* Do not edit the class manually.
*/

import { HttpFile } from '../http/http';
* Do not edit the class manually.
*/

import { HttpFile } from '../http/http';
import { ClimateRiskInputs } from '../models/ClimateRiskInputs';
import { ClimateRiskOutputs } from '../models/ClimateRiskOutputs';
import { ClimateRiskProcessParams } from '../models/ClimateRiskProcessParams';
import { ClimateVariable } from '../models/ClimateVariable';
import { Constraints7 } from '../models/Constraints7';
import { Constraints8 } from '../models/Constraints8';
import { Constraints9 } from '../models/Constraints9';
import { CordexModel } from '../models/CordexModel';
import { Constraints8 } from '../models/Constraints8';
import { Constraints9 } from '../models/Constraints9';
import { CordexModel } from '../models/CordexModel';
import { CordexRegion } from '../models/CordexRegion';
import { BiodiversitySensitiveAreasProcessParams } from '../models/BiodiversitySensitiveAreasProcessParams';
import { BooleanField } from '../models/BooleanField';
import { BoundingBox } from '../models/BoundingBox';
import { ClimateRiskInputs } from '../models/ClimateRiskInputs';
@jdroenner
jdroenner changed the base branch from main to v1 August 24, 2026 09:27
@jdroenner
jdroenner changed the base branch from v1 to main August 24, 2026 09:27
…a hints

The new climate-risk module dropped overall backend coverage below main
(87.7% vs 89.7%): its API-facing paths are covered by DB-backed tests, but
the pure aggregation/workflow-building logic was not.

- tests for build_workflows filtering, run_limited ordering/error handling,
  unpack_join_error formatting, aggregate_rows anomaly/raw-member handling,
  raw-ensemble sorting, input reflection into execute results, and the
  probability-class/region/scenario accessors
- fix models_schema_with_hints: schemars emits the enum behind items.$ref
  + $defs, so looking for 'enum' inside 'items' silently no-op'd and the
  enumNames hints were never attached; enrich the referenced definition
  instead
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