Skip to content

Releases: CLIMADA-project/climada_python

v3.3.0

17 Feb 15:27

Choose a tag to compare

Dependency Changes

new:

  • sparse (>=0.13) for #578

updated:

  • python 3.9 - python 3.8 will still work, but python 3.9 is now the default version for installing climada (#614)
  • contextily >=1.0 (no longer restricted to <1.2 as contextily.sources has been replaced in #517)
  • cartopy >=0.20.0,<0.20.3 (>=0.20.3 has an issue with geographic crs in plots)
  • matplotlib >=3.2,<3.6 (3.6 depends on cartopy 0.21)

Added

  • climada.hazard.Hazard.from_xarray_raster(_file) class methods for reading Hazard objects from an xarray.Dataset, or from a file that can be read by xarray.
    #507, #589, #652.
  • climada.engine.impact.Impact objects have new methods from_hdf5 and write_hdf5 for reading their data from, and writing it to, H5 files #606
  • climada.engine.impact.Impact objects has a new class method concat for concatenation of impacts based on the same exposures #529.
  • climada.engine.impact_calc: this module was separated from climada.engine.impact and contains the code that dealing with impact calculation while the latter focuses on impact data #560.
  • The classes Hazard, Impact and ImpactFreqCurve have a novel attribute frequency_unit. Before it was implicitly set to annual, now it can be specified and accordingly displayed in plots.
    #532.
  • CONTRIBUTING.md #518.
  • Changelog based on the CLIMADA release overview and https://keepachangelog.com template #626.

Changed

  • The Impact calculation underwent a major refactoring. Now the suggested way to run an impact calculation is by climada.engine.impact_calc.ImpactCalc.impact(). #436, #527.
  • Addition of uncertainty helper methods variables: list of hazard, list of impact function sets, and hazard fraction. This allows to pre-compute hazards or impact function sets from different sources from which one can then sample uniformly. #513
  • Full initialization of most Climada objects is now possible (and suggested!) in one step, by simply calling the constructor with all arguments required for coherently filling the object with data: #560, #553, #550, #564, #563, #565, #573, #569, #570, #574, #559, #571, #549, #567, #568, #562.
  • It is possible now to set the fraction of a Hazard object to None which will have the same effect as if it were 1 everywhere. This saves a lot of memory and calculation time, #541.
  • The online documentation has been completely overhauled: #597, #600, #609, #620, #615, #617, #622, #656.
  • Updated installation instructions #644

Fixed

  • several antimeridian issues: #524, #551, #613.
  • bug in climada.hazard.Centroids.set_on_land() when coordinates go around the globe: #542, #543.
  • bug in climada.util.coordinates.get_country_code() when all coordinates are on sea.
  • suppress pointless warnings in plotting functions, #520.
  • test coverage improved: #583, #594, #608, #616, #637.
  • deprecated features removed: #517, #535,#566,

Deprecated

  • climada.enginge.impact.Impact.calc() and climada.enginge.impact.Impact.calc_impact_yearset(), #436.

v3.2.0

07 Jul 14:57

Choose a tag to compare

changed environment:

  • scikit-learn >=1.0 >=0.23
  • rasterio >=1.2.7,<1.3 >=1.2.7

new features:

  • Warning class added. Allows creating warning maps from generic 2d-maps, or form Hazard or Impact objects.
  • Set of lines and polygons util functions. Exposures with lines and/or polygons can be disaggregated to points, which can be used to compute impacts that can be reaggregated afterward.

updated features:

  • Offline mode for API client enabled. Results from the CLIMADA data api can be cached and re-used later without internet connection.

minor changes:

  • Most tutorials and guides have been overhauled and consolidated.
  • Updated API wrapper functions: get clearer error messages when data doesn't exist and added method to get the standard centroids to create new hazards.
  • If more than one dataset with equal data-type and name meet the requirements, the API client only fetches the newest version, unless version='any' is specified.

v3.1.2

21 Apr 15:59

Choose a tag to compare

minor changes:

  • The setup.py and MANIFEST.in files were adapted to include the climada.engine.unsequa module in the package build.

v3.1.1

14 Feb 10:50

Choose a tag to compare

minor changes:

  • update hyperlinks in README.md
  • download test files from CLIMADA Data Api (enabling installation tests for PyPi installation)
  • climada.util.plot.get_transformation: more tolerant CRS handling

v3.1.0

02 Feb 11:25

Choose a tag to compare

updated features:

  • new function get_admin1_geometries: return GeoDataFrame with geometries of admin 1 regions within given countries.
  • 'set_' method deprecated. New methods 'from_'.
  • '+init CRS specs' deprecated.
  • data-api client refactored:
    • method names changed, list_data_type_infos returns only data types with active datasets (data types with only test data are hidden)
    • concatenation of CLIMADA objects was removed from get_hazard and get_exposures
  • util.interpolate
    • refactoring: the module util.interpolate was removed and the methods therein were refactored and integrated in util.coordinates.
    • a new method _nearest_neighbor_euclidean was added to find nearest neighbors with a k-d tree using Euclidean metric.
    • the default distance for exposure.assign_centroids was changed to euclidean. This is faster than haversine for (quasi-)gridded data but less accurate.
  • TCTracks.from_ibtracs_netcdf: now stores selected agency for each track variable
  • Uncertainty Quantification
    • renaming module from uncertainty_quantification to unsequa
    • updating of all plotting methods
    • addition of helper methods for the most common uncertainty input parameters for exposures, hazard, impact functions, entities, measures.
  • hazard.select works with extent.
  • addition of hazard.select_tight to reduce a hazard to a box around an exposure.
  • adaptations to Natural Earth (v5.0.0) from 2021-12-08. The file format has changed and posed a problem to the shapefile.Reader, which consequently was replaced by shapereader.Reader.
    Note: This may lead to a KeyError 'GDP_MD' in various places, e.g. climada.util.finance.nat_earth_adm0. To come over it, remove the cached Natural Earth files in ~/.local/share/cartopy/shapefiles/natural_earth/.

changed environment:

  • cartopy >= 0.20 (0.18 - 0.19)
  • cfgrib 0.9.7 - 0.9.9 (>= 0.9.7)
  • contextily 1.0 - 1.1 (1.0)
  • numba != 0.55.0
  • rasterio >= 1.2.7 (1.1 - 1.2.6)

v3.0.1

08 Oct 08:23

Choose a tag to compare

Hotfix for possibly biased results from the api_client.Client.get_hazard method.
Limit hazard concatenation to a single dataset by default

v3.0.0

06 Oct 09:39

Choose a tag to compare

This is the first release of the core package after CLIMADA sources have been devided into climada_python (core) and climada_petals (extensions).

changed environment:

  • cartopy>=0.18,<0.20.0 (>=0.18)
    0.20 and higher are not accepted yet, because of their changes in the CRS objects.
  • rasterio>=1.1,<1.2.7 (>=1.1)
    1.2.7 an higher are not accepted yet, also because of their changes in the CRS objects.

updated features:

  • uncertainty_quantification: a complete rewriting of the module and its API. Now it can do uncertainty and sensitivity analysis for impact and cost benefit. All the data is stored in a data class with pandas dataframes attributes. Several plotting methods have been added. Saving and loading from hdf5 files has been added.
  • impacts_funcs: added two easily modifiable generic impact functions (a step and a sigmoid function) which can be used for a broad range of hazards and resolutions.
  • api_client: added convenience methods for creating CLIMADA objects from files accessible through the api, get_hazard, get_exposures and get_litpop,
    and for collecting dataset information into data frames: into_datasets_df, into_files_df.

minor changes:

  • litpop: fix of faulty shape handling for admin1 shapes with a hole (e.g. Brandenburg)
  • litpop: remove parameter reproject_first (and functionality for reproject_first=False in _get_litpop_single_polygon)
  • litpop: minor improvements in readability and code efficiency, incl. better documentation
  • litpop: method LitPop().set_nightlights is renamed to LitPop().set_nightlight_intensity.
  • config: the setup_logging function was removed from the module, to change the logging level programmatically config.LOGGER.setLevel can be used.

removed modules:
The following modules have been moved to CLIMADA-project/climada_petals:

  • climada,engine.supplychain
  • climada.entity.exposures.black_marble
  • climada.entity.exposures.crop_production
  • climada.entity.exposures.gdp_asset
  • climada.entity.exposures.open_street_map
  • climada.entity.exposures.spam_agrar
  • climada.entity.impact_funcs.drought
  • climada.entity.impact_funcs.relative_cropield
  • climada.entity.impact_funcs.river_flood
  • climada.hazard.drought
  • climada.hazard.emulator
  • climada.hazard.landslide
  • climada.hazard.low_flow
  • climada.hazard.relative_cropyield
  • climada.hazard.river_flood
  • climada.hazard.tc_rainfield
  • climada.hazard.tc_surge_bathtub
  • climada.hazard.tc_tracks_forecast
  • climada.hazard.wildfire

v2.2.0

09 Jul 07:24

Choose a tag to compare

changed environment:

  • pycountry (iso3166)
  • peewee (new)
  • deprecation (new)
  • geopandas >=0.8 (>=0.6,<0.9)

new features:

  • Select TC tracks from IBTrACS by genesis basin (TCTracks.read_ibtracs_netcdf).
  • Discard single-point TC tracks from IBTrACS (TCTracks.read_ibtracs_netcdf).
  • Initiate CropProduction exposures directly from netcdf files with yield and cultivated area data (CropProduction.set_from_area_and_yield_nc4, CropProduction.set_from_spam_ray_mirca (convenience wrapper)).
  • Init LitPop exposures for custom geographic shapes with methods LitPop.set_custom_shape and LitPop.set_custom_shape_from_countries
  • Init population or nightlight exposures with convenience wrappers LitPop.set_population and LitPop.set_nightlights
  • Universal country ISO code conversion function country_to_iso in climada.util.coordinates.
  • Reproject 2D np.ndarray to be aligned to a reference grid with align_raster_data in util.coordinates.
  • Mask array with given shapes with mask_raster_with_geometry in util.coordinates.
  • Tropical Cyclone random walk: Ability to use global,pre-calculated landfall decay parameters (use_global_decay_params=True in calc_perturbed_trajectories, set as default).
  • Add second-order sensitivity index plot.
  • Added methods hazard.concat (concatenate several hazard) and hazard.change_centroids (project the hazard onto new centroids).
  • Added method centroids.union (create the union of centroids).
  • Centroids is now initiated with a geometry attribute with a default CRS (climada.util.constants.DEF_CRS)
  • Added module climada.util.api_client containing a basic wrapper around the data API on https://climada.ethz.ch

updated features:

  • Impact Function Naming Pattern Changed
    The naming pattern for impact functions is now impf_... and not if_... anymore. These changes affect large parts of the code, notebooks and data files.
    Although we tried hard to keep backward compatibility, some user scripts and data files may need to be adapted.
    When updating an existing CLIMADA installation, it's suggested to run the following commands in a shell/terminal:
    conda update -n climada_env –f requirements/env_climada.yml
    conda activate climada_env
    python -c 'import climada; climada.setup_climada_data(reload=True)'
    
  • litpop module:
    • Code of litpop module has been completely revised and performance of LitPop.set_* methods improved,
    • Parameter res_km no longer supported in LitPop.set_* methods, use res_arcsec instead with 1 km = ca. 30 arcsec
    • climada.entity.exposures.litpop.litpop (climada.entity.exposures.litpop),
    • climada.entity.exposures.litpop.nightlight (climada.entity.exposures.nightlight),
    • climada.entity.exposures.litpop.gpw_population (climada.entity.exposures.gpw_import).
    • Import calling sequences remain unchanged, e.g. from climada.entity import litpop.
  • yearsets module:
    • update of variable names
    • a sampling vector (2D array) replaced the sampling dictionary
    • the same event cannot occur more than once in the same year
    • the user can specify lam (the number of years around which the Poisson distribution is centered)
    • simplification of the function compute_imp_per_year (compute_annual_impacts)
    • simplification of wrapper functions (split into two wrapper functions depending on whether a sampling_vect needs to be generated or is provided)
  • centroids module:
    • Method centroids.append changed behaviour: rasters are transformed to points before appending and raster information is lost.

minor changes:

  • Plots improved
  • Using pycountry package instead of iso3166 for across modules.
  • Improved performance for Impact.select and TropCyclone.set_from_tracks.
  • Fix TC rainfield computation for tracks that don't have 1-hour time steps.
  • Cutting off TC tracks moving outside of [-70,+70] degrees latitude in synthetic tracks.
  • Bug fixes to TC random walk (calc_perturbed_trajectories) related to landfall decay.
  • Improve plots in the uncertainty module.
  • geopandas version 0.6 was abandanoned. It is now required to be 0.8 or higher. Direct assignment of the crs attribute in a GeoDataFrame or Exposures object is not possible anymore. Instead set_crs must be used.
  • Exposures has a new method set_gdf that can be used to set the GeoDataFrame and update the crs at once.

v2.1.1

19 Apr 06:47
ad94019

Choose a tag to compare

This release addresses several minor issues of the CLIMADA project while no actual source code has been changed:

  • path to climada config file fixed in setup.py
  • CLIMADA logo included
  • tutorials included in documentation
  • installation guide link fixed

v2.1.0

01 Apr 22:04

Choose a tag to compare

v2.1.0

due date: 2021-04-01

description:
Contains recently developed modules and module updates.

changed environment:

  • python == 3.8 (>=3.6)
  • openpyxl >= 3.0 (new)
  • pandas-datareader >= 0.9 (0.8)
  • pathos >= 0.2 (new
  • pyxlsb >= 1.0 (new)
  • pyepsg >= 0.4 (new)
  • SALib >= 1.3.0 (new)

new features

  • Landslide: new hazard
  • Storm_europe: new hazard including forecast functionality
  • isimip_crop: bug fix and code clean up: Restructuring of the method plot_comparing_maps in relative_cropyield hazard as a function (solves issue #112). Minor changes to fix bugs and update of parameters in crop_production.py: new conversion factors from tons to kcal KCAL_PER_TON based on Mueller et al. (2021, https://doi.org/10.1088/1748-9326/abd8fc)
  • Forecast: a new class to calculate and plot forecasted impacts, e.g. based on weather forecasts. Can inform preventive action or warning decisions.
  • Uncertainty: module to conduct global uncertainty and sensitivity analysis on CLIMADA impact and cost-benefit outputs based on the SALib package.
  • SupplyChain: module to conduct Input-Output modeling.

minor changes

  • Utility:
    • Addition of Logger level context manager
    • New functions: geo_scatter_categorical, multibar_plot, value_to_monetary_unit, sig_dig, mapping_point2grid, mapping_grid2flattened
    • Improvedfunctions: latlon_bounds (performance), read_raster_bounds, points_to_raster (handling of antimeridian),
  • License harmonisation
  • Error message to warn for change in the way items are accessed in Exposures() class.
  • Developers Guide updated
  • Main tutorials updated
  • Add figsize argument to all plotting function
  • Tropical cyclone hazard:
    • Track input from IBTrACS: rescale wind speeds of different agencies to 1-minute sustained winds, better control over agency choice and handling of missing values
    • Track input from other sources: CHAZ (Lee et al. 2018), STORM (Bloemendaal et al. 2020)
    • Wind fields: improve overall performance, choose accuracy of distance metric for better performance or higher accuracy
    • Calibration of default parameters for synthetic tracks generation
  • Greatly improve performance of Exposures.assign_centroids function