Releases: CLIMADA-project/climada_python
v3.3.0
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.sourceshas 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 readingHazardobjects from anxarray.Dataset, or from a file that can be read byxarray.
#507, #589, #652.climada.engine.impact.Impactobjects have new methodsfrom_hdf5andwrite_hdf5for reading their data from, and writing it to, H5 files #606climada.engine.impact.Impactobjects has a new class methodconcatfor concatenation of impacts based on the same exposures #529.climada.engine.impact_calc: this module was separated fromclimada.engine.impactand contains the code that dealing with impact calculation while the latter focuses on impact data #560.- The classes
Hazard,ImpactandImpactFreqCurvehave a novel attributefrequency_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
Impactcalculation underwent a major refactoring. Now the suggested way to run an impact calculation is byclimada.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
fractionof aHazardobject toNonewhich will have the same effect as if it were1everywhere. 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()andclimada.enginge.impact.Impact.calc_impact_yearset(), #436.
v3.2.0
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
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
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_infosreturns only data types with active datasets (data types with only test data are hidden) - concatenation of CLIMADA objects was removed from
get_hazardandget_exposures
- method names changed,
util.interpolate- refactoring: the module
util.interpolatewas removed and the methods therein were refactored and integrated inutil.coordinates. - a new method
_nearest_neighbor_euclideanwas added to find nearest neighbors with a k-d tree using Euclidean metric. - the default distance for
exposure.assign_centroidswas changed toeuclidean. This is faster thanhaversinefor (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_quantificationtounsequa - 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.selectworks withextent.- addition of
hazard.select_tightto 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_exposuresandget_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=Falsein_get_litpop_single_polygon) - litpop: minor improvements in readability and code efficiency, incl. better documentation
- litpop: method
LitPop().set_nightlightsis renamed toLitPop().set_nightlight_intensity. - config: the
setup_loggingfunction was removed from the module, to change the logging level programmaticallyconfig.LOGGER.setLevelcan be used.
removed modules:
The following modules have been moved to CLIMADA-project/climada_petals:
climada,engine.supplychainclimada.entity.exposures.black_marbleclimada.entity.exposures.crop_productionclimada.entity.exposures.gdp_assetclimada.entity.exposures.open_street_mapclimada.entity.exposures.spam_agrarclimada.entity.impact_funcs.droughtclimada.entity.impact_funcs.relative_cropieldclimada.entity.impact_funcs.river_floodclimada.hazard.droughtclimada.hazard.emulatorclimada.hazard.landslideclimada.hazard.low_flowclimada.hazard.relative_cropyieldclimada.hazard.river_floodclimada.hazard.tc_rainfieldclimada.hazard.tc_surge_bathtubclimada.hazard.tc_tracks_forecastclimada.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
CropProductionexposures 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
LitPopexposures for custom geographic shapes with methodsLitPop.set_custom_shapeandLitPop.set_custom_shape_from_countries - Init population or nightlight exposures with convenience wrappers
LitPop.set_populationandLitPop.set_nightlights - Universal country ISO code conversion function
country_to_isoinclimada.util.coordinates. - Reproject 2D np.ndarray to be aligned to a reference grid with
align_raster_datainutil.coordinates. - Mask array with given shapes with
mask_raster_with_geometryinutil.coordinates. - Tropical Cyclone random walk: Ability to use global,pre-calculated landfall decay parameters (
use_global_decay_params=Trueincalc_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_clientcontaining 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)' litpopmodule:- Code of
litpopmodule has been completely revised and performance ofLitPop.set_*methods improved, - Parameter
res_kmno longer supported inLitPop.set_*methods, useres_arcsecinstead 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
yearsetsmodule:- 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_vectneeds to be generated or is provided)
centroidsmodule:- Method
centroids.appendchanged behaviour: rasters are transformed to points before appending and raster information is lost.
- Method
minor changes:
- Plots improved
- Using
pycountrypackage instead ofiso3166for across modules. - Improved performance for
Impact.selectandTropCyclone.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.
geopandasversion 0.6 was abandanoned. It is now required to be 0.8 or higher. Direct assignment of thecrsattribute in aGeoDataFrameorExposuresobject is not possible anymore. Insteadset_crsmust be used.Exposureshas a new methodset_gdfthat can be used to set theGeoDataFrameand update thecrsat 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_centroidsfunction