[pull] main from CLIMADA-project:main#14
Open
pull[bot] wants to merge 903 commits into
Open
Conversation
* README.md change short description of climada * cosmetics * markdown linting
…-parameter Shift cyclostrophic argument to model_kwargs in from_tracks
Co-authored-by: Emanuel Schmid <[email protected]>
Checks in readers/writers to enforce correct types for `event_name` and `event_id` container and elements
* pydoc: fix bullet points and indentation
Co-authored-by: Chahan M. Kropf <[email protected]>
…_tutorial Updates to impact yearset module and review of tutorial
* add bounds * update CHANGELOG * modify NA * modify NI * make basin a data class, add function to split by basin * convert data cls to enum cls * add test and fix pylits * rename enum class * implement Emanuel method and add origin arg * add docstrings, return TCTtracks, move basin GDF * update changelog * Update climada/hazard/tc_tracks.py Co-authored-by: Chahan M. Kropf <[email protected]> * Update CHANGELOG.md Co-authored-by: Chahan M. Kropf <[email protected]> * Update climada/hazard/tc_tracks.py Co-authored-by: Chahan M. Kropf <[email protected]> * Update climada/hazard/tc_tracks.py Co-authored-by: Chahan M. Kropf <[email protected]> * Update climada/hazard/tc_tracks.py Co-authored-by: Chahan M. Kropf <[email protected]> * update test and fix lon format bug --------- Co-authored-by: Chahan M. Kropf <[email protected]>
Feature/density tracks
* Add function to test if lat and lon are in geographic coords * Add test for geographic coords in dist_to_coast * Add test for geographic coords in coord_on_land * Switch branch feature/remove_implicite_use_crs to black format * Extend allowed extent for geo coords * Modify allowed extents in geo_coords check function to allow for bounds * Include possible wrong lat lon extension in error message * Add check for geo coords in get_country_code * Add test for geocoords in convert_wgs_to_utm * Update error message in coord_on_land * Harmonize error messages * Adapt test get_country_geometries_fail * Check for geo coords in match_coordinates * Add check for lat in get_gridcellarea * Modify check geo coords function to please linter * Add test for geo coords in calc of coriolis param * Add tests for check_if_geo_coords function * Incorporate suggestions from review 1 * Start adapating match_coordinates function to other crs * Add handling of unit in match_centroids * Rename deg to degrees * Add function to infer unit of coordinates * Use infer_unit_coords in match_centroids function * Add tests for unit_infer and unit-adapted match_coordinates * Make test_tack_land_params compliant with new requirement of geodetic coords * Correct wrong is_geodetic crs attribute * Add restriction for haversine with non-degree units * Finish adding test for handling of different units * Add test invalid unit for match coords and docstrings * Update docstrings * Try to fix new linter issues * Correct error in logger warning * Force check_antimeridian to False in distance euclidean if unit is not degree * Remove outdated test for raise of ValueError when check_antimeridian is attempted in non-degree units * Add function to get coordinates from axis of coordinates'crs * Update unit names to be consistent with epsg notation and remove unit kw from match_centroids * Clarify docstring check_if_geo_coords * Make conversion between radians and degrees more consistent * Remove deprecated infer_unit_coords function * Update tests * Force input coords and centroids to have crs attribute in match_centroids * Re-harmonize unit names and raise error when crs of centroids or coords is None * Add missing tests * Fix linter issues * Refix linter * Wrap valuerror raising in check_if_geo_coords * Update tests * Remove useless info in get_crs_unit docstring * Raise separate exceptions for missing crs in coord_gdf and centroids Co-authored-by: Chahan M. Kropf <[email protected]> * Fix error in _nearest_neighbor_approx docstring * Make clearer error message for _nearest_neighbor with non-allowed units * Simplify crs check in match_centroids * Correct typo and update tests for new error messages in match_centroids * Only warn for check_antimeridian when it is true and add tests * Allow for units other than degree km and m by keeping distance threshold in the given unit * Update thresholds in test to be consisten with handling of thresholds in non-degree units * Remove mention to calling functions in error message in _nearest_neighbor_haversine Co-authored-by: Chahan M. Kropf <[email protected]> * Remove mention to calling functions in error message in _nearest_neighbor_approx Co-authored-by: Chahan M. Kropf <[email protected]> * Update docstrings match_centroids * update docstrings for match_coordinates * Update changelog * Update docstring to removed grid centroids + black * Add error to docstring and return value * Replace default threshold by dynamic one and apply black * Update tests to use dynamic threshold * Simplify non degree crs handling * Use crs instead of unit * Update test to use crs as input * Require explicit threshold for single centroid coordinates * Add docstrings for km to degree and inverse * Add docstrings for estimate threshold * Update impact tests * Add test for projected crs * Add docstring in impact calc * Update impact calc test to use correct distance threshold * Add impact calc test with other crs * Improve docstrings * Separate check geo coordinates into two methods * Improve docstrings * Correct docstrings * Add new coordinates methods to changelog * Improve wording * Fix resolution to be only positive * Add coordinate checks for bounds * Add test test resolution * Add test assign other crs * Update changelog * Revert bounds and normalize degree check as test were broadly failing. * Check that lon normalize values are actually proper longitudes * Revert "Check that lon normalize values are actually proper longitudes" This reverts commit 86bb4f5. * Raise error if no res above min_threshold can be found in get_resolution_1d * Add test exception exp.assign_centroids when crs not equal * Add test get_unit_crs for undefined unit * Add test unknown unit get_gridcell_area * Add test estimate_matching_threshold * check geocoords in lon_normalize and handle empty arrays in check geocoords * Update tests lon_normalize * Increase allowed lon extent in is_geo_coords to avoid failing tests with ibtracks * Update offensive value for test_get_country_geometries_fail * Add handling of nans in is_geo_coords * Update changelog * Update climada/engine/impact_calc.py * Clarify meaning of highest resolution in docstrings Co-authored-by: Chahan M. Kropf <[email protected]> * Clarify meaning of highest resolution in docstrings Co-authored-by: Chahan M. Kropf <[email protected]> * Correct typo in docstring Co-authored-by: Luca Severino <[email protected]> * Fix typo in docstring Co-authored-by: Luca Severino <[email protected]> * Resolve linter issue --------- Co-authored-by: luseverin <[email protected]> Co-authored-by: luseverin <[email protected]> Co-authored-by: Chahan Kropf <[email protected]>
…rial Minor updates from data API tutorial review
Co-authored-by: Eliane Kobler Co-authored-by: emanuel-schmid
* Add target_grid option in LitPop.from_countries * Update LitPop tests for target_grid argument * Add target grid litpop * Move target grid definition to from_countries() * Remove unused function in test_litpop * Update 15 arcsec grid definition and formatting * Continue refactoring of litpop with target_grid argument * Uncomment test litpop * pylint * pylint * name arguments * cosmetics * name arguments correctly * move target_grid default into from_shape * fix some tests * distribute parts of _define_target_grid to respective helper modules * make test_from_shape_zurich_pass pass * test_from_shape_zurich_pass: remove notes about changed excpectations --------- Co-authored-by: emanuel-schmid <[email protected]>
* Allow metadata values to be set when reading Exposures from raster * Fix linting * Fix linting * Update CHANGELOG.md * Don't restrict Exposures.from_raster attrs parameter to metadata Previously we only let the attrs parameter set Exposures metadata attributes. We remove this restriction so that it can specify any parameter in the Exposures.__init__ method. --------- Co-authored-by: emanuel-schmid <[email protected]>
#1048) * Initial draft for calibration from scipy.optimize * Draft for impact function calibration * Add first unit tests of calibration module * ci: Add bayesian-optimization during Jenkins build * Add __init__.py for util/calibarte/test module * Add climada.util.calibrate.test module to test discovery * Add unit and integration tests, update code base * Start documenting new calibrate module * Actually add the intregration test * Add some documentation * commit PLEASE CLEAN UP * Add more docstrings and simplify imports through __init__ * Add separate Output classes for each optimizer * Restructure calibration module * Add tutorial on impact function calibration * Update tutorial * Remove hazard event selection from calibrate.Input * Update calibration tutorial * Update climada/util/calibrate/bayesian_optimizer.py Use negative cost function as target function in BayesianOptimizer Co-authored-by: Thomas Vogt <[email protected]> * Separate computing cost from transforming impact objects * Add evaluator for calibration output * Add TestBayesianOptimizer test to test loader * Update code, docs, and tutorial * Update tutorial * Add option to adjust data frame alignment * add seaborn * Add function to plot Impf variability of calibration (#791) Co-authored-by: Schmid Timo <[email protected]> Co-authored-by: Lukas Riedel <[email protected]> * Improve alignment and handling of NaNs * Add seaborn to dependencies * Split tests into multiple files, finish up * Move impact transform and align to Input * Use MultiIndex in parameter space dataframe * Update tutorial * Fix requirements for calibration module Seaborn and bayes_opt * Remove plot_impf_set function and improve exception type * Add tests for OutputEvaluator * Fix name of bayes_opt package on PyPI * Make sure latest seaborn is installed on Jenkins * Remove unused function definition * Fix linter issues and remove unused code * Add BayesianOptimizerOutputEvaluator * Fix typo in tutorial * Add GNU license header to new files * Update CHANGELOG.md * edit authors.md * Fix a bug in parameter space plot * Add ensemble calibrators * Fix issue with constraints and allow_duplicate_points * Fix bug in to_input_var * Increment random seed and update output handling * Make EnsembleOptimizer run in parallel * Add docstring to EnsembleOptimizer.run * Add suggestions from code review * Rename 'true' parameter to 'data' in 'target_func' method. * Remove setting random_state in run function during tests. * Add explicit haz_type to tests to avoid warnings. * Update cross-calibration module * Add option to read and write EnsembleOptimizerOutput from/to HDF5. * Add plotting functions for EnsembleOptimizerOutput. * Streamline EnsembleOptimizer with generator methods. * Add unit tests for cross calibration Many tests still missing. * Avoid errors when storing event names in cross calibration output * Add iteration controller for BayesianOptimizer * Fix calibrate module init and add first controller tests * Deepcopy optimizer run kwargs and add hazard intensity histogram to shiny plot * Fix handling of instance maximum for constrained optimization * Add tests for BayesianOptimizerController and fix verbosity * Add test for plotting parameter space * Update integration tests for BayesianOptimizer Include controller. * Add explanation of BayesianOptimizerController to tutorial * add preliminary plot_category function * Add option to reduce tragedy ensemble size * Add option to store and load calibration results * Update plots and tutorial * Fix annotations, docstrings, some linter issues * Add tests for cross_calibrate.py * Add test execution to test_cross_calibrate.py * Update plots, tests, docstrings, docs * Rename cross_calibrate.py to ensemble.py * Improve plots, add 'replace' parameter to AverageEnsembleOptimizer * Add ensemble calibration to tutorial * Remove custom changes to Jenkins script * Beautify plot * Update calibation tutorial * Use absolute imports for referring out of this module * Update docs and links in tutorial * Add `data_weights` to calibration Input * Use weights for sampling with replacement in AverageEnsembleOptimizer. * Update tests * Add equality comparison to EnsembleOptimizerOutput * Update CHANGELOG.md * Update CHANGELOG.md * Comply to abstractmethod interface in BayesianOptimizer * Fix linter issue where builtin 'input' was shadowed * Suggest that cost functions take ndarrays * Update tutorial * Make cost functions consume numpy arrays * Update docs * Update tutorial * remove useless tqdm artefacts * Update climada/util/calibrate/ensemble.py Co-authored-by: Emanuel Schmid <[email protected]> --------- Co-authored-by: emanuel-schmid <[email protected]> Co-authored-by: Thomas Vogt <[email protected]> Co-authored-by: Timo Schmid <[email protected]> Co-authored-by: Schmid Timo <[email protected]> Co-authored-by: Emanuel Schmid <[email protected]>
* ci: Add job for Mamba installation * ci: Import CLIMADA in bash and powershell * ci: Run impact test when testing the installation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot]
Can you help keep this open source service alive? 💖 Please sponsor : )