Skip to content

Removes low level thingy from high level interface (and docs)

b04a5e3
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Open

Risk Trajectory Split 5: Interpolated Risk Trajectories #1201

Removes low level thingy from high level interface (and docs)
b04a5e3
Select commit
Loading
Failed to load commit list.
GitHub Actions / Core / Unit Test Results (3.12) failed Jan 8, 2026 in 0s

21 fail, 1 skipped, 853 pass in 5m 53s

  1 files  ±0    1 suites  ±0   5m 53s ⏱️ -1s
875 tests ±0  853 ✅  - 3  1 💤 ±0  21 ❌ +3 
886 runs  ±0  864 ✅  - 3  1 💤 ±0  21 ❌ +3 

Results for commit b04a5e3. ± Comparison against earlier commit 26ac588.

Annotations

Check warning on line 0 in climada.trajectories.test.test_calc_risk_metrics.TestCalcRiskMetricsPoints

See this annotation in the file changed.

@github-actions github-actions / Core / Unit Test Results (3.12)

test_apply_measure (climada.trajectories.test.test_calc_risk_metrics.TestCalcRiskMetricsPoints) failed

tests_xml/tests.xml [took 0s]
Raw output
TypeError: Snapshot.__init__() missing 1 required keyword-only argument: 'measure'
self = <test_calc_risk_metrics.TestCalcRiskMetricsPoints testMethod=test_apply_measure>

    def setUp(self):
        # Create mock objects for testing
        self.present_date = 2020
        self.future_date = 2025
        self.exposure_present = Exposures.from_hdf5(EXP_DEMO_H5)
        self.exposure_present.gdf.rename(columns={"impf_": "impf_TC"}, inplace=True)
        self.exposure_present.gdf["impf_TC"] = 1
        self.exposure_present.gdf[GROUP_ID_COL_NAME] = (
            self.exposure_present.gdf["value"]
            > self.exposure_present.gdf["value"].mean()
        ) * 1
        self.hazard_present = Hazard.from_hdf5(HAZ_DEMO_H5)
        self.exposure_present.assign_centroids(self.hazard_present, distance="approx")
        self.impfset_present = ImpactFuncSet([ImpfTropCyclone.from_emanuel_usa()])
    
        self.exposure_future = Exposures.from_hdf5(EXP_DEMO_H5)
        n_years = self.future_date - self.present_date + 1
        growth_rate = 1.02
        growth = growth_rate**n_years
        self.exposure_future.gdf["value"] = self.exposure_future.gdf["value"] * growth
        self.exposure_future.gdf.rename(columns={"impf_": "impf_TC"}, inplace=True)
        self.exposure_future.gdf["impf_TC"] = 1
        self.exposure_future.gdf[GROUP_ID_COL_NAME] = (
            self.exposure_future.gdf["value"] > self.exposure_future.gdf["value"].mean()
        ) * 1
        self.hazard_future = Hazard.from_hdf5(HAZ_DEMO_H5)
        self.hazard_future.intensity *= 1.1
        self.exposure_future.assign_centroids(self.hazard_future, distance="approx")
        self.impfset_future = ImpactFuncSet(
            [
                ImpfTropCyclone.from_emanuel_usa(impf_id=1, v_half=60.0),
            ]
        )
    
        self.measure = MagicMock(spec=Measure)
        self.measure.name = "Test Measure"
    
        # Setup mock return values for measure.apply
        self.measure_exposure = MagicMock(spec=Exposures)
        self.measure_hazard = MagicMock(spec=Hazard)
        self.measure_impfset = MagicMock(spec=ImpactFuncSet)
        self.measure.apply.return_value = (
            self.measure_exposure,
            self.measure_impfset,
            self.measure_hazard,
        )
    
        # Create mock snapshots
>       self.mock_snapshot_start = Snapshot(
            exposure=self.exposure_present,
            hazard=self.hazard_present,
            impfset=self.impfset_present,
            date=self.present_date,
        )
E       TypeError: Snapshot.__init__() missing 1 required keyword-only argument: 'measure'

climada/trajectories/test/test_calc_risk_metrics.py:108: TypeError

Check warning on line 0 in climada.trajectories.test.test_calc_risk_metrics.TestCalcRiskMetricsPoints

See this annotation in the file changed.

@github-actions github-actions / Core / Unit Test Results (3.12)

test_calc_aai_metric (climada.trajectories.test.test_calc_risk_metrics.TestCalcRiskMetricsPoints) failed

tests_xml/tests.xml [took 0s]
Raw output
TypeError: Snapshot.__init__() missing 1 required keyword-only argument: 'measure'
self = <test_calc_risk_metrics.TestCalcRiskMetricsPoints testMethod=test_calc_aai_metric>

    def setUp(self):
        # Create mock objects for testing
        self.present_date = 2020
        self.future_date = 2025
        self.exposure_present = Exposures.from_hdf5(EXP_DEMO_H5)
        self.exposure_present.gdf.rename(columns={"impf_": "impf_TC"}, inplace=True)
        self.exposure_present.gdf["impf_TC"] = 1
        self.exposure_present.gdf[GROUP_ID_COL_NAME] = (
            self.exposure_present.gdf["value"]
            > self.exposure_present.gdf["value"].mean()
        ) * 1
        self.hazard_present = Hazard.from_hdf5(HAZ_DEMO_H5)
        self.exposure_present.assign_centroids(self.hazard_present, distance="approx")
        self.impfset_present = ImpactFuncSet([ImpfTropCyclone.from_emanuel_usa()])
    
        self.exposure_future = Exposures.from_hdf5(EXP_DEMO_H5)
        n_years = self.future_date - self.present_date + 1
        growth_rate = 1.02
        growth = growth_rate**n_years
        self.exposure_future.gdf["value"] = self.exposure_future.gdf["value"] * growth
        self.exposure_future.gdf.rename(columns={"impf_": "impf_TC"}, inplace=True)
        self.exposure_future.gdf["impf_TC"] = 1
        self.exposure_future.gdf[GROUP_ID_COL_NAME] = (
            self.exposure_future.gdf["value"] > self.exposure_future.gdf["value"].mean()
        ) * 1
        self.hazard_future = Hazard.from_hdf5(HAZ_DEMO_H5)
        self.hazard_future.intensity *= 1.1
        self.exposure_future.assign_centroids(self.hazard_future, distance="approx")
        self.impfset_future = ImpactFuncSet(
            [
                ImpfTropCyclone.from_emanuel_usa(impf_id=1, v_half=60.0),
            ]
        )
    
        self.measure = MagicMock(spec=Measure)
        self.measure.name = "Test Measure"
    
        # Setup mock return values for measure.apply
        self.measure_exposure = MagicMock(spec=Exposures)
        self.measure_hazard = MagicMock(spec=Hazard)
        self.measure_impfset = MagicMock(spec=ImpactFuncSet)
        self.measure.apply.return_value = (
            self.measure_exposure,
            self.measure_impfset,
            self.measure_hazard,
        )
    
        # Create mock snapshots
>       self.mock_snapshot_start = Snapshot(
            exposure=self.exposure_present,
            hazard=self.hazard_present,
            impfset=self.impfset_present,
            date=self.present_date,
        )
E       TypeError: Snapshot.__init__() missing 1 required keyword-only argument: 'measure'

climada/trajectories/test/test_calc_risk_metrics.py:108: TypeError

Check warning on line 0 in climada.trajectories.test.test_calc_risk_metrics.TestCalcRiskMetricsPoints

See this annotation in the file changed.

@github-actions github-actions / Core / Unit Test Results (3.12)

test_calc_aai_per_group_metric (climada.trajectories.test.test_calc_risk_metrics.TestCalcRiskMetricsPoints) failed

tests_xml/tests.xml [took 0s]
Raw output
TypeError: Snapshot.__init__() missing 1 required keyword-only argument: 'measure'
self = <test_calc_risk_metrics.TestCalcRiskMetricsPoints testMethod=test_calc_aai_per_group_metric>

    def setUp(self):
        # Create mock objects for testing
        self.present_date = 2020
        self.future_date = 2025
        self.exposure_present = Exposures.from_hdf5(EXP_DEMO_H5)
        self.exposure_present.gdf.rename(columns={"impf_": "impf_TC"}, inplace=True)
        self.exposure_present.gdf["impf_TC"] = 1
        self.exposure_present.gdf[GROUP_ID_COL_NAME] = (
            self.exposure_present.gdf["value"]
            > self.exposure_present.gdf["value"].mean()
        ) * 1
        self.hazard_present = Hazard.from_hdf5(HAZ_DEMO_H5)
        self.exposure_present.assign_centroids(self.hazard_present, distance="approx")
        self.impfset_present = ImpactFuncSet([ImpfTropCyclone.from_emanuel_usa()])
    
        self.exposure_future = Exposures.from_hdf5(EXP_DEMO_H5)
        n_years = self.future_date - self.present_date + 1
        growth_rate = 1.02
        growth = growth_rate**n_years
        self.exposure_future.gdf["value"] = self.exposure_future.gdf["value"] * growth
        self.exposure_future.gdf.rename(columns={"impf_": "impf_TC"}, inplace=True)
        self.exposure_future.gdf["impf_TC"] = 1
        self.exposure_future.gdf[GROUP_ID_COL_NAME] = (
            self.exposure_future.gdf["value"] > self.exposure_future.gdf["value"].mean()
        ) * 1
        self.hazard_future = Hazard.from_hdf5(HAZ_DEMO_H5)
        self.hazard_future.intensity *= 1.1
        self.exposure_future.assign_centroids(self.hazard_future, distance="approx")
        self.impfset_future = ImpactFuncSet(
            [
                ImpfTropCyclone.from_emanuel_usa(impf_id=1, v_half=60.0),
            ]
        )
    
        self.measure = MagicMock(spec=Measure)
        self.measure.name = "Test Measure"
    
        # Setup mock return values for measure.apply
        self.measure_exposure = MagicMock(spec=Exposures)
        self.measure_hazard = MagicMock(spec=Hazard)
        self.measure_impfset = MagicMock(spec=ImpactFuncSet)
        self.measure.apply.return_value = (
            self.measure_exposure,
            self.measure_impfset,
            self.measure_hazard,
        )
    
        # Create mock snapshots
>       self.mock_snapshot_start = Snapshot(
            exposure=self.exposure_present,
            hazard=self.hazard_present,
            impfset=self.impfset_present,
            date=self.present_date,
        )
E       TypeError: Snapshot.__init__() missing 1 required keyword-only argument: 'measure'

climada/trajectories/test/test_calc_risk_metrics.py:108: TypeError

Check warning on line 0 in climada.trajectories.test.test_calc_risk_metrics.TestCalcRiskMetricsPoints

See this annotation in the file changed.

@github-actions github-actions / Core / Unit Test Results (3.12)

test_calc_return_periods_metric (climada.trajectories.test.test_calc_risk_metrics.TestCalcRiskMetricsPoints) failed

tests_xml/tests.xml [took 0s]
Raw output
TypeError: Snapshot.__init__() missing 1 required keyword-only argument: 'measure'
self = <test_calc_risk_metrics.TestCalcRiskMetricsPoints testMethod=test_calc_return_periods_metric>

    def setUp(self):
        # Create mock objects for testing
        self.present_date = 2020
        self.future_date = 2025
        self.exposure_present = Exposures.from_hdf5(EXP_DEMO_H5)
        self.exposure_present.gdf.rename(columns={"impf_": "impf_TC"}, inplace=True)
        self.exposure_present.gdf["impf_TC"] = 1
        self.exposure_present.gdf[GROUP_ID_COL_NAME] = (
            self.exposure_present.gdf["value"]
            > self.exposure_present.gdf["value"].mean()
        ) * 1
        self.hazard_present = Hazard.from_hdf5(HAZ_DEMO_H5)
        self.exposure_present.assign_centroids(self.hazard_present, distance="approx")
        self.impfset_present = ImpactFuncSet([ImpfTropCyclone.from_emanuel_usa()])
    
        self.exposure_future = Exposures.from_hdf5(EXP_DEMO_H5)
        n_years = self.future_date - self.present_date + 1
        growth_rate = 1.02
        growth = growth_rate**n_years
        self.exposure_future.gdf["value"] = self.exposure_future.gdf["value"] * growth
        self.exposure_future.gdf.rename(columns={"impf_": "impf_TC"}, inplace=True)
        self.exposure_future.gdf["impf_TC"] = 1
        self.exposure_future.gdf[GROUP_ID_COL_NAME] = (
            self.exposure_future.gdf["value"] > self.exposure_future.gdf["value"].mean()
        ) * 1
        self.hazard_future = Hazard.from_hdf5(HAZ_DEMO_H5)
        self.hazard_future.intensity *= 1.1
        self.exposure_future.assign_centroids(self.hazard_future, distance="approx")
        self.impfset_future = ImpactFuncSet(
            [
                ImpfTropCyclone.from_emanuel_usa(impf_id=1, v_half=60.0),
            ]
        )
    
        self.measure = MagicMock(spec=Measure)
        self.measure.name = "Test Measure"
    
        # Setup mock return values for measure.apply
        self.measure_exposure = MagicMock(spec=Exposures)
        self.measure_hazard = MagicMock(spec=Hazard)
        self.measure_impfset = MagicMock(spec=ImpactFuncSet)
        self.measure.apply.return_value = (
            self.measure_exposure,
            self.measure_impfset,
            self.measure_hazard,
        )
    
        # Create mock snapshots
>       self.mock_snapshot_start = Snapshot(
            exposure=self.exposure_present,
            hazard=self.hazard_present,
            impfset=self.impfset_present,
            date=self.present_date,
        )
E       TypeError: Snapshot.__init__() missing 1 required keyword-only argument: 'measure'

climada/trajectories/test/test_calc_risk_metrics.py:108: TypeError

Check warning on line 0 in climada.trajectories.test.test_calc_risk_metrics.TestCalcRiskMetricsPoints

See this annotation in the file changed.

@github-actions github-actions / Core / Unit Test Results (3.12)

test_eai_gdf (climada.trajectories.test.test_calc_risk_metrics.TestCalcRiskMetricsPoints) failed

tests_xml/tests.xml [took 0s]
Raw output
TypeError: Snapshot.__init__() missing 1 required keyword-only argument: 'measure'
self = <test_calc_risk_metrics.TestCalcRiskMetricsPoints testMethod=test_eai_gdf>

    def setUp(self):
        # Create mock objects for testing
        self.present_date = 2020
        self.future_date = 2025
        self.exposure_present = Exposures.from_hdf5(EXP_DEMO_H5)
        self.exposure_present.gdf.rename(columns={"impf_": "impf_TC"}, inplace=True)
        self.exposure_present.gdf["impf_TC"] = 1
        self.exposure_present.gdf[GROUP_ID_COL_NAME] = (
            self.exposure_present.gdf["value"]
            > self.exposure_present.gdf["value"].mean()
        ) * 1
        self.hazard_present = Hazard.from_hdf5(HAZ_DEMO_H5)
        self.exposure_present.assign_centroids(self.hazard_present, distance="approx")
        self.impfset_present = ImpactFuncSet([ImpfTropCyclone.from_emanuel_usa()])
    
        self.exposure_future = Exposures.from_hdf5(EXP_DEMO_H5)
        n_years = self.future_date - self.present_date + 1
        growth_rate = 1.02
        growth = growth_rate**n_years
        self.exposure_future.gdf["value"] = self.exposure_future.gdf["value"] * growth
        self.exposure_future.gdf.rename(columns={"impf_": "impf_TC"}, inplace=True)
        self.exposure_future.gdf["impf_TC"] = 1
        self.exposure_future.gdf[GROUP_ID_COL_NAME] = (
            self.exposure_future.gdf["value"] > self.exposure_future.gdf["value"].mean()
        ) * 1
        self.hazard_future = Hazard.from_hdf5(HAZ_DEMO_H5)
        self.hazard_future.intensity *= 1.1
        self.exposure_future.assign_centroids(self.hazard_future, distance="approx")
        self.impfset_future = ImpactFuncSet(
            [
                ImpfTropCyclone.from_emanuel_usa(impf_id=1, v_half=60.0),
            ]
        )
    
        self.measure = MagicMock(spec=Measure)
        self.measure.name = "Test Measure"
    
        # Setup mock return values for measure.apply
        self.measure_exposure = MagicMock(spec=Exposures)
        self.measure_hazard = MagicMock(spec=Hazard)
        self.measure_impfset = MagicMock(spec=ImpactFuncSet)
        self.measure.apply.return_value = (
            self.measure_exposure,
            self.measure_impfset,
            self.measure_hazard,
        )
    
        # Create mock snapshots
>       self.mock_snapshot_start = Snapshot(
            exposure=self.exposure_present,
            hazard=self.hazard_present,
            impfset=self.impfset_present,
            date=self.present_date,
        )
E       TypeError: Snapshot.__init__() missing 1 required keyword-only argument: 'measure'

climada/trajectories/test/test_calc_risk_metrics.py:108: TypeError

Check warning on line 0 in climada.trajectories.test.test_calc_risk_metrics.TestCalcRiskMetricsPoints

See this annotation in the file changed.

@github-actions github-actions / Core / Unit Test Results (3.12)

test_impacts_arrays (climada.trajectories.test.test_calc_risk_metrics.TestCalcRiskMetricsPoints) failed

tests_xml/tests.xml [took 0s]
Raw output
TypeError: Snapshot.__init__() missing 1 required keyword-only argument: 'measure'
self = <test_calc_risk_metrics.TestCalcRiskMetricsPoints testMethod=test_impacts_arrays>

    def setUp(self):
        # Create mock objects for testing
        self.present_date = 2020
        self.future_date = 2025
        self.exposure_present = Exposures.from_hdf5(EXP_DEMO_H5)
        self.exposure_present.gdf.rename(columns={"impf_": "impf_TC"}, inplace=True)
        self.exposure_present.gdf["impf_TC"] = 1
        self.exposure_present.gdf[GROUP_ID_COL_NAME] = (
            self.exposure_present.gdf["value"]
            > self.exposure_present.gdf["value"].mean()
        ) * 1
        self.hazard_present = Hazard.from_hdf5(HAZ_DEMO_H5)
        self.exposure_present.assign_centroids(self.hazard_present, distance="approx")
        self.impfset_present = ImpactFuncSet([ImpfTropCyclone.from_emanuel_usa()])
    
        self.exposure_future = Exposures.from_hdf5(EXP_DEMO_H5)
        n_years = self.future_date - self.present_date + 1
        growth_rate = 1.02
        growth = growth_rate**n_years
        self.exposure_future.gdf["value"] = self.exposure_future.gdf["value"] * growth
        self.exposure_future.gdf.rename(columns={"impf_": "impf_TC"}, inplace=True)
        self.exposure_future.gdf["impf_TC"] = 1
        self.exposure_future.gdf[GROUP_ID_COL_NAME] = (
            self.exposure_future.gdf["value"] > self.exposure_future.gdf["value"].mean()
        ) * 1
        self.hazard_future = Hazard.from_hdf5(HAZ_DEMO_H5)
        self.hazard_future.intensity *= 1.1
        self.exposure_future.assign_centroids(self.hazard_future, distance="approx")
        self.impfset_future = ImpactFuncSet(
            [
                ImpfTropCyclone.from_emanuel_usa(impf_id=1, v_half=60.0),
            ]
        )
    
        self.measure = MagicMock(spec=Measure)
        self.measure.name = "Test Measure"
    
        # Setup mock return values for measure.apply
        self.measure_exposure = MagicMock(spec=Exposures)
        self.measure_hazard = MagicMock(spec=Hazard)
        self.measure_impfset = MagicMock(spec=ImpactFuncSet)
        self.measure.apply.return_value = (
            self.measure_exposure,
            self.measure_impfset,
            self.measure_hazard,
        )
    
        # Create mock snapshots
>       self.mock_snapshot_start = Snapshot(
            exposure=self.exposure_present,
            hazard=self.hazard_present,
            impfset=self.impfset_present,
            date=self.present_date,
        )
E       TypeError: Snapshot.__init__() missing 1 required keyword-only argument: 'measure'

climada/trajectories/test/test_calc_risk_metrics.py:108: TypeError

Check warning on line 0 in climada.trajectories.test.test_calc_risk_metrics.TestCalcRiskMetricsPoints

See this annotation in the file changed.

@github-actions github-actions / Core / Unit Test Results (3.12)

test_per_date_aai (climada.trajectories.test.test_calc_risk_metrics.TestCalcRiskMetricsPoints) failed

tests_xml/tests.xml [took 0s]
Raw output
TypeError: Snapshot.__init__() missing 1 required keyword-only argument: 'measure'
self = <test_calc_risk_metrics.TestCalcRiskMetricsPoints testMethod=test_per_date_aai>

    def setUp(self):
        # Create mock objects for testing
        self.present_date = 2020
        self.future_date = 2025
        self.exposure_present = Exposures.from_hdf5(EXP_DEMO_H5)
        self.exposure_present.gdf.rename(columns={"impf_": "impf_TC"}, inplace=True)
        self.exposure_present.gdf["impf_TC"] = 1
        self.exposure_present.gdf[GROUP_ID_COL_NAME] = (
            self.exposure_present.gdf["value"]
            > self.exposure_present.gdf["value"].mean()
        ) * 1
        self.hazard_present = Hazard.from_hdf5(HAZ_DEMO_H5)
        self.exposure_present.assign_centroids(self.hazard_present, distance="approx")
        self.impfset_present = ImpactFuncSet([ImpfTropCyclone.from_emanuel_usa()])
    
        self.exposure_future = Exposures.from_hdf5(EXP_DEMO_H5)
        n_years = self.future_date - self.present_date + 1
        growth_rate = 1.02
        growth = growth_rate**n_years
        self.exposure_future.gdf["value"] = self.exposure_future.gdf["value"] * growth
        self.exposure_future.gdf.rename(columns={"impf_": "impf_TC"}, inplace=True)
        self.exposure_future.gdf["impf_TC"] = 1
        self.exposure_future.gdf[GROUP_ID_COL_NAME] = (
            self.exposure_future.gdf["value"] > self.exposure_future.gdf["value"].mean()
        ) * 1
        self.hazard_future = Hazard.from_hdf5(HAZ_DEMO_H5)
        self.hazard_future.intensity *= 1.1
        self.exposure_future.assign_centroids(self.hazard_future, distance="approx")
        self.impfset_future = ImpactFuncSet(
            [
                ImpfTropCyclone.from_emanuel_usa(impf_id=1, v_half=60.0),
            ]
        )
    
        self.measure = MagicMock(spec=Measure)
        self.measure.name = "Test Measure"
    
        # Setup mock return values for measure.apply
        self.measure_exposure = MagicMock(spec=Exposures)
        self.measure_hazard = MagicMock(spec=Hazard)
        self.measure_impfset = MagicMock(spec=ImpactFuncSet)
        self.measure.apply.return_value = (
            self.measure_exposure,
            self.measure_impfset,
            self.measure_hazard,
        )
    
        # Create mock snapshots
>       self.mock_snapshot_start = Snapshot(
            exposure=self.exposure_present,
            hazard=self.hazard_present,
            impfset=self.impfset_present,
            date=self.present_date,
        )
E       TypeError: Snapshot.__init__() missing 1 required keyword-only argument: 'measure'

climada/trajectories/test/test_calc_risk_metrics.py:108: TypeError

Check warning on line 0 in climada.trajectories.test.test_calc_risk_metrics.TestCalcRiskMetricsPoints

See this annotation in the file changed.

@github-actions github-actions / Core / Unit Test Results (3.12)

test_per_date_eai (climada.trajectories.test.test_calc_risk_metrics.TestCalcRiskMetricsPoints) failed

tests_xml/tests.xml [took 0s]
Raw output
TypeError: Snapshot.__init__() missing 1 required keyword-only argument: 'measure'
self = <test_calc_risk_metrics.TestCalcRiskMetricsPoints testMethod=test_per_date_eai>

    def setUp(self):
        # Create mock objects for testing
        self.present_date = 2020
        self.future_date = 2025
        self.exposure_present = Exposures.from_hdf5(EXP_DEMO_H5)
        self.exposure_present.gdf.rename(columns={"impf_": "impf_TC"}, inplace=True)
        self.exposure_present.gdf["impf_TC"] = 1
        self.exposure_present.gdf[GROUP_ID_COL_NAME] = (
            self.exposure_present.gdf["value"]
            > self.exposure_present.gdf["value"].mean()
        ) * 1
        self.hazard_present = Hazard.from_hdf5(HAZ_DEMO_H5)
        self.exposure_present.assign_centroids(self.hazard_present, distance="approx")
        self.impfset_present = ImpactFuncSet([ImpfTropCyclone.from_emanuel_usa()])
    
        self.exposure_future = Exposures.from_hdf5(EXP_DEMO_H5)
        n_years = self.future_date - self.present_date + 1
        growth_rate = 1.02
        growth = growth_rate**n_years
        self.exposure_future.gdf["value"] = self.exposure_future.gdf["value"] * growth
        self.exposure_future.gdf.rename(columns={"impf_": "impf_TC"}, inplace=True)
        self.exposure_future.gdf["impf_TC"] = 1
        self.exposure_future.gdf[GROUP_ID_COL_NAME] = (
            self.exposure_future.gdf["value"] > self.exposure_future.gdf["value"].mean()
        ) * 1
        self.hazard_future = Hazard.from_hdf5(HAZ_DEMO_H5)
        self.hazard_future.intensity *= 1.1
        self.exposure_future.assign_centroids(self.hazard_future, distance="approx")
        self.impfset_future = ImpactFuncSet(
            [
                ImpfTropCyclone.from_emanuel_usa(impf_id=1, v_half=60.0),
            ]
        )
    
        self.measure = MagicMock(spec=Measure)
        self.measure.name = "Test Measure"
    
        # Setup mock return values for measure.apply
        self.measure_exposure = MagicMock(spec=Exposures)
        self.measure_hazard = MagicMock(spec=Hazard)
        self.measure_impfset = MagicMock(spec=ImpactFuncSet)
        self.measure.apply.return_value = (
            self.measure_exposure,
            self.measure_impfset,
            self.measure_hazard,
        )
    
        # Create mock snapshots
>       self.mock_snapshot_start = Snapshot(
            exposure=self.exposure_present,
            hazard=self.hazard_present,
            impfset=self.impfset_present,
            date=self.present_date,
        )
E       TypeError: Snapshot.__init__() missing 1 required keyword-only argument: 'measure'

climada/trajectories/test/test_calc_risk_metrics.py:108: TypeError

Check warning on line 0 in climada.trajectories.test.test_calc_risk_metrics.TestCalcRiskMetricsPoints

See this annotation in the file changed.

@github-actions github-actions / Core / Unit Test Results (3.12)

test_reset_impact_data (climada.trajectories.test.test_calc_risk_metrics.TestCalcRiskMetricsPoints) failed

tests_xml/tests.xml [took 0s]
Raw output
TypeError: Snapshot.__init__() missing 1 required keyword-only argument: 'measure'
self = <test_calc_risk_metrics.TestCalcRiskMetricsPoints testMethod=test_reset_impact_data>

    def setUp(self):
        # Create mock objects for testing
        self.present_date = 2020
        self.future_date = 2025
        self.exposure_present = Exposures.from_hdf5(EXP_DEMO_H5)
        self.exposure_present.gdf.rename(columns={"impf_": "impf_TC"}, inplace=True)
        self.exposure_present.gdf["impf_TC"] = 1
        self.exposure_present.gdf[GROUP_ID_COL_NAME] = (
            self.exposure_present.gdf["value"]
            > self.exposure_present.gdf["value"].mean()
        ) * 1
        self.hazard_present = Hazard.from_hdf5(HAZ_DEMO_H5)
        self.exposure_present.assign_centroids(self.hazard_present, distance="approx")
        self.impfset_present = ImpactFuncSet([ImpfTropCyclone.from_emanuel_usa()])
    
        self.exposure_future = Exposures.from_hdf5(EXP_DEMO_H5)
        n_years = self.future_date - self.present_date + 1
        growth_rate = 1.02
        growth = growth_rate**n_years
        self.exposure_future.gdf["value"] = self.exposure_future.gdf["value"] * growth
        self.exposure_future.gdf.rename(columns={"impf_": "impf_TC"}, inplace=True)
        self.exposure_future.gdf["impf_TC"] = 1
        self.exposure_future.gdf[GROUP_ID_COL_NAME] = (
            self.exposure_future.gdf["value"] > self.exposure_future.gdf["value"].mean()
        ) * 1
        self.hazard_future = Hazard.from_hdf5(HAZ_DEMO_H5)
        self.hazard_future.intensity *= 1.1
        self.exposure_future.assign_centroids(self.hazard_future, distance="approx")
        self.impfset_future = ImpactFuncSet(
            [
                ImpfTropCyclone.from_emanuel_usa(impf_id=1, v_half=60.0),
            ]
        )
    
        self.measure = MagicMock(spec=Measure)
        self.measure.name = "Test Measure"
    
        # Setup mock return values for measure.apply
        self.measure_exposure = MagicMock(spec=Exposures)
        self.measure_hazard = MagicMock(spec=Hazard)
        self.measure_impfset = MagicMock(spec=ImpactFuncSet)
        self.measure.apply.return_value = (
            self.measure_exposure,
            self.measure_impfset,
            self.measure_hazard,
        )
    
        # Create mock snapshots
>       self.mock_snapshot_start = Snapshot(
            exposure=self.exposure_present,
            hazard=self.hazard_present,
            impfset=self.impfset_present,
            date=self.present_date,
        )
E       TypeError: Snapshot.__init__() missing 1 required keyword-only argument: 'measure'

climada/trajectories/test/test_calc_risk_metrics.py:108: TypeError

Check warning on line 0 in climada.trajectories.test.test_calc_risk_metrics.TestCalcRiskMetricsPoints

See this annotation in the file changed.

@github-actions github-actions / Core / Unit Test Results (3.12)

test_set_impact_computation_strategy (climada.trajectories.test.test_calc_risk_metrics.TestCalcRiskMetricsPoints) failed

tests_xml/tests.xml [took 0s]
Raw output
TypeError: Snapshot.__init__() missing 1 required keyword-only argument: 'measure'
self = <test_calc_risk_metrics.TestCalcRiskMetricsPoints testMethod=test_set_impact_computation_strategy>

    def setUp(self):
        # Create mock objects for testing
        self.present_date = 2020
        self.future_date = 2025
        self.exposure_present = Exposures.from_hdf5(EXP_DEMO_H5)
        self.exposure_present.gdf.rename(columns={"impf_": "impf_TC"}, inplace=True)
        self.exposure_present.gdf["impf_TC"] = 1
        self.exposure_present.gdf[GROUP_ID_COL_NAME] = (
            self.exposure_present.gdf["value"]
            > self.exposure_present.gdf["value"].mean()
        ) * 1
        self.hazard_present = Hazard.from_hdf5(HAZ_DEMO_H5)
        self.exposure_present.assign_centroids(self.hazard_present, distance="approx")
        self.impfset_present = ImpactFuncSet([ImpfTropCyclone.from_emanuel_usa()])
    
        self.exposure_future = Exposures.from_hdf5(EXP_DEMO_H5)
        n_years = self.future_date - self.present_date + 1
        growth_rate = 1.02
        growth = growth_rate**n_years
        self.exposure_future.gdf["value"] = self.exposure_future.gdf["value"] * growth
        self.exposure_future.gdf.rename(columns={"impf_": "impf_TC"}, inplace=True)
        self.exposure_future.gdf["impf_TC"] = 1
        self.exposure_future.gdf[GROUP_ID_COL_NAME] = (
            self.exposure_future.gdf["value"] > self.exposure_future.gdf["value"].mean()
        ) * 1
        self.hazard_future = Hazard.from_hdf5(HAZ_DEMO_H5)
        self.hazard_future.intensity *= 1.1
        self.exposure_future.assign_centroids(self.hazard_future, distance="approx")
        self.impfset_future = ImpactFuncSet(
            [
                ImpfTropCyclone.from_emanuel_usa(impf_id=1, v_half=60.0),
            ]
        )
    
        self.measure = MagicMock(spec=Measure)
        self.measure.name = "Test Measure"
    
        # Setup mock return values for measure.apply
        self.measure_exposure = MagicMock(spec=Exposures)
        self.measure_hazard = MagicMock(spec=Hazard)
        self.measure_impfset = MagicMock(spec=ImpactFuncSet)
        self.measure.apply.return_value = (
            self.measure_exposure,
            self.measure_impfset,
            self.measure_hazard,
        )
    
        # Create mock snapshots
>       self.mock_snapshot_start = Snapshot(
            exposure=self.exposure_present,
            hazard=self.hazard_present,
            impfset=self.impfset_present,
            date=self.present_date,
        )
E       TypeError: Snapshot.__init__() missing 1 required keyword-only argument: 'measure'

climada/trajectories/test/test_calc_risk_metrics.py:108: TypeError

Check warning on line 0 in climada.trajectories.test.test_calc_risk_metrics.TestCalcRiskMetricsPoints

See this annotation in the file changed.

@github-actions github-actions / Core / Unit Test Results (3.12)

test_set_impact_computation_strategy_wtype (climada.trajectories.test.test_calc_risk_metrics.TestCalcRiskMetricsPoints) failed

tests_xml/tests.xml [took 0s]
Raw output
TypeError: Snapshot.__init__() missing 1 required keyword-only argument: 'measure'
self = <test_calc_risk_metrics.TestCalcRiskMetricsPoints testMethod=test_set_impact_computation_strategy_wtype>

    def setUp(self):
        # Create mock objects for testing
        self.present_date = 2020
        self.future_date = 2025
        self.exposure_present = Exposures.from_hdf5(EXP_DEMO_H5)
        self.exposure_present.gdf.rename(columns={"impf_": "impf_TC"}, inplace=True)
        self.exposure_present.gdf["impf_TC"] = 1
        self.exposure_present.gdf[GROUP_ID_COL_NAME] = (
            self.exposure_present.gdf["value"]
            > self.exposure_present.gdf["value"].mean()
        ) * 1
        self.hazard_present = Hazard.from_hdf5(HAZ_DEMO_H5)
        self.exposure_present.assign_centroids(self.hazard_present, distance="approx")
        self.impfset_present = ImpactFuncSet([ImpfTropCyclone.from_emanuel_usa()])
    
        self.exposure_future = Exposures.from_hdf5(EXP_DEMO_H5)
        n_years = self.future_date - self.present_date + 1
        growth_rate = 1.02
        growth = growth_rate**n_years
        self.exposure_future.gdf["value"] = self.exposure_future.gdf["value"] * growth
        self.exposure_future.gdf.rename(columns={"impf_": "impf_TC"}, inplace=True)
        self.exposure_future.gdf["impf_TC"] = 1
        self.exposure_future.gdf[GROUP_ID_COL_NAME] = (
            self.exposure_future.gdf["value"] > self.exposure_future.gdf["value"].mean()
        ) * 1
        self.hazard_future = Hazard.from_hdf5(HAZ_DEMO_H5)
        self.hazard_future.intensity *= 1.1
        self.exposure_future.assign_centroids(self.hazard_future, distance="approx")
        self.impfset_future = ImpactFuncSet(
            [
                ImpfTropCyclone.from_emanuel_usa(impf_id=1, v_half=60.0),
            ]
        )
    
        self.measure = MagicMock(spec=Measure)
        self.measure.name = "Test Measure"
    
        # Setup mock return values for measure.apply
        self.measure_exposure = MagicMock(spec=Exposures)
        self.measure_hazard = MagicMock(spec=Hazard)
        self.measure_impfset = MagicMock(spec=ImpactFuncSet)
        self.measure.apply.return_value = (
            self.measure_exposure,
            self.measure_impfset,
            self.measure_hazard,
        )
    
        # Create mock snapshots
>       self.mock_snapshot_start = Snapshot(
            exposure=self.exposure_present,
            hazard=self.hazard_present,
            impfset=self.impfset_present,
            date=self.present_date,
        )
E       TypeError: Snapshot.__init__() missing 1 required keyword-only argument: 'measure'

climada/trajectories/test/test_calc_risk_metrics.py:108: TypeError

Check warning on line 0 in climada.trajectories.test.test_interpolated_risk_trajectory.TestInterpolatedRiskTrajectory

See this annotation in the file changed.

@github-actions github-actions / Core / Unit Test Results (3.12)

test_init_with_custom_params (climada.trajectories.test.test_interpolated_risk_trajectory.TestInterpolatedRiskTrajectory) failed

tests_xml/tests.xml [took 0s]
Raw output
TypeError: InterpolatedRiskTrajectory.__init__() got an unexpected keyword argument 'all_groups_name'
self = <test_interpolated_risk_trajectory.TestInterpolatedRiskTrajectory testMethod=test_init_with_custom_params>
_ = <MagicMock name='_reset_risk_metrics_calculators' id='140563997614368'>

    @patch.object(
        InterpolatedRiskTrajectory, "_reset_risk_metrics_calculators", return_value=1
    )
    def test_init_with_custom_params(self, _):
        # Test initialization with custom parameters
        mock_disc = Mock(spec=DiscRates)
>       rt = InterpolatedRiskTrajectory(
            self.snapshots_list,
            time_resolution="MS",
            all_groups_name="CustomAll",
            risk_disc_rates=mock_disc,
            interpolation_strategy=Mock(),
            impact_computation_strategy=Mock(),
        )
E       TypeError: InterpolatedRiskTrajectory.__init__() got an unexpected keyword argument 'all_groups_name'

climada/trajectories/test/test_interpolated_risk_trajectory.py:230: TypeError

Check warning on line 0 in climada.trajectories.test.test_interpolated_risk_trajectory.TestInterpolatedRiskTrajectory

See this annotation in the file changed.

@github-actions github-actions / Core / Unit Test Results (3.12)

test_plot_per_date_waterfall (climada.trajectories.test.test_interpolated_risk_trajectory.TestInterpolatedRiskTrajectory) failed

tests_xml/tests.xml [took 0s]
Raw output
AssertionError: Lists differ: [2, 3] != [10, 10]

First differing element 0:
2
10

- [2, 3]
+ [10, 10]
self = <test_interpolated_risk_trajectory.TestInterpolatedRiskTrajectory testMethod=test_plot_per_date_waterfall>
mock_calc_data = <MagicMock name='_calc_waterfall_plot_data' id='140563998406896'>
mock_formatter = <MagicMock name='ConciseDateFormatter' id='140563999777392'>
mock_locator = <MagicMock name='AutoDateLocator' id='140563999415600'>
mock_subplots = <MagicMock name='subplots' id='140563999420160'>

    @patch("matplotlib.pyplot.subplots")
    @patch("matplotlib.dates.AutoDateLocator")
    @patch("matplotlib.dates.ConciseDateFormatter")
    @patch.object(InterpolatedRiskTrajectory, "_calc_waterfall_plot_data")
    def test_plot_per_date_waterfall(
        self, mock_calc_data, mock_formatter, mock_locator, mock_subplots
    ):
        rt = InterpolatedRiskTrajectory(self.snapshots_list)
        rt.start_date = datetime.date(2023, 1, 1)
        rt.end_date = datetime.date(2023, 1, 2)
    
        # Mock matplotlib objects
        mock_ax = Mock()
        mock_fig = Mock()
        mock_subplots.return_value = (mock_fig, mock_ax)
        mock_ax.get_ylim.return_value = (0, 100)  # For ylim scaling
    
        # Mock data returned by _calc_waterfall_plot_data
        mock_df_data = pd.DataFrame(
            {
                CONTRIBUTION_BASE_RISK_NAME: [10, 10],
                CONTRIBUTION_EXPOSURE_NAME: [2, 3],
                CONTRIBUTION_HAZARD_NAME: [5, 6],
                CONTRIBUTION_VULNERABILITY_NAME: [1, 2],
                CONTRIBUTION_INTERACTION_TERM_NAME: [0.5, 0.7],
            },
            index=pd.period_range(start="2023-01-01", end="2023-01-02", freq="D"),
        )
        mock_calc_data.return_value = mock_df_data
    
        # Call the method
        fig, ax = rt.plot_time_waterfall()
    
        # Assertions
        mock_calc_data.assert_called_once_with(
            start_date=datetime.date(2023, 1, 1),
            end_date=datetime.date(2023, 1, 2),
        )
        mock_ax.stackplot.assert_called_once()
        self.assertEqual(
            mock_ax.stackplot.call_args[0][0].tolist(),
            mock_df_data.index.to_timestamp().tolist(),  # type: ignore
        )  # Check x-axis data
>       self.assertEqual(
            mock_ax.stackplot.call_args[0][1][0].tolist(),
            mock_df_data[CONTRIBUTION_BASE_RISK_NAME].tolist(),
        )  # Check first stacked data
E       AssertionError: Lists differ: [2, 3] != [10, 10]
E       
E       First differing element 0:
E       2
E       10
E       
E       - [2, 3]
E       + [10, 10]

climada/trajectories/test/test_interpolated_risk_trajectory.py:1214: AssertionError

Check warning on line 0 in climada.trajectories.test.test_static_risk_trajectory.TestStaticRiskTrajectory

See this annotation in the file changed.

@github-actions github-actions / Core / Unit Test Results (3.12)

test_init_args (climada.trajectories.test.test_static_risk_trajectory.TestStaticRiskTrajectory) failed

tests_xml/tests.xml [took 0s]
Raw output
TypeError: RiskTrajectory.__init__() got an unexpected keyword argument 'all_groups_name'
self = <test_static_risk_trajectory.TestStaticRiskTrajectory testMethod=test_init_args>
mock_calc_risk_metrics_points = <MagicMock name='CalcRiskMetricsPoints' spec='CalcRiskMetricsPoints' id='140564001932976'>

    @patch(
        "climada.trajectories.static_trajectory.CalcRiskMetricsPoints",
        autospec=True,
    )
    def test_init_args(self, mock_calc_risk_metrics_points):
>       rt = StaticRiskTrajectory(
            self.snapshots_list,
            return_periods=self.custom_return_periods,
            all_groups_name=self.custom_all_groups_name,
            risk_disc_rates=self.risk_disc_rates,
            impact_computation_strategy=self.mock_impact_computation_strategy,
        )

climada/trajectories/test/test_static_risk_trajectory.py:205: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <climada.trajectories.static_trajectory.StaticRiskTrajectory object at 0x7fd79b677920>
snapshots_list = [<MagicMock spec='Snapshot' id='140564001937968'>, <MagicMock spec='Snapshot' id='140563998918656'>, <MagicMock spec='Snapshot' id='140564001937488'>]

    def __init__(
        self,
        snapshots_list: Iterable[Snapshot],
        *,
        return_periods: Iterable[int] = DEFAULT_RP,
        all_groups_name: str = DEFAULT_ALLGROUP_NAME,
        risk_disc_rates: DiscRates | None = None,
        impact_computation_strategy: ImpactComputationStrategy | None = None,
    ):
        """Initialize a new `StaticRiskTrajectory`.
    
        Parameters
        ----------
        snapshots_list : list[Snapshot]
            The list of `Snapshot` object to compute risk from.
        return_periods: list[int], optional
            The return periods to use when computing the `return_periods_metric`.
            Defaults to `DEFAULT_RP` ([20, 50, 100]).
        all_groups_name: str, optional
            The string that should be used to define "all exposure points" subgroup.
            Defaults to `DEFAULT_ALLGROUP_NAME` ("All").
        risk_disc_rates: DiscRates, optional
            The discount rate to apply to future risk. Defaults to None.
        impact_computation_strategy: ImpactComputationStrategy, optional
            The method used to calculate the impact from the (Haz,Exp,Vul)
            of the two snapshots. Defaults to :class:`ImpactCalcComputation`.
    
        """
>       super().__init__(
            snapshots_list,
            return_periods=return_periods,
            all_groups_name=all_groups_name,
            risk_disc_rates=risk_disc_rates,
        )
E       TypeError: RiskTrajectory.__init__() got an unexpected keyword argument 'all_groups_name'

climada/trajectories/static_trajectory.py:125: TypeError

Check warning on line 0 in climada.trajectories.test.test_static_risk_trajectory.TestStaticRiskTrajectory

See this annotation in the file changed.

@github-actions github-actions / Core / Unit Test Results (3.12)

test_init_basic (climada.trajectories.test.test_static_risk_trajectory.TestStaticRiskTrajectory) failed

tests_xml/tests.xml [took 0s]
Raw output
TypeError: RiskTrajectory.__init__() got an unexpected keyword argument 'all_groups_name'
self = <test_static_risk_trajectory.TestStaticRiskTrajectory testMethod=test_init_basic>
MockCalcRiskPoints = <MagicMock name='CalcRiskMetricsPoints' spec='CalcRiskMetricsPoints' id='140564003781328'>

    @patch(
        "climada.trajectories.static_trajectory.CalcRiskMetricsPoints",
        autospec=True,
    )
    def test_init_basic(self, MockCalcRiskPoints):
        mock_calculator = MagicMock(spec=CalcRiskMetricsPoints)
        mock_calculator.impact_computation_strategy = (
            self.mock_impact_computation_strategy
        )
        MockCalcRiskPoints.return_value = mock_calculator
>       rt = StaticRiskTrajectory(
            self.snapshots_list,
            impact_computation_strategy=self.mock_impact_computation_strategy,
        )

climada/trajectories/test/test_static_risk_trajectory.py:176: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <climada.trajectories.static_trajectory.StaticRiskTrajectory object at 0x7fd79b713aa0>
snapshots_list = [<MagicMock spec='Snapshot' id='140564003780416'>, <MagicMock spec='Snapshot' id='140564003773888'>, <MagicMock spec='Snapshot' id='140564003767504'>]

    def __init__(
        self,
        snapshots_list: Iterable[Snapshot],
        *,
        return_periods: Iterable[int] = DEFAULT_RP,
        all_groups_name: str = DEFAULT_ALLGROUP_NAME,
        risk_disc_rates: DiscRates | None = None,
        impact_computation_strategy: ImpactComputationStrategy | None = None,
    ):
        """Initialize a new `StaticRiskTrajectory`.
    
        Parameters
        ----------
        snapshots_list : list[Snapshot]
            The list of `Snapshot` object to compute risk from.
        return_periods: list[int], optional
            The return periods to use when computing the `return_periods_metric`.
            Defaults to `DEFAULT_RP` ([20, 50, 100]).
        all_groups_name: str, optional
            The string that should be used to define "all exposure points" subgroup.
            Defaults to `DEFAULT_ALLGROUP_NAME` ("All").
        risk_disc_rates: DiscRates, optional
            The discount rate to apply to future risk. Defaults to None.
        impact_computation_strategy: ImpactComputationStrategy, optional
            The method used to calculate the impact from the (Haz,Exp,Vul)
            of the two snapshots. Defaults to :class:`ImpactCalcComputation`.
    
        """
>       super().__init__(
            snapshots_list,
            return_periods=return_periods,
            all_groups_name=all_groups_name,
            risk_disc_rates=risk_disc_rates,
        )
E       TypeError: RiskTrajectory.__init__() got an unexpected keyword argument 'all_groups_name'

climada/trajectories/static_trajectory.py:125: TypeError

Check warning on line 0 in climada.trajectories.test.test_static_risk_trajectory.TestStaticRiskTrajectory

See this annotation in the file changed.

@github-actions github-actions / Core / Unit Test Results (3.12)

test_set_impact_computation_strategy (climada.trajectories.test.test_static_risk_trajectory.TestStaticRiskTrajectory) failed

tests_xml/tests.xml [took 0s]
Raw output
TypeError: RiskTrajectory.__init__() got an unexpected keyword argument 'all_groups_name'
self = <test_static_risk_trajectory.TestStaticRiskTrajectory testMethod=test_set_impact_computation_strategy>
mock_calc_risk_metrics_points = <MagicMock name='CalcRiskMetricsPoints' spec='CalcRiskMetricsPoints' id='140564005418624'>
mock_reset_metrics = <Mock name='_reset_metrics' id='140564001806272'>

    @patch.object(StaticRiskTrajectory, "_reset_metrics", new_callable=Mock)
    @patch(
        "climada.trajectories.static_trajectory.CalcRiskMetricsPoints",
        autospec=True,
    )
    def test_set_impact_computation_strategy(
        self, mock_calc_risk_metrics_points, mock_reset_metrics
    ):
>       rt = StaticRiskTrajectory(
            self.snapshots_list,
            impact_computation_strategy=self.mock_impact_computation_strategy,
        )

climada/trajectories/test/test_static_risk_trajectory.py:235: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <climada.trajectories.static_trajectory.StaticRiskTrajectory object at 0x7fd79b9c57f0>
snapshots_list = [<MagicMock spec='Snapshot' id='140564004295920'>, <MagicMock spec='Snapshot' id='140564004298704'>, <MagicMock spec='Snapshot' id='140564004299232'>]

    def __init__(
        self,
        snapshots_list: Iterable[Snapshot],
        *,
        return_periods: Iterable[int] = DEFAULT_RP,
        all_groups_name: str = DEFAULT_ALLGROUP_NAME,
        risk_disc_rates: DiscRates | None = None,
        impact_computation_strategy: ImpactComputationStrategy | None = None,
    ):
        """Initialize a new `StaticRiskTrajectory`.
    
        Parameters
        ----------
        snapshots_list : list[Snapshot]
            The list of `Snapshot` object to compute risk from.
        return_periods: list[int], optional
            The return periods to use when computing the `return_periods_metric`.
            Defaults to `DEFAULT_RP` ([20, 50, 100]).
        all_groups_name: str, optional
            The string that should be used to define "all exposure points" subgroup.
            Defaults to `DEFAULT_ALLGROUP_NAME` ("All").
        risk_disc_rates: DiscRates, optional
            The discount rate to apply to future risk. Defaults to None.
        impact_computation_strategy: ImpactComputationStrategy, optional
            The method used to calculate the impact from the (Haz,Exp,Vul)
            of the two snapshots. Defaults to :class:`ImpactCalcComputation`.
    
        """
>       super().__init__(
            snapshots_list,
            return_periods=return_periods,
            all_groups_name=all_groups_name,
            risk_disc_rates=risk_disc_rates,
        )
E       TypeError: RiskTrajectory.__init__() got an unexpected keyword argument 'all_groups_name'

climada/trajectories/static_trajectory.py:125: TypeError

Check warning on line 0 in climada.trajectories.test.test_trajectory.TestRiskTrajectory

See this annotation in the file changed.

@github-actions github-actions / Core / Unit Test Results (3.12)

test_compute_metrics (climada.trajectories.test.test_trajectory.TestRiskTrajectory) failed

tests_xml/tests.xml [took 0s]
Raw output
TypeError: Can't instantiate abstract class RiskTrajectory without an implementation for abstract method '_generic_metrics'
self = <test_trajectory.TestRiskTrajectory testMethod=test_compute_metrics>
mock_generic_metrics = <Mock name='_generic_metrics' id='140564004452592'>

    @patch.object(RiskTrajectory, "_generic_metrics", new_callable=Mock)
    def test_compute_metrics(self, mock_generic_metrics):
        mock_generic_metrics.return_value = "42"
>       rt = RiskTrajectory(self.snapshots_list)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E       TypeError: Can't instantiate abstract class RiskTrajectory without an implementation for abstract method '_generic_metrics'

climada/trajectories/test/test_trajectory.py:94: TypeError

Check warning on line 0 in climada.trajectories.test.test_trajectory.TestRiskTrajectory

See this annotation in the file changed.

@github-actions github-actions / Core / Unit Test Results (3.12)

test_init_args (climada.trajectories.test.test_trajectory.TestRiskTrajectory) failed

tests_xml/tests.xml [took 0s]
Raw output
TypeError: Can't instantiate abstract class RiskTrajectory without an implementation for abstract method '_generic_metrics'
self = <test_trajectory.TestRiskTrajectory testMethod=test_init_args>

    def test_init_args(self):
>       rt = RiskTrajectory(
            self.snapshots_list,
            return_periods=self.custom_return_periods,
            all_groups_name=self.custom_all_groups_name,
            risk_disc_rates=self.risk_disc_rates,
        )
E       TypeError: Can't instantiate abstract class RiskTrajectory without an implementation for abstract method '_generic_metrics'

climada/trajectories/test/test_trajectory.py:75: TypeError

Check warning on line 0 in climada.trajectories.test.test_trajectory.TestRiskTrajectory

See this annotation in the file changed.

@github-actions github-actions / Core / Unit Test Results (3.12)

test_init_basic (climada.trajectories.test.test_trajectory.TestRiskTrajectory) failed

tests_xml/tests.xml [took 0s]
Raw output
TypeError: Can't instantiate abstract class RiskTrajectory without an implementation for abstract method '_generic_metrics'
self = <test_trajectory.TestRiskTrajectory testMethod=test_init_basic>

    def test_init_basic(self):
>       rt = RiskTrajectory(self.snapshots_list)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E       TypeError: Can't instantiate abstract class RiskTrajectory without an implementation for abstract method '_generic_metrics'

climada/trajectories/test/test_trajectory.py:64: TypeError

Check warning on line 0 in climada.trajectories.test.test_trajectory.TestRiskTrajectory

See this annotation in the file changed.

@github-actions github-actions / Core / Unit Test Results (3.12)

test_set_disc_rates (climada.trajectories.test.test_trajectory.TestRiskTrajectory) failed

tests_xml/tests.xml [took 0s]
Raw output
TypeError: Can't instantiate abstract class RiskTrajectory without an implementation for abstract method '_generic_metrics'
self = <test_trajectory.TestRiskTrajectory testMethod=test_set_disc_rates>
mock_reset_metrics = <Mock name='_reset_metrics' id='140564001935328'>

    @patch.object(RiskTrajectory, "_reset_metrics", new_callable=Mock)
    def test_set_disc_rates(self, mock_reset_metrics):
>       rt = RiskTrajectory(self.snapshots_list)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E       TypeError: Can't instantiate abstract class RiskTrajectory without an implementation for abstract method '_generic_metrics'

climada/trajectories/test/test_trajectory.py:122: TypeError

Check warning on line 0 in climada.trajectories.test.test_trajectory.TestRiskTrajectory

See this annotation in the file changed.

@github-actions github-actions / Core / Unit Test Results (3.12)

test_set_return_periods (climada.trajectories.test.test_trajectory.TestRiskTrajectory) failed

tests_xml/tests.xml [took 0s]
Raw output
TypeError: Can't instantiate abstract class RiskTrajectory without an implementation for abstract method '_generic_metrics'
self = <test_trajectory.TestRiskTrajectory testMethod=test_set_return_periods>

    def test_set_return_periods(self):
>       rt = RiskTrajectory(self.snapshots_list)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E       TypeError: Can't instantiate abstract class RiskTrajectory without an implementation for abstract method '_generic_metrics'

climada/trajectories/test/test_trajectory.py:110: TypeError