Skip to content

added check_existing_files method to handler class

Jenkins - WCR / Jenkins / Unit Tests failed Dec 13, 2024 in 3m 39s

Declarative: Post Actions: warning in 'junit' step

ci / unit_test / unit_test / Shell Script

Error in sh step, with arguments bash script/jenkins/branches/make_in_venv.sh undefined unit_test.

script returned exit code 2
Build log
+ bash script/jenkins/branches/make_in_venv.sh undefined unit_test
python -m pytest --junitxml=tests_xml/tests.xml --cov --cov-config=.coveragerc --cov-report html:coverage --cov-report xml:coverage.xml --cov-report term:skip-covered --ignore=climada_petals/test climada_petals/
============================= test session starts ==============================
platform linux -- Python 3.9.18, pytest-8.2.2, pluggy-1.5.0
rootdir: /var/lib/jenkins/jobs/petals_branches/branches/PR-142/workspace
plugins: subtests-0.13.0, cov-5.0.0, Faker-26.0.0
collected 228 items

climada_petals/engine/test/test_supplychain.py ...............           [  6%]
climada_petals/engine/test/test_warn.py .......................          [ 16%]
climada_petals/entity/exposures/test/test_black_marble.py .............. [ 22%]
.                                                                        [ 23%]
climada_petals/entity/exposures/test/test_crop_production.py .......     [ 26%]
climada_petals/entity/exposures/test/test_gdp_asset.py ....              [ 28%]
climada_petals/entity/exposures/test/test_osm_dataloader.py ...........  [ 32%]
climada_petals/entity/exposures/test/test_spamagrar_unit.py .....        [ 35%]
climada_petals/entity/impact_funcs/test/test_fl.py .......               [ 38%]
climada_petals/entity/impact_funcs/test/test_wf.py ..                    [ 39%]
climada_petals/hazard/copernicus_interface/test_heat_index.py .......... [ 43%]
..                                                                       [ 44%]
climada_petals/hazard/emulator/test/test_emulator.py ..                  [ 45%]
climada_petals/hazard/emulator/test/test_geo.py ....                     [ 46%]
climada_petals/hazard/emulator/test/test_random.py ..                    [ 47%]
climada_petals/hazard/emulator/test/test_stats.py .....                  [ 50%]
climada_petals/hazard/rf_glofas/test/test_cds_glofas_downloader.py ..... [ 52%]
.....                                                                    [ 54%]
climada_petals/hazard/rf_glofas/test/test_rf_glofas.py ....              [ 56%]
climada_petals/hazard/rf_glofas/test/test_river_flood_computation.py ... [ 57%]
...........                                                              [ 62%]
climada_petals/hazard/rf_glofas/test/test_transform_ops.py ............. [ 67%]
                                                                         [ 67%]
climada_petals/hazard/tc_surge_geoclaw/test/test_geoclaw_runner.py ....  [ 69%]
climada_petals/hazard/tc_surge_geoclaw/test/test_plot.py ....            [ 71%]
climada_petals/hazard/tc_surge_geoclaw/test/test_sea_level_funs.py .     [ 71%]
climada_petals/hazard/tc_surge_geoclaw/test/test_tc_surge_events.py ...  [ 73%]
climada_petals/hazard/tc_surge_geoclaw/test/test_tc_surge_geoclaw.py .   [ 73%]
climada_petals/hazard/test/test_drought.py .                             [ 74%]
climada_petals/hazard/test/test_flood.py ........                        [ 77%]
climada_petals/hazard/test/test_landslide.py ......                      [ 80%]
climada_petals/hazard/test/test_low_flow.py ..........                   [ 84%]
climada_petals/hazard/test/test_relative_cropyield.py ...                [ 85%]
climada_petals/hazard/test/test_tc_rainfield.py ...F......               [ 90%]
climada_petals/hazard/test/test_tc_surge_bathtub.py ...                  [ 91%]
climada_petals/hazard/test/test_tc_tracks_forecast.py .......            [ 94%]
climada_petals/hazard/test/test_wildfire.py ...........                  [ 99%]
climada_petals/util/test/test_config.py .                                [100%]

=================================== FAILURES ===================================
_____________________________ TestReader.test_tcr ______________________________

self = <climada_petals.hazard.test.test_tc_rainfield.TestReader testMethod=test_tcr>

    def test_tcr(self):
        """Test from_tracks constructor with model TCR."""
        tc_track = TCTracks.from_processed_ibtracs_csv(TEST_TRACK)
        tc_track.equal_timestep()
    
>       tc_haz = TCRain.from_tracks(tc_track, model="TCR", centroids=CENTR_TEST_BRB)

climada_petals/hazard/test/test_tc_rainfield.py:97: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
climada_petals/hazard/tc_rainfield.py:457: in from_tracks
    cls._from_track(track, centroids, idx_centr_filter,
climada_petals/hazard/tc_rainfield.py:524: in _from_track
    intensity_sparse, rainrates_sparse = _compute_rain_sparse(
climada_petals/hazard/tc_rainfield.py:678: in _compute_rain_sparse
    rainrates, idx_centr_reachable = compute_rain(
climada_petals/hazard/tc_rainfield.py:840: in compute_rain
    rainrates = _tcr(
climada_petals/hazard/tc_rainfield.py:1112: in _tcr
    w = _compute_vertical_velocity(si_track, centroids, d_centr, mask_centr_close, **kwargs)
climada_petals/hazard/tc_rainfield.py:1185: in _compute_vertical_velocity
    h_winds = _horizontal_winds(
climada_petals/hazard/tc_rainfield.py:1254: in _horizontal_winds
    "nocoriolis": _windprofile(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

si_track = <xarray.Dataset> Size: 25kB
Dimensions:      (time: 223, component: 2)
Coordinates:
    lat          (time) float64 2k... 1951239012334.0
    category:                 1
    mid_lon:                  -52.55
    latsign:                  1.0
d_centr = array([[3695207.91650535, 3695449.24147036, 3695713.75265507, ...,
        3533911.09719767, 3536021.45430381, 3538736...4488.39822548, 2143368.52279856, 2142288.08849876, ...,
        2299126.86581836, 2295207.47409199, 2292216.77271757]])
mask_centr_close = array([[False, False, False, ..., False, False, False],
       [False, False, False, ..., False, False, False],
      ...alse],
       [False, False, False, ..., False, False, False],
       [False, False, False, ..., False, False, False]])
model = 3, cyclostrophic = True, matlab_ref_mode = False

    def _windprofile(
        si_track: xr.Dataset,
        d_centr: dict,
        mask_centr_close: np.ndarray,
        model: int,
        cyclostrophic: bool = False,
        matlab_ref_mode: bool = False,
    ) -> np.ndarray:
        """Compute (absolute) angular wind speeds according to a parametric wind profile
    
        Wrapper around ``compute_angular_windspeeds`` (from climada.trop_cyclone) that adjusts the
        Coriolis parameter if matlab_ref_mode is True.
    
        Parameters
        ----------
        si_track : xr.Dataset
            Output of ``tctrack_to_si``. Which data variables are used depends on the wind model.
        d_centr : ndarray of shape (npositions, ncentroids)
            Distances from storm centers to centroids.
        mask_centr_close : np.ndarray of shape (npositions, ncentroids)
            For each track position one row indicating which centroids are within reach.
        model : int
            Wind profile model selection according to MODEL_VANG.
        cyclostrophic : bool, optional
            If True, don't apply the influence of the Coriolis force (set the Coriolis terms to 0).
            Default: False
        matlab_ref_mode : bool, optional
            Do not apply the changes to the reference MATLAB implementation. Default: False
    
        Returns
        -------
        ndarray of shape (npositions, ncentroids)
        """
        if matlab_ref_mode:
            # In the MATLAB implementation, the Coriolis parameter is chosen to be 5e-5 (independent of
            # latitude), following formula (2) and the remark in Section 3 of Emanuel & Rotunno (2011).
            si_track = si_track.copy(deep=True)
            si_track["cp"].values[:] = 5e-5
>       return compute_angular_windspeeds(
            si_track, d_centr, mask_centr_close, model, model_kwarg=dict(cyclostrophic=cyclostrophic),
        )
E       TypeError: compute_angular_windspeeds() got an unexpected keyword argument 'model_kwarg'

climada_petals/hazard/tc_rainfield.py:1323: TypeError
----------------------------- Captured stdout call -----------------------------
2024-12-13 11:29:49,276 - climada.hazard.tc_tracks - INFO - Reading /var/lib/jenkins/climada/data/centroids/tc_rainfield_test/v4.0.2/trac_brb_test.csv
2024-12-13 11:29:49,283 - climada.hazard.tc_tracks - INFO - Interpolating 1 tracks to 1h time steps.
2024-12-13 11:29:49,313 - climada.util.coordinates - INFO - Sampling from /var/lib/jenkins/climada/data/GMT_intermediate_coast_distance_01d.tif
2024-12-13 11:29:49,324 - climada_petals.hazard.tc_rainfield - INFO - Mapping 1 tracks to 296 coastal centroids.
=============================== warnings summary ===============================
../../../../climada_install_env/workspace/climada/util/__init__.py:27
  /var/lib/jenkins/jobs/climada_install_env/workspace/climada/util/__init__.py:27: FionaDeprecationWarning: This function will be removed in version 2.0. Please use CRS.from_epsg() instead.
    from .constants import *

../../../../../miniforge3/envs/petals_env/lib/python3.9/site-packages/dask/dataframe/_pyarrow_compat.py:15
  /var/lib/jenkins/miniforge3/envs/petals_env/lib/python3.9/site-packages/dask/dataframe/_pyarrow_compat.py:15: FutureWarning: Minimal version of pyarrow will soon be increased to 14.0.1. You are using 12.0.1. Please consider upgrading.
    warnings.warn(

../../../../../miniforge3/envs/petals_env/lib/python3.9/site-packages/pandas_datareader/compat/__init__.py:11
  /var/lib/jenkins/miniforge3/envs/petals_env/lib/python3.9/site-packages/pandas_datareader/compat/__init__.py:11: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    PANDAS_VERSION = LooseVersion(pd.__version__)

../../../../../miniforge3/envs/petals_env/lib/python3.9/site-packages/pandas_datareader/compat/__init__.py:13
  /var/lib/jenkins/miniforge3/envs/petals_env/lib/python3.9/site-packages/pandas_datareader/compat/__init__.py:13: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    PANDAS_0210 = PANDAS_VERSION >= LooseVersion("0.21.0")

../../../../../miniforge3/envs/petals_env/lib/python3.9/site-packages/pandas_datareader/compat/__init__.py:14
  /var/lib/jenkins/miniforge3/envs/petals_env/lib/python3.9/site-packages/pandas_datareader/compat/__init__.py:14: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    PANDAS_0220 = PANDAS_VERSION >= LooseVersion("0.22.0")

../../../../../miniforge3/envs/petals_env/lib/python3.9/site-packages/pandas_datareader/compat/__init__.py:15
  /var/lib/jenkins/miniforge3/envs/petals_env/lib/python3.9/site-packages/pandas_datareader/compat/__init__.py:15: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    PANDAS_0230 = PANDAS_VERSION >= LooseVersion("0.23.0")

../../../../climada_install_env/workspace/climada/hazard/centroids/centr.py:995
climada_petals/engine/test/test_warn.py::TestWarn::test_from_hazard
  /var/lib/jenkins/jobs/climada_install_env/workspace/climada/hazard/centroids/centr.py:995: DeprecationWarning: `product` is deprecated as of NumPy 1.25.0, and will be removed in NumPy 2.0. Please use `prod` instead.
    latitude = np.array(data.get("lat"))

../../../../climada_install_env/workspace/climada/hazard/centroids/centr.py:996
climada_petals/engine/test/test_warn.py::TestWarn::test_from_hazard
  /var/lib/jenkins/jobs/climada_install_env/workspace/climada/hazard/centroids/centr.py:996: DeprecationWarning: `product` is deprecated as of NumPy 1.25.0, and will be removed in NumPy 2.0. Please use `prod` instead.
    longitude = np.array(data.get("lon"))

../../../../climada_install_env/workspace/climada/hazard/centroids/centr.py:1014: 5 warnings
climada_petals/engine/test/test_warn.py: 5 warnings
climada_petals/hazard/emulator/test/test_geo.py: 5 warnings
  /var/lib/jenkins/jobs/climada_install_env/workspace/climada/hazard/centroids/centr.py:1014: DeprecationWarning: `product` is deprecated as of NumPy 1.25.0, and will be removed in NumPy 2.0. Please use `prod` instead.
    values = np.array(data.get(centr_name))

climada_petals/hazard/test/test_wildfire.py:55
  /var/lib/jenkins/jobs/petals_branches/branches/PR-142/workspace/climada_petals/hazard/test/test_wildfire.py:55: DeprecatedWarning: from_lat_lon is deprecated. This method will be removed in a future version. Simply use the constructor instead.
    centroids = Centroids.from_lat_lon(coord[:, 0], coord[:, 1])

climada_petals/hazard/test/test_wildfire.py:56
  /var/lib/jenkins/jobs/petals_branches/branches/PR-142/workspace/climada_petals/hazard/test/test_wildfire.py:56: DeprecatedWarning: set_area_approx is deprecated. This method is futile and will be removed in a future version. `Centroids.get_area_pixel` can be run without initialization.
    centroids.set_area_approx()

climada_petals/hazard/test/test_wildfire.py:58
  /var/lib/jenkins/jobs/petals_branches/branches/PR-142/workspace/climada_petals/hazard/test/test_wildfire.py:58: DeprecatedWarning: empty_geometry_points is deprecated. This method has no effect and will be removed in a future version. In the current version of climada the geometry points of a `Centroids` object cannot be removed as they are the backbone of the Centroids' GeoDataFrame.
    centroids.empty_geometry_points()

climada_petals/engine/test/test_supplychain.py: 16 warnings
  /var/lib/jenkins/jobs/petals_branches/branches/PR-142/workspace/climada_petals/engine/supplychain.py:878: UserWarning: No known unit was provided. It is assumed that values do not need to be converted.
    warnings.warn(

climada_petals/engine/test/test_supplychain.py: 21 warnings
  /var/lib/jenkins/miniforge3/envs/petals_env/lib/python3.9/site-packages/numpy/matrixlib/defmatrix.py:70: PendingDeprecationWarning: the matrix subclass is not the recommended way to represent matrices or deal with linear algebra (see https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html). Please adjust your code to use regular ndarray.
    return matrix(data, dtype=dtype, copy=False)

climada_petals/engine/test/test_supplychain.py::TestSupplyChain::test_calc_shock_to_sectors
climada_petals/engine/test/test_supplychain.py::TestSupplyChain::test_calc_shock_to_sectors
climada_petals/engine/test/test_supplychain.py::TestSupplyChain_boario::test_calc_impacts_boario_rebuilding_missing
climada_petals/engine/test/test_supplychain.py::TestSupplyChain_boario::test_calc_impacts_boario_rebuilding_no_param
climada_petals/engine/test/test_supplychain.py::TestSupplyChain_boario::test_calc_impacts_boario_rebuilding_sep
climada_petals/engine/test/test_supplychain.py::TestSupplyChain_boario::test_calc_impacts_boario_recovery_no_param
climada_petals/engine/test/test_supplychain.py::TestSupplyChain_boario::test_calc_impacts_boario_unknown
  /var/lib/jenkins/jobs/petals_branches/branches/PR-142/workspace/climada_petals/engine/supplychain.py:550: UserWarning: No impacted sectors were specified. It is assumed that the exposure is representative of all sectors in the IO table
    warnings.warn(

climada_petals/engine/test/test_supplychain.py::TestSupplyChain::test_map_exp_to_mriot
  /var/lib/jenkins/jobs/petals_branches/branches/PR-142/workspace/climada_petals/engine/supplychain.py:897: UserWarning: For a correct calculation the format of regions' names in exposure and the IO table must match.
    warnings.warn(

climada_petals/engine/test/test_supplychain.py::TestSupplyChain_boario::test_calc_impacts_boario_rebuilding_missing
climada_petals/engine/test/test_supplychain.py::TestSupplyChain_boario::test_calc_impacts_boario_rebuilding_missing
climada_petals/engine/test/test_supplychain.py::TestSupplyChain_boario::test_calc_impacts_boario_rebuilding_no_param
climada_petals/engine/test/test_supplychain.py::TestSupplyChain_boario::test_calc_impacts_boario_rebuilding_sep
  /var/lib/jenkins/jobs/petals_branches/branches/PR-142/workspace/climada_petals/engine/supplychain.py:763: UserWarning: BoARIO 'model' parameters were not specified and default values are used. This is not recommended and likely undesired.
    warnings.warn(f"""BoARIO '{boario_param_type}' parameters were not specified and default values are used. This is not recommended and likely undesired."""

climada_petals/engine/test/test_supplychain.py::TestSupplyChain_boario::test_calc_impacts_boario_rebuilding_missing
climada_petals/engine/test/test_supplychain.py::TestSupplyChain_boario::test_calc_impacts_boario_rebuilding_missing
climada_petals/engine/test/test_supplychain.py::TestSupplyChain_boario::test_calc_impacts_boario_rebuilding_no_param
climada_petals/engine/test/test_supplychain.py::TestSupplyChain_boario::test_calc_impacts_boario_rebuilding_sep
  /var/lib/jenkins/jobs/petals_branches/branches/PR-142/workspace/climada_petals/engine/supplychain.py:763: UserWarning: BoARIO 'sim' parameters were not specified and default values are used. This is not recommended and likely undesired.
    warnings.warn(f"""BoARIO '{boario_param_type}' parameters were not specified and default values are used. This is not recommended and likely undesired."""

climada_petals/engine/test/test_warn.py::TestWarn::test_from_hazard
climada_petals/engine/test/test_warn.py::TestWarn::test_from_hazard
climada_petals/engine/test/test_warn.py::TestWarn::test_from_hazard
climada_petals/engine/test/test_warn.py::TestWarn::test_from_hazard
  /var/lib/jenkins/jobs/climada_install_env/workspace/climada/hazard/io.py:1149: DeprecationWarning: `product` is deprecated as of NumPy 1.25.0, and will be removed in NumPy 2.0. Please use `prod` instead.
    hazard_kwargs[var_name] = np.array(hf_data.get(var_name))

climada_petals/engine/test/test_warn.py::TestWarn::test_from_hazard
  /var/lib/jenkins/jobs/climada_install_env/workspace/climada/hazard/io.py:1169: DeprecationWarning: `product` is deprecated as of NumPy 1.25.0, and will be removed in NumPy 2.0. Please use `prod` instead.
    u_hdf5.to_string, np.array(hf_data.get(var_name)).tolist()

climada_petals/entity/exposures/test/test_black_marble.py::TestProvinces::test_filter_admin1_pass
  /var/lib/jenkins/jobs/petals_branches/branches/PR-142/workspace/climada_petals/entity/exposures/black_marble.py:404: ShapelyDeprecationWarning: The 'cascaded_union()' function is deprecated. Use 'unary_union()' instead.
    all_geom = shapely.ops.cascaded_union(admin1_geom)

climada_petals/entity/exposures/test/test_black_marble.py::TestEconIndices::test_fill_econ_indicators_na_pass
climada_petals/entity/exposures/test/test_black_marble.py::TestEconIndices::test_fill_econ_indicators_pass
climada_petals/entity/exposures/test/test_black_marble.py::TestEconIndices::test_fill_econ_indicators_pass
  /var/lib/jenkins/jobs/climada_install_env/workspace/climada/util/finance.py:218: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
    close_val = float(close_val.iloc[0].values)

climada_petals/entity/exposures/test/test_crop_production.py::TestCropProduction::test_from_area_and_yield_nc4
  /var/lib/jenkins/miniforge3/envs/petals_env/lib/python3.9/site-packages/cfgrib/xarray_plugin.py:10: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    if LooseVersion(xr.__version__) <= "0.17.0":

climada_petals/entity/exposures/test/test_crop_production.py::TestCropProduction::test_from_area_and_yield_nc4
  /var/lib/jenkins/miniforge3/envs/petals_env/lib/python3.9/site-packages/setuptools/_distutils/version.py:337: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    other = LooseVersion(other)

climada_petals/entity/exposures/test/test_crop_production.py: 99 warnings
climada_petals/entity/exposures/test/test_gdp_asset.py: 12 warnings
climada_petals/hazard/test/test_flood.py: 27 warnings
  /var/lib/jenkins/jobs/climada_install_env/workspace/climada/util/hdf5_handler.py:68: DeprecationWarning: `product` is deprecated as of NumPy 1.25.0, and will be removed in NumPy 2.0. Please use `prod` instead.
    contents[name] = np.array(obj)

climada_petals/entity/exposures/test/test_crop_production.py::TestCropProduction::test_normalize_with_fao_cp
  /var/lib/jenkins/miniforge3/envs/petals_env/lib/python3.9/site-packages/numpy/core/fromnumeric.py:3504: RuntimeWarning: Mean of empty slice.
    return _methods._mean(a, axis=axis, dtype=dtype,

climada_petals/entity/exposures/test/test_crop_production.py::TestCropProduction::test_normalize_with_fao_cp
  /var/lib/jenkins/miniforge3/envs/petals_env/lib/python3.9/site-packages/numpy/core/_methods.py:129: RuntimeWarning: invalid value encountered in scalar divide
    ret = ret.dtype.type(ret / rcount)

climada_petals/entity/exposures/test/test_gdp_asset.py: 4 warnings
climada_petals/hazard/test/test_flood.py: 9 warnings
  /var/lib/jenkins/jobs/climada_install_env/workspace/climada/util/coordinates.py:884: RuntimeWarning: invalid value encountered in cast
    region_id = hdf5_f["NatIdGrid"].reshape(grid_shape).astype(int)

climada_petals/hazard/emulator/test/test_geo.py::TestGeo::test_hazregion_centroids
  /var/lib/jenkins/jobs/petals_branches/branches/PR-142/workspace/climada_petals/hazard/emulator/geo.py:109: DeprecatedWarning: from_lat_lon is deprecated. This method will be removed in a future version. Simply use the constructor instead.
    centroids = Centroids.from_lat_lon(*latlon)

climada_petals/hazard/emulator/test/test_stats.py::TestStats::test_haz_max_events
  /var/lib/jenkins/jobs/petals_branches/branches/PR-142/workspace/climada_petals/hazard/emulator/test/test_stats.py:114: DeprecatedWarning: from_lat_lon is deprecated. This method will be removed in a future version. Simply use the constructor instead.
    hazard.centroids = Centroids.from_lat_lon(np.array([1, 3, 5]), np.array([2, 4, 6]))

climada_petals/hazard/test/test_drought.py::TestReader::test
  /var/lib/jenkins/jobs/petals_branches/branches/PR-142/workspace/climada_petals/hazard/drought.py:227: DeprecatedWarning: from_lat_lon is deprecated. This method will be removed in a future version. Simply use the constructor instead.
    self.centroids = Centroids.from_lat_lon(lat_1d, lon_1d)

climada_petals/hazard/test/test_flood.py::TestRiverFlood::test_centroids_flood
  /var/lib/jenkins/jobs/petals_branches/branches/PR-142/workspace/climada_petals/hazard/test/test_flood.py:147: DeprecatedWarning: from_lat_lon is deprecated. This method will be removed in a future version. Simply use the constructor instead.
    rand_centroids = Centroids.from_lat_lon(lat.flatten(), lon.flatten())

climada_petals/hazard/test/test_flood.py::TestRiverFlood::test_exact_area_selection_country
climada_petals/hazard/test/test_flood.py::TestRiverFlood::test_exact_area_selection_region
climada_petals/hazard/test/test_flood.py::TestRiverFlood::test_flooded_area
climada_petals/hazard/test/test_flood.py::TestRiverFlood::test_flooded_area
climada_petals/hazard/test/test_flood.py::TestRiverFlood::test_flooded_area
climada_petals/hazard/test/test_flood.py::TestRiverFlood::test_flooded_area
climada_petals/hazard/test/test_flood.py::TestRiverFlood::test_isimip_country_flood
  /var/lib/jenkins/jobs/petals_branches/branches/PR-142/workspace/climada_petals/hazard/river_flood.py:398: DeprecatedWarning: from_lat_lon is deprecated. This method will be removed in a future version. Simply use the constructor instead.
    centroids = Centroids.from_lat_lon(lat, lon)

climada_petals/hazard/test/test_flood.py::TestRiverFlood::test_flooded_area
  /var/lib/jenkins/jobs/petals_branches/branches/PR-142/workspace/climada_petals/hazard/river_flood.py:317: DeprecatedWarning: set_area_pixel is deprecated. This method is futile and will be removed in a future version. `Centroids.get_area_pixel` can be run without initialization.
    self.centroids.set_area_pixel()

climada_petals/hazard/test/test_low_flow.py::TestLowFlowDummyData::test_events_from_clusters_default
climada_petals/hazard/test/test_low_flow.py::TestLowFlowDummyData::test_events_from_clusters_parameter
  /var/lib/jenkins/jobs/petals_branches/branches/PR-142/workspace/climada_petals/hazard/test/test_low_flow.py:77: DeprecatedWarning: from_lat_lon is deprecated. This method will be removed in a future version. Simply use the constructor instead.
    centroids = Centroids.from_lat_lon(np.array(lat), np.array(lon))

climada_petals/hazard/test/test_low_flow.py::TestLowFlowDummyData::test_events_from_clusters_default
climada_petals/hazard/test/test_low_flow.py::TestLowFlowDummyData::test_events_from_clusters_parameter
  /var/lib/jenkins/jobs/petals_branches/branches/PR-142/workspace/climada_petals/hazard/test/test_low_flow.py:78: DeprecatedWarning: set_lat_lon_to_meta is deprecated. This method has no effect and will be removed in a future version.
    centroids.set_lat_lon_to_meta()

climada_petals/hazard/test/test_low_flow.py::TestLowFlowNETCDF::test_combine_nc
climada_petals/hazard/test/test_low_flow.py::TestLowFlowNETCDF::test_filter_events
climada_petals/hazard/test/test_low_flow.py::TestLowFlowNETCDF::test_load_FR_all
climada_petals/hazard/test/test_low_flow.py::TestDischargeDataHandling::test_compute_threshold_grid
climada_petals/hazard/test/test_low_flow.py::TestDischargeDataHandling::test_compute_threshold_grid
  /var/lib/jenkins/miniforge3/envs/petals_env/lib/python3.9/site-packages/numpy/lib/nanfunctions.py:1563: RuntimeWarning: All-NaN slice encountered
    return function_base._ureduce(a,

climada_petals/hazard/test/test_low_flow.py::TestLowFlowNETCDF::test_combine_nc
climada_petals/hazard/test/test_low_flow.py::TestLowFlowNETCDF::test_combine_nc
climada_petals/hazard/test/test_low_flow.py::TestLowFlowNETCDF::test_combine_nc
climada_petals/hazard/test/test_low_flow.py::TestLowFlowNETCDF::test_combine_nc
climada_petals/hazard/test/test_low_flow.py::TestLowFlowNETCDF::test_filter_events
climada_petals/hazard/test/test_low_flow.py::TestLowFlowNETCDF::test_filter_events
climada_petals/hazard/test/test_low_flow.py::TestLowFlowNETCDF::test_load_FR_all
climada_petals/hazard/test/test_low_flow.py::TestLowFlowNETCDF::test_load_FR_all
  <string>:6: FutureWarning: 'M' is deprecated and will be removed in a future version. Please use 'ME' instead of 'M'.

climada_petals/hazard/test/test_low_flow.py::TestLowFlowNETCDF::test_combine_nc
climada_petals/hazard/test/test_low_flow.py::TestLowFlowNETCDF::test_filter_events
climada_petals/hazard/test/test_low_flow.py::TestLowFlowNETCDF::test_load_FR_all
  /var/lib/jenkins/jobs/petals_branches/branches/PR-142/workspace/climada_petals/hazard/low_flow.py:643: DeprecatedWarning: set_area_approx is deprecated. This method is futile and will be removed in a future version. `Centroids.get_area_pixel` can be run without initialization.
    centroids.set_area_approx()

climada_petals/hazard/test/test_low_flow.py::TestLowFlowNETCDF::test_combine_nc
climada_petals/hazard/test/test_low_flow.py::TestLowFlowNETCDF::test_filter_events
climada_petals/hazard/test/test_low_flow.py::TestLowFlowNETCDF::test_load_FR_all
  /var/lib/jenkins/jobs/petals_branches/branches/PR-142/workspace/climada_petals/hazard/low_flow.py:645: DeprecatedWarning: empty_geometry_points is deprecated. This method has no effect and will be removed in a future version. In the current version of climada the geometry points of a `Centroids` object cannot be removed as they are the backbone of the Centroids' GeoDataFrame.
    centroids.empty_geometry_points()

climada_petals/hazard/test/test_tc_rainfield.py::TestReader::test_cross_antimeridian
  /var/lib/jenkins/jobs/petals_branches/branches/PR-142/workspace/climada_petals/hazard/test/test_tc_rainfield.py:120: DeprecatedWarning: from_lat_lon is deprecated. This method will be removed in a future version. Simply use the constructor instead.
    cen = Centroids.from_lat_lon([-16.95, -16.8, -16.8], [179.9, 180.1, -179.9])

climada_petals/hazard/test/test_tc_rainfield.py: 4 warnings
climada_petals/hazard/test/test_tc_surge_bathtub.py: 1 warning
climada_petals/hazard/test/test_tc_tracks_forecast.py: 51 warnings
  <string>:6: FutureWarning: 'H' is deprecated and will be removed in a future version. Please use 'h' instead of 'H'.

climada_petals/hazard/test/test_tc_rainfield.py::TestModel::test_rainfield_diff_time_steps
  <string>:6: FutureWarning: 'T' is deprecated and will be removed in a future version. Please use 'min' instead of 'T'.

climada_petals/hazard/test/test_tc_surge_bathtub.py::TestTCSurgeBathtub::test_cross_antimeridian
  /var/lib/jenkins/jobs/petals_branches/branches/PR-142/workspace/climada_petals/hazard/test/test_tc_surge_bathtub.py:185: DeprecatedWarning: from_lat_lon is deprecated. This method will be removed in a future version. Simply use the constructor instead.
    cen = Centroids.from_lat_lon([-16.95, -16.8, -16.8], [179.9, 180.1, -179.9])

climada_petals/hazard/test/test_tc_surge_bathtub.py::TestTCSurgeBathtub::test_cross_antimeridian
climada_petals/hazard/test/test_tc_surge_bathtub.py::TestTCSurgeBathtub::test_fraction_on_land
climada_petals/hazard/test/test_tc_surge_bathtub.py::TestTCSurgeBathtub::test_surge_from_track
  /var/lib/jenkins/jobs/petals_branches/branches/PR-142/workspace/climada_petals/hazard/test/test_tc_surge_bathtub.py:53: DeprecatedWarning: from_lat_lon is deprecated. This method will be removed in a future version. Simply use the constructor instead.
    centroids = Centroids.from_lat_lon(*[ar.ravel() for ar in np.meshgrid(lon, lat)][::-1])

climada_petals/hazard/test/test_tc_surge_bathtub.py::TestTCSurgeBathtub::test_fraction_on_land
  /var/lib/jenkins/jobs/petals_branches/branches/PR-142/workspace/climada_petals/hazard/test/test_tc_surge_bathtub.py:98: DeprecatedWarning: from_lat_lon is deprecated. This method will be removed in a future version. Simply use the constructor instead.
    centroids = Centroids.from_lat_lon(lat, lon)

climada_petals/hazard/test/test_tc_surge_bathtub.py::TestTCSurgeBathtub::test_surge_from_track
  /var/lib/jenkins/jobs/petals_branches/branches/PR-142/workspace/climada_petals/hazard/test/test_tc_surge_bathtub.py:122: UserWarning: Converting non-nanosecond precision datetime values to nanosecond precision. This behavior can eventually be relaxed in xarray, as it is an artifact from pandas which is now beginning to support non-nanosecond precision values. This warning is caused by passing non-nanosecond np.datetime64 or np.timedelta64 values to the DataArray or Variable constructor; it can be silenced by converting the values to nanosecond precision ahead of time.
    track = xr.Dataset({

climada_petals/hazard/test/test_tc_surge_bathtub.py::TestTCSurgeBathtub::test_surge_from_track
  /var/lib/jenkins/jobs/petals_branches/branches/PR-142/workspace/climada_petals/hazard/test/test_tc_surge_bathtub.py:157: DeprecatedWarning: from_lat_lon is deprecated. This method will be removed in a future version. Simply use the constructor instead.
    centroids = Centroids.from_lat_lon(lat, lon)

climada_petals/hazard/test/test_tc_tracks_forecast.py::TestCXML::test_custom_xsl
climada_petals/hazard/test/test_tc_tracks_forecast.py::TestCXML::test_default_xsl
  /var/lib/jenkins/jobs/petals_branches/branches/PR-142/workspace/climada_petals/hazard/tc_tracks_forecast.py:641: FutureWarning: The argument 'infer_datetime_format' is deprecated and will be removed in a future version. A strict version of it is now the default, see https://pandas.pydata.org/pdeps/0004-consistent-to-datetime-parsing.html. You can safely remove this argument.
    all_storms_df = pd.read_csv(

climada_petals/hazard/test/test_wildfire.py::TestMethodsFirms::test_centroids_pass
  /var/lib/jenkins/jobs/petals_branches/branches/PR-142/workspace/climada_petals/hazard/wildfire.py:658: DeprecatedWarning: set_area_approx is deprecated. This method is futile and will be removed in a future version. `Centroids.get_area_pixel` can be run without initialization.
    centroids.set_area_approx()

climada_petals/hazard/test/test_wildfire.py::TestMethodsFirms::test_centroids_pass
  /var/lib/jenkins/jobs/petals_branches/branches/PR-142/workspace/climada_petals/hazard/wildfire.py:660: DeprecatedWarning: empty_geometry_points is deprecated. This method has no effect and will be removed in a future version. In the current version of climada the geometry points of a `Centroids` object cannot be removed as they are the backbone of the Centroids' GeoDataFrame.
    centroids.empty_geometry_points()

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
- generated xml file: /var/lib/jenkins/jobs/petals_branches/branches/PR-142/workspace/tests_xml/tests.xml -

---------- coverage: platform linux, python 3.9.18-final-0 -----------
Name                                                                            Stmts   Miss  Cover
---------------------------------------------------------------------------------------------------
climada_petals/__init__.py                                                         13      2    85%
climada_petals/engine/supplychain.py                                              246     56    77%
climada_petals/engine/warn.py                                                     155     15    90%
climada_petals/entity/exposures/black_marble.py                                   181     62    66%
climada_petals/entity/exposures/crop_production.py                                443    207    53%
climada_petals/entity/exposures/gdp_asset.py                                       96     15    84%
climada_petals/entity/exposures/osm_dataloader.py                                 128     12    91%
climada_petals/entity/exposures/spam_agrar.py                                     171    117    32%
climada_petals/entity/impact_funcs/drought.py                                      67     45    33%
climada_petals/entity/impact_funcs/relative_cropyield.py                           28     15    46%
climada_petals/entity/impact_funcs/river_flood.py                                 102     16    84%
climada_petals/hazard/copernicus_interface/create_seasonal_forecast_hazard.py     332    285    14%
climada_petals/hazard/copernicus_interface/downloader.py                           47     40    15%
climada_petals/hazard/copernicus_interface/heat_index.py                          101      3    97%
climada_petals/hazard/copernicus_interface/index_definitions.py                    36     12    67%
climada_petals/hazard/copernicus_interface/seasonal_statistics.py                  85     75    12%
climada_petals/hazard/copernicus_interface/test_heat_index.py                      84      1    99%
climada_petals/hazard/drought.py                                                  277     69    75%
climada_petals/hazard/emulator/emulator.py                                        116      8    93%
climada_petals/hazard/emulator/geo.py                                              83      1    99%
climada_petals/hazard/emulator/random.py                                           52      3    94%
climada_petals/hazard/emulator/stats.py                                            97      4    96%
climada_petals/hazard/landslide.py                                                 76      3    96%
climada_petals/hazard/low_flow.py                                                 361     45    88%
climada_petals/hazard/relative_cropyield.py                                       416    310    25%
climada_petals/hazard/rf_glofas/cds_glofas_downloader.py                           72      4    94%
climada_petals/hazard/rf_glofas/setup.py                                           75     54    28%
climada_petals/hazard/rf_glofas/transform_ops.py                                  160     18    89%
climada_petals/hazard/river_flood.py                                              152     45    70%
climada_petals/hazard/tc_rainfield.py                                             343    109    68%
climada_petals/hazard/tc_surge_geoclaw/geoclaw_runner.py                          359    114    68%
climada_petals/hazard/tc_surge_geoclaw/plot.py                                    106      8    92%
climada_petals/hazard/tc_surge_geoclaw/sea_level_funs.py                          122     10    92%
climada_petals/hazard/tc_surge_geoclaw/setup_clawpack.py                           50     15    70%
climada_petals/hazard/tc_surge_geoclaw/tc_surge_events.py                         124      1    99%
climada_petals/hazard/tc_surge_geoclaw/tc_surge_geoclaw.py                        143     40    72%
climada_petals/hazard/tc_tracks_forecast.py                                       262     44    83%
climada_petals/hazard/wildfire.py                                                 495    292    41%
---------------------------------------------------------------------------------------------------
TOTAL                                                                            6545   2175    67%

17 files skipped due to complete coverage.
Coverage HTML written to dir coverage
Coverage XML written to file coverage.xml

=========================== short test summary info ============================
FAILED climada_petals/hazard/test/test_tc_rainfield.py::TestReader::test_tcr - TypeError: compute_angular_windspeeds() got an unexpected keyword argument 'model_kwarg'
=========== 1 failed, 227 passed, 349 warnings in 199.13s (0:03:19) ============
make: *** [Makefile:23: unit_test] Error 1

Declarative: Post Actions / Archive JUnit-formatted test results

Warning in junit step, with arguments tests_xml/*.xml.

1 tests failed

Details

  • Declarative: Checkout SCM (3.8 sec)
    • setup-environment (1.7 sec)
    • ci (3 min 28 sec)
      • lint (1 ms)
        • lint (57 sec)
      • unit_test (3 min 26 sec)
        • unit_test (3 min 23 sec)
          Error: script returned exit code 2
    • Declarative: Post Actions (3.1 sec)
      Unstable: 1 tests failed