Commit b452bb0
committed
Add more intuitive unit specification when creating Hazard object via attrs keyword
The Hazard.from_raster method allows you to specify an `attrs` dictionary to set
additional parameters in the created Hazard's `__init__` method.
This commit
- allows you to set both 'unit' and 'units' which will be used as the 'units' parameter
when the Hazard object is created, with 'units' taking priority. Currently only 'unit' is
accepted which is very counterintuitive, since all other attributes are exactly as
specified in the `__init__`
- adds an ATTRS_TO_CHECK constant to the hazard module's io.py so that the user can see
what is supported in the source code (and removes a comment that suggests doing this).
- updates the documentation1 parent 42e5160 commit b452bb0
1 file changed
Lines changed: 17 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
47 | 59 | | |
48 | 60 | | |
49 | 61 | | |
| |||
135 | 147 | | |
136 | 148 | | |
137 | 149 | | |
138 | | - | |
| 150 | + | |
| 151 | + | |
139 | 152 | | |
140 | 153 | | |
141 | 154 | | |
| |||
712 | 725 | | |
713 | 726 | | |
714 | 727 | | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | | - | |
| 728 | + | |
719 | 729 | | |
720 | 730 | | |
721 | 731 | | |
| |||
777 | 787 | | |
778 | 788 | | |
779 | 789 | | |
| 790 | + | |
| 791 | + | |
780 | 792 | | |
781 | 793 | | |
782 | 794 | | |
| |||
0 commit comments