Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set all Hazard attributes in __init__ #549

Merged
merged 12 commits into from
Nov 14, 2022

Conversation

peanutfun
Copy link
Member

@peanutfun peanutfun commented Oct 24, 2022

Changes proposed in this PR:

  • Add all Hazard attributes as optional arguments to the Hazard.__init__

This PR fixes issue #

PR Author Checklist

PR Reviewer Checklist

This change is backwards compatible as all defaults remain the same
@peanutfun peanutfun changed the base branch from main to develop October 24, 2022 14:01
Chahan Kropf and others added 6 commits October 28, 2022 15:13
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.
* Add kwargs for HazardTag
* Fix type hinting
@chahank
Copy link
Member

chahank commented Oct 28, 2022

@peanutfun : I modified the fraction initialization defaults to always have be an empty matrix of the same size as the intensity in a43255b. This would make it compatible with the proposed changes in #541

@peanutfun
Copy link
Member Author

Very good, I already merged it with my changes. This is ready to go (if all tests pass 🙃 )

@peanutfun peanutfun marked this pull request as ready for review October 28, 2022 14:15
@peanutfun peanutfun changed the title Draft: Set all Hazard attributes in __init__ Set all Hazard attributes in __init__ Oct 28, 2022
@peanutfun
Copy link
Member Author

@emanuel-schmid I merged the latest develop into this branch. It should be ready.

@emanuel-schmid emanuel-schmid merged commit 17dfc0f into develop Nov 14, 2022
@emanuel-schmid emanuel-schmid deleted the feature/hazard-init-minimal branch November 14, 2022 08:03
simonameiler pushed a commit that referenced this pull request Aug 24, 2023
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants