Releases: CLIMADA-project/climada_python
v3.1.1
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
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
andget_exposures
- method names changed,
util.interpolate
- refactoring: the module
util.interpolate
was removed and the methods therein were refactored and integrated inutil.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 toeuclidean
. This is faster thanhaversine
for (quasi-)gridded data but less accurate.
- refactoring: the module
TCTracks.from_ibtracs_netcdf
: now stores selected agency for each track variable- Uncertainty Quantification
- renaming module from
uncertainty_quantification
tounsequa
- updating of all plotting methods
- addition of helper methods for the most common uncertainty input parameters for exposures, hazard, impact functions, entities, measures.
- renaming module from
hazard.select
works withextent
.- addition of
hazard.select_tight
to reduce a hazard to a box around anexposure
. - 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 byshapereader.Reader
.
Note: This may lead to aKeyError '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
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
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
andget_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 forreproject_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 toLitPop().set_nightlight_intensity
. - config: the
setup_logging
function was removed from the module, to change the logging level programmaticallyconfig.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
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 methodsLitPop.set_custom_shape
andLitPop.set_custom_shape_from_countries
- Init population or nightlight exposures with convenience wrappers
LitPop.set_population
andLitPop.set_nightlights
- Universal country ISO code conversion function
country_to_iso
inclimada.util.coordinates
. - Reproject 2D np.ndarray to be aligned to a reference grid with
align_raster_data
inutil.coordinates
. - Mask array with given shapes with
mask_raster_with_geometry
inutil.coordinates
. - Tropical Cyclone random walk: Ability to use global,pre-calculated landfall decay parameters (
use_global_decay_params=True
incalc_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 nowimpf_...
and notif_...
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 ofLitPop.set_*
methods improved, - Parameter
res_km
no longer supported inLitPop.set_*
methods, useres_arcsec
instead with1 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
.
- Code of
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.
- Method
minor changes:
- Plots improved
- Using
pycountry
package instead ofiso3166
for across modules. - Improved performance for
Impact.select
andTropCyclone.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 thecrs
attribute in aGeoDataFrame
orExposures
object is not possible anymore. Insteadset_crs
must be used.Exposures
has a new methodset_gdf
that can be used to set theGeoDataFrame
and update thecrs
at once.
v2.1.1
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
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
v2.0-beta
With this release the increasing difficulties to set up a valid conda environment should be addressed. It is expected that this release has issues and hoped that they can be identified and addressed soon.
changed environment:
- geopandas version up to 0.8 compatible
- conda-forge is first choice channel now, because there were several issues with the default channel
major changes:
- climada.entity.exposures.Exposures restructured, unshackled from GeoDataFrame inheritance, uses composition instead.
- The GeoDataFrame data is now a property of the Exposures object: exposure.gdf.
- The default crs, climada.util.constants.DEF_CRS is now 'EPSG:4326'. It used to be {'init': 'EPSG:4326'}.
- The changed default format is now correctly interpreted by the CRS.from_user_input method of both packages, rasterio and pyproj.
- The crs format {'init': '[source]:[id]'} is not generally accepted anymore. In certain cases the crs have to be redefined to be compatible with climada 2.x.
v1.5.1
changed environment
Many external dependencies had to be updated or added, among others:
- numpy: 1.16 > 1.18
- pandas: 0.24 > 1.0
- gdal: 2.3 > 3.0
- matplotlib: 3.1 > 3.2
- rasterio: 1.0 > 1.1
- xarray: 0.12 > 0.13
- netcdf4: 1.4 >1.5
new features:
- module river_flood
- modules relative_cropyield and crop_potential, classes
RelativeCropyield
(Hazard) andCropProduction
(Exposure): assess climate impacts on agricultural crop yields (rice, maize, wheat, soy) based on global gridded crop model runs from the Inter-Sectoral Impact Model Intercomparison Project (ISIMIP), e.g. ISIMIP2b, combined with crop statistics from FAOSTAT. - module low_flow, class
LowFlow
(hazard): assess climate change impacts on surface water discharge (river low flow) based on hydrological model runs from ISIMIP. - module climada.engine.impact_data: Functions to read reported impact data from The International Disaster Database EM-DAT and load into a CLIMADA Impact instance.
- class climada.entity.impact_funcs.trop_cyclone.IFSTropCyclone: regionally calibrated impact function set for TC wind (based on Eberenz et al., in review; c.f. climada_papers)
minor changes:
- module trop_cyclone :use statistical estimate as a fallback only if radius information is missing from the reported data
- module util.constants :add NATEARTH_CENTROIDS_150AS and NATEARTH_CENTROIDS_360AS datasets
- module util.coordinates : method get_country_code has mapping of disputed areas to values above 900
- module util.coordinates : new method
get_isimip_gridpoints()
- class hazard.tc_tracks.TCTracks: new fields
bounds
andextent
, new methodsubset
- class hazard.centroids.Centroids: new method
from_geodataframe()
, new optional parameterextent
inselect()
v1.5.0
changed environment
Many external dependencies had to be updated or added, among others:
- numpy: 1.16 > 1.19
- pandas: 0.24 > 1.0
- gdal: 2.3 > 3.0
- matplotlib: 3.1 > 3.2
- rasterio: 1.0 > 1.1
- xarray: 0.12 > 0.13
- netcdf4: 1.4 >1.5
new features:
- module river_flood
- modules relative_cropyield and crop_potential, classes
RelativeCropyield
(Hazard) andCropProduction
(Exposure): assess climate impacts on agricultural crop yields (rice, maize, wheat, soy) based on global gridded crop model runs from the Inter-Sectoral Impact Model Intercomparison Project (ISIMIP), e.g. ISIMIP2b, combined with crop statistics from FAOSTAT. - module low_flow, class
LowFlow
(hazard): assess climate change impacts on surface water discharge (river low flow) based on hydrological model runs from ISIMIP. - module climada.engine.impact_data: Functions to read reported impact data from The International Disaster Database EM-DAT and load into a CLIMADA Impact instance.
- class climada.entity.impact_funcs.trop_cyclone.IFSTropCyclone: regionally calibrated impact function set for TC wind (based on Eberenz et al., in review; c.f. climada_papers)
minor changes:
- module trop_cyclone :use statistical estimate as a fallback only if radius information is missing from the reported data
- module util.constants :add NATEARTH_CENTROIDS_150AS and NATEARTH_CENTROIDS_360AS datasets
- module util.coordinates : method get_country_code has mapping of disputed areas to values above 900
- module util.coordinates : new method
get_isimip_gridpoints()
- class hazard.tc_tracks.TCTracks: new fields
bounds
andextent
, new methodsubset
- class hazard.centroids.Centroids: new method
from_geodataframe()
, new optional parameterextent
inselect()