Skip to content

update tutorial

update tutorial #880

GitHub Actions / Core / Unit Test Results (3.11) failed Aug 6, 2024 in 0s

1 fail, 687 pass in 9m 18s

688 tests  ±0   687 ✅ ±0   9m 18s ⏱️ +39s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     1 ❌ ±0 

Results for commit 4c35fca. ± Comparison against earlier commit 7e572bf.

Annotations

Check warning on line 0 in climada.hazard.test.test_trop_cyclone.TestClimateSce

See this annotation in the file changed.

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

test_apply_criterion_track2 (climada.hazard.test.test_trop_cyclone.TestClimateSce) failed

tests_xml/tests.xml [took 0s]
Raw output
NameError: name 'get_knutson_scaling_factor' is not defined
self = <climada.hazard.test.test_trop_cyclone.TestClimateSce testMethod=test_apply_criterion_track2>

    def test_apply_criterion_track2(self):
        """Test _apply_criterion function."""
        # artificially increase the size of
        # the hazard by repeating (tiling) the
        # data:
        ntiles = 8
    
        intensity = np.zeros((4, 10))
        intensity[0, :] = np.arange(10)
        intensity[1, 5] = 10
        intensity[2, :] = np.arange(10, 20)
        intensity[3, 3] = 3
        intensity = np.tile(intensity, (ntiles, 1))
    
        tc = TropCyclone(
            intensity=sparse.csr_matrix(intensity),
            basin=ntiles * ['NA', 'NA', 'NA', 'WP'],
            frequency=np.repeat(1/(4*ntiles), 4*ntiles),
            category=np.array(ntiles * [2, 0, 4, 1]),
            event_id=np.arange(intensity.shape[0]),
            date=np.array([723795, 728395, 738395, 724395])
        )
    
>       NA_scaling_05, NA_scaling_45 = [
            get_knutson_scaling_factor(percentile='50',
                                       variable=variable,
                                       basin='NA').loc[2035, '8.5']
            for variable in ['cat05', 'cat45']
            ]

climada/hazard/test/test_trop_cyclone.py:350: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

.0 = <tuple_iterator object at 0x7fd5ad143550>

    NA_scaling_05, NA_scaling_45 = [
>       get_knutson_scaling_factor(percentile='50',
                                   variable=variable,
                                   basin='NA').loc[2035, '8.5']
        for variable in ['cat05', 'cat45']
        ]
E   NameError: name 'get_knutson_scaling_factor' is not defined

climada/hazard/test/test_trop_cyclone.py:351: NameError