Integration of CalcDeltaImpact class of unsequa into develop by simonameiler · Pull Request #844 · CLIMADA-project/climada_python
and others added 30 commits
November 3, 2022 11:41* update __init__ in tc_tracks.py * update tc_tracks.py * update tc_tracks.py * remove trailing white space * update __init__ for hazard.tag * und changes on tc_tracks * engine.impact: proper hazard.tag initialization * cosmetics * set hazard_type de facto mandatory (de jure still optonal) Co-authored-by: emanuel-schmid <schmide@ethz.ch>
* Add type hints to Forecast.__init__ and update docstring * Update climada/engine/forecast.py Co-authored-by: Lukas Riedel <34276446+peanutfun@users.noreply.github.com> Co-authored-by: emanuel-schmid <schmide@ethz.ch> Co-authored-by: Emanuel Schmid <51439563+emanuel-schmid@users.noreply.github.com>
* update __init__ in tc_tracks.py * update tc_tracks.py * update tc_tracks.py * remove trailing white space * Update usage of TCTracks.__init__ * Update TCTracks.__init__ docstring Add information on `data` parameter. Co-authored-by: emanuel-schmid <schmide@ethz.ch> Co-authored-by: Lukas Riedel <34276446+peanutfun@users.noreply.github.com>
* update __init__ entity.tag * entity.tag.Tag.__init__: undo skip casting Co-authored-by: Emanuel Schmid <51439563+emanuel-schmid@users.noreply.github.com>
…551) * u_coord: _add_gdal_vsi_prefix * read_raster_sample: gradient feature * Fix tests for dist_to_coast_nasa * u_coord._raster_gradient: lat direction first * u_coord.read_raster_sample: support different interp methods for data and its gradient * read_raster_sample_with_gradients * u_coord: pylint unused variable Co-authored-by: emanuel-schmid <schmide@ethz.ch>
* Assume fraction is one if None * Allow fraction to be empty When fraction is empty, it is ignored in the impact calculation. The shape must still be n_events x n_exp * Correct shape to argument * Remove unecessary else * Return None in get_fraction * Set default return full fraction * Update test TC for fraction None * Remove test nozero fraction elements * Make get_fraction private to _get_fraction * Correct typo get_fraction -> _get_fraction in test * Add note that fraction is optional in hazard tutorial * Add note that probabilistic does not mean no storyline * Fix equation rendering * Fix linter issues: Single statement per line Co-authored-by: Lukas Riedel <34276446+peanutfun@users.noreply.github.com> * Set test to assert_array_equal for get_fraction * Update hazard test file to hdf5 without fraction * Update climada/engine/impact_calc.py Note, the pylint message is then disabled for the whole function. Co-authored-by: Lukas Riedel <34276446+peanutfun@users.noreply.github.com> * Make pylint ignore warning for one line only * Update loading of tc hazard file * Update loading of test hazard file * Fix test file path * test file handling consolidation * hazard.base: get_fraction has become private Co-authored-by: Chahan Kropf <chahan.kropf@posteo.com> Co-authored-by: Lukas Riedel <34276446+peanutfun@users.noreply.github.com> Co-authored-by: emanuel-schmid <schmide@ethz.ch>
* Set all Hazard attributes via __init__ This change is backwards compatible as all defaults remain the same * Add type hinting to Hazard.__init__ * Make fraction default size the same as intensity In order to be compatible with the planed changes to the fraction attribute (if empty, it is ignored), the fraction should by default be derived from the shape of the intensity attribute. * Update Hazard.__init__ signature and docstring * Add kwargs for HazardTag * Fix type hinting * Adapt unit tests to new Hazard constructor * Update tutorials to new Hazard constructor * Add test for initializing Hazard without fraction * undo re-plotting Co-authored-by: Chahan Kropf <chahan.kropf@posteo.com> Co-authored-by: emanuel-schmid <schmide@ethz.ch>
* add type hints * trop_cyclone: order imports * trop_cyclone: remove trailing whitespaces * trop_cyclone: np.array -> np.ndarray * trop_cyclone: pass kwargs to Hazard base class * TropCyclone: more type hinting Co-authored-by: Thomas Vogt <thomas.vogt@pik-potsdam.de> Co-authored-by: emanuel-schmid <schmide@ethz.ch>
* Correction of tutorials: spelling and bugs 1) First correction: Change in cell 14 of tutorial 1_main_climada.jpynb An extra comma "," was making an array behave like a tuple. 1) Second correction: Change in cell 2 of climada_engine_Forecast.jpynb Spelling mistake: there was two times in a row the word "with" and two times ## * undo replotting Co-authored-by: Nicolas Colombi <ncolombi@student.ethz.ch> Co-authored-by: emanuel-schmid <schmide@ethz.ch>
* Add all ImpactFunc attributes to ImpactFunc.__init__ * Add type hints to ImpactFunc.__init__ * Update ImpactFunc classmethods to new init * Update tests to new ImpactFunc.__init__ * Update docs on InputVar regarding ImpactFunc * Update tutorials with new ImpactFunc.__init__ * Update ImpactFunc.__init__ docstring * Update argument order of ImpactFunc.__init__ * Fix linter issue * Update tests to new ImpactFunc.__init__ * Update tutorials with new ImpactFunc.__init__ * Enable passing impact funcs to ImpactFuncSet constructor * Update code base to new ImpactFuncSet constructor * Fix unit test of ImpactFuncSet Remove initialization with set because it does not guarantee insertion order. * undo re-plotting * Incorporate new ImpactFuncSet.__init__ method Co-authored-by: emanuel-schmid <schmide@ethz.ch>
peanutfun
deleted the
feature/unsequa_delta_climate
branch
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