Commit 0c9edcb
Feature/centroids as gdf (#787)
* Add geodataframe to centroids: first commit
* Remove raster methods, obsolete methods, and fix some.
* Remove test for removed methods
* Fix from geodataframe method
* Remove set meta to lat lon
* Update all I/O methods
* Remove area pixel
* Add method to compute the area per pixel (not attribute)
* Make get_area_pixel
* Remove not often used dist_coast and elevation
* Remove unused meta
* Change Centroids call to new signature
* Remove vector - raster hazard methods
* Restore legacy excell reader
* Remove clear method
* Remove clear test
* Update read/write centroids in hazard
* Support empty on land or region id
* Check for empty region id
* Set region id correctly
* Remove scheduler
* Add docstring
* Add legacy read hdf5
* Replace incorrect dot product
* Remove meta in assign centroids
* Remove matlab test file
* Update set lat/lon
* Update test with init
* 'Automated update v4.0.0'
* Add note on method
* changelog: for 4.0.1
* 'Automated update v4.0.1'
* Add from_meta class method
* Update centroids init
* Update read raster intensity / fraction data
* undo changelog duplications
* Update test for points outside of raster within threshold
* Docstring and cosmetics
* Add to default crs method
* Fix legacy from hdf5 for empty extra values
* Update legacy from_hdf5 to exclude 'latitude'/'longitude' from extra
* Update centroids.select to work properly with mask and indices
* Fix forecast translate bug
* Remove _set_centroids
* Remove reproject raster
* Remove test hazard raster
* Update naming for plot fraction centroids
* Replace HAZ_DEMO_MAT with HAZ_TEST_TC
* Replace mat file with hdf5 test file
* Rewrite write raster method for hazard
* Add a default for sel_cen in mask
* Correct indent typos
* Change duplicate test function name
* Replace mat file with hdf5
* Remove unused mat file import
* Add legacy code to read old centroid hdf5 files.
* Update access to centroids dist coast in gdf
* test_trop_cyclone: get test centroids from data api
* Add method to estimate meta raster from centroids
* Remove unecessary conversion to ne_geom
* Add good lat/lon values for unit test
* centroids.centr.write_hdf5: eliminate side effect
* centroids.centr.write_hdf5: elimination of side effect futile for pandas>=2.1
* centroids.test.TestCentroidsFuns.test_select_pass: adapt to downsized LAT/LON arrays
* test_vec_ras: fix TestCentroids.test_centroids_check_pass
* test_vec_ras: remove TestReader.test_write_read_points_h5 as it is redundant
to and covered by test_centr.TestCentroidsWriter.test_read_write_hdf5
* fix typo in from_exposures method
* centroids.centr.from_csv: write class method
* centroids.centr.from_csv: correct order of xy
* centroids.centr.from_excel: update method for gdf
* centroids.centr. update csv and excel methods
* Update tests in test_vec_ras
* Update more tests and remove some with meta
* centroids.centr.from_excel fix columnn indexing
* Add possibility to NOT recenter crs for countires.
This lead to a bug in the assign region id method because longitude of the countries geometry was shifted, but not the entry lat/lon points.
* Add to_csre convenience method
* Prepare the stage for setting other than admin0 region id
* Remove uneeded import
* cenctroids.centr: fix the obvious
* gencenctroids.centr: change crs of the geodataframe instead of the geometry
* white space cosmetics
* PEP8
* Add solid region id and on land tests
* Auto stash before merge of "feature/centroids_as_gdf" and "origin/feature/centroids_as_gdf"
* Update distance and area tests
* Update set crs in load vector shape file
* centr.Centroids.from_excel: deal with region_id column
* Fix write hazard raster with centroids.get_meta
* Area pixel now correctly uses CEA
* Add actual NE CRS test.
* Make on_land and region_id always part of centroids
* Update docstring
* Update import path
* Add overwrite argument to set region id and on land
* Remove from base grid method
* Fix some linting
* Add some docstrings
* Avoid costly computation in from geodataframe
* Add comment
* Fix typo
* Fix set crs in from geodataframe
* Make properties return arrays and not series
* Remove not needed matlab vars
* Revert return numpy arrays.
* update from excel
* update from_excel and from_csv
* centroids.centr: from_excel fix column renaming and adapt to "new argument names"
* Centroids.from_excel fix: switch key,val in test_storm_europe rather than in centr!
* Return numpy arrays instead of series
* Add some basic tests
* Add tests for meta
* Add tentative changelog.
* Make keywords argument only : name lat/lon : remove set_*
* Auto stash before revert of "Make keywords argument only : name lat/lon : remove set_*"
* remove file
* Fix exposures method test
* Fix setting region id and on land at init.
* Fix typo
* Fix all close values for big numbers
* Improve cosmetics.
* update docstrings, doc cosmetics
* update from_csv method, add test
* remove DEF_VAR_CSV
* Update from_excel method and test
* remove unnecessary import
* fix storm_europe tests
* improve csv and excel tests
* Apply suggestions from code review
Co-authored-by: Lukas Riedel <[email protected]>
* add excel, csv write methods and tests
* Replace gdf with _gdf
* Revert "Replace gdf with _gdf"
This reverts commit c7e6ffd.
* Update to_crs methods
* Raise error if wrong exposures
* Make from geodataframe more restrictive.
* Use consistently to_crs method
* Improve read centroids
* Add literal to import
* Update to crs with inplace argument
* improve excel, csv method, test based on review
* Update typing
* Fix equal centroids for different gdf columns ordering
* Make consistent gdf column ordering
* Simplify from excel/csv
* Add support for legacy hazard excell
* Avoid single column loading error for df
* fix path in write_excel, write_csv
* fixing docstrings in centr.py
* Update code cosmetics
* Fix typo
* Allo for kwargs in init and update from exposures
* code linting
* Centroids: test from_meta
* Centroids: refined tests
* Centroids: fix from_exposures
* Centroids: implement get_pixel_shapes
* Centroids: code linting and docstrings
* hazard.test.test_base: remove undefined classes from main
* hazard.base: remove unused imports
* hazard.base: clean up imports
* cosmetics
* hazard.base.write_htdf5: add inline comment.
* Centroids: fix _gdf_from_legacy_hdf signature
* Centroids._gdf_from_legacy_hdf5: static, not classmethod
* hazard.centroids.centr: pylint
* centroids.centr : fix pydoc typos and pylint
* climada.hazard.base: pylint
* hazard.centroids.centr: pylint
* climada.test.test_calicbration: use hzard test file with hdf5 format
* Update climada/hazard/centroids/test/test_vec_ras.py
Co-authored-by: Emanuel Schmid <[email protected]>
* Hazard: fix write_raster, and some docstrings
* test.test_calibration: fix test file name
* test_api_client: added test for basic centroids plotting
(just because it fails in PR #787)
* centr.Centroids.plot: all changes reverted
(with the exception of the obsolete `self.set_meta_to_lat_lon()`)
* Hazard tutorial: use centroids.get_meta() instead of the attribute meta
* Hazard tutorial: use Centroids() instead of from_lat_lon()
* hazard tutorial: update Hazard from raster section
* hazard tutorial: fix dist_coast access
* climada.hazard.Hazard: remove broken vector file support
* climada.hazard.centr: add deprecated methods section
* fix from_tracks method, remove side effect
* climada.hazard.trop_cyclone.TropCytlone.from_tracks: option for predefined dist_coast in centroids
* TropicalCyclone.from_tracks pydoc
* white space cosmetics
* CHANGELOG: list deprecated and removed methods
* Refactor and add to centroids testing
* trop_cyclone.TropCyclone.from_tracks: fix dist_coast type
* climada.hazard.Centroids: raise exception in deprecated methods that really _are_ failing now
* changelog: list added Centroids methods
* hazard.centr: depreecated methods: pydoc string instaed of pass
* fixing geodataframe issues
* Revert "fixing geodataframe issues"
This reverts commit d6d2859.
* centroids: deprecation warnings improved
---------
Co-authored-by: Chahan Kropf <[email protected]>
Co-authored-by: climada <[email protected]>
Co-authored-by: emanuel-schmid <[email protected]>
Co-authored-by: Sarah Hülsen <[email protected]>
Co-authored-by: Igor Detring <[email protected]>
Co-authored-by: Lukas Riedel <[email protected]>
Co-authored-by: Thomas Vogt <[email protected]>
Co-authored-by: Thomas Vogt <[email protected]>
Co-authored-by: Emanuel Schmid <[email protected]>1 parent 7f74ea4 commit 0c9edcb
File tree
26 files changed
+2357
-2691
lines changed- climada
- engine/test
- entity
- exposures
- test
- measures/test
- hazard
- centroids
- test
- test
- data
- test
- util
- test
- doc/tutorial
- script/jenkins/petals_regression_test
26 files changed
+2357
-2691
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | 13 | | |
16 | 14 | | |
| 15 | + | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
21 | 32 | | |
22 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
23 | 42 | | |
24 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
25 | 69 | | |
26 | 70 | | |
27 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | 38 | | |
40 | | - | |
| 39 | + | |
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
46 | | - | |
47 | | - | |
| 45 | + | |
| 46 | + | |
48 | 47 | | |
49 | 48 | | |
50 | 49 | | |
| |||
230 | 229 | | |
231 | 230 | | |
232 | 231 | | |
233 | | - | |
| 232 | + | |
234 | 233 | | |
235 | 234 | | |
236 | 235 | | |
| |||
267 | 266 | | |
268 | 267 | | |
269 | 268 | | |
270 | | - | |
| 269 | + | |
271 | 270 | | |
272 | 271 | | |
273 | 272 | | |
| |||
438 | 437 | | |
439 | 438 | | |
440 | 439 | | |
441 | | - | |
| 440 | + | |
442 | 441 | | |
443 | 442 | | |
444 | 443 | | |
| |||
498 | 497 | | |
499 | 498 | | |
500 | 499 | | |
501 | | - | |
| 500 | + | |
502 | 501 | | |
503 | 502 | | |
504 | 503 | | |
| |||
538 | 537 | | |
539 | 538 | | |
540 | 539 | | |
541 | | - | |
| 540 | + | |
542 | 541 | | |
543 | 542 | | |
544 | 543 | | |
| |||
588 | 587 | | |
589 | 588 | | |
590 | 589 | | |
591 | | - | |
| 590 | + | |
592 | 591 | | |
593 | 592 | | |
594 | 593 | | |
| |||
636 | 635 | | |
637 | 636 | | |
638 | 637 | | |
639 | | - | |
| 638 | + | |
640 | 639 | | |
641 | 640 | | |
642 | 641 | | |
| |||
692 | 691 | | |
693 | 692 | | |
694 | 693 | | |
695 | | - | |
| 694 | + | |
696 | 695 | | |
697 | 696 | | |
698 | 697 | | |
| |||
720 | 719 | | |
721 | 720 | | |
722 | 721 | | |
723 | | - | |
| 722 | + | |
724 | 723 | | |
725 | 724 | | |
726 | 725 | | |
| |||
777 | 776 | | |
778 | 777 | | |
779 | 778 | | |
780 | | - | |
| 779 | + | |
781 | 780 | | |
782 | 781 | | |
783 | 782 | | |
| |||
808 | 807 | | |
809 | 808 | | |
810 | 809 | | |
811 | | - | |
| 810 | + | |
812 | 811 | | |
813 | 812 | | |
814 | 813 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
114 | | - | |
| 113 | + | |
115 | 114 | | |
116 | 115 | | |
117 | 116 | | |
118 | 117 | | |
119 | | - | |
120 | | - | |
| 118 | + | |
121 | 119 | | |
122 | 120 | | |
123 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
498 | 498 | | |
499 | 499 | | |
500 | 500 | | |
501 | | - | |
502 | 501 | | |
503 | 502 | | |
504 | 503 | | |
| |||
507 | 506 | | |
508 | 507 | | |
509 | 508 | | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
510 | 518 | | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | 519 | | |
519 | 520 | | |
520 | 521 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | 63 | | |
65 | 64 | | |
66 | 65 | | |
| |||
74 | 73 | | |
75 | 74 | | |
76 | 75 | | |
77 | | - | |
78 | | - | |
| 76 | + | |
| 77 | + | |
79 | 78 | | |
80 | 79 | | |
81 | 80 | | |
| |||
131 | 130 | | |
132 | 131 | | |
133 | 132 | | |
134 | | - | |
| 133 | + | |
135 | 134 | | |
136 | 135 | | |
137 | 136 | | |
| |||
151 | 150 | | |
152 | 151 | | |
153 | 152 | | |
154 | | - | |
| 153 | + | |
155 | 154 | | |
156 | | - | |
| 155 | + | |
157 | 156 | | |
158 | 157 | | |
159 | 158 | | |
| |||
171 | 170 | | |
172 | 171 | | |
173 | 172 | | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
174 | 176 | | |
175 | 177 | | |
176 | 178 | | |
177 | 179 | | |
178 | 180 | | |
179 | 181 | | |
180 | 182 | | |
181 | | - | |
182 | 183 | | |
183 | 184 | | |
184 | | - | |
185 | | - | |
| 185 | + | |
| 186 | + | |
186 | 187 | | |
187 | 188 | | |
188 | 189 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
43 | 47 | | |
44 | 48 | | |
45 | 49 | | |
| |||
78 | 82 | | |
79 | 83 | | |
80 | 84 | | |
81 | | - | |
| 85 | + | |
82 | 86 | | |
83 | 87 | | |
84 | 88 | | |
| |||
112 | 116 | | |
113 | 117 | | |
114 | 118 | | |
115 | | - | |
| 119 | + | |
116 | 120 | | |
117 | 121 | | |
118 | 122 | | |
| |||
246 | 250 | | |
247 | 251 | | |
248 | 252 | | |
249 | | - | |
| 253 | + | |
250 | 254 | | |
251 | 255 | | |
252 | 256 | | |
| |||
329 | 333 | | |
330 | 334 | | |
331 | 335 | | |
332 | | - | |
| 336 | + | |
333 | 337 | | |
334 | 338 | | |
335 | 339 | | |
| |||
365 | 369 | | |
366 | 370 | | |
367 | 371 | | |
368 | | - | |
| 372 | + | |
369 | 373 | | |
370 | 374 | | |
371 | 375 | | |
| |||
399 | 403 | | |
400 | 404 | | |
401 | 405 | | |
402 | | - | |
| 406 | + | |
403 | 407 | | |
404 | 408 | | |
405 | 409 | | |
| |||
0 commit comments