-
Notifications
You must be signed in to change notification settings - Fork 32
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
azs - several formatting updates and refactoring & a bugfix in water autopop #44
Merged
Conversation
This file contains 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
The code is currently a bit messy and by no means final. That's what feature branches are for, I guess. Storing it here on this branch to eliminate the need of keeping it in a stash and risk accidentally purging it.
- Finalizes create_Hazus_HU_fragility_db. - Introduces a .json file with predefined metadata - Added code is linted and type-hinted.
It's simpler to just use the `sample` attribute directly here.
In an effort to modularize the loss model, sample_size is turned into an argument that has to be passed in `calculate` instead of having to infer it from other assessment models. This small change evolved into a larger refactoring effort to make sampling_size more explicit across methods. - The config schema was modified to include sampling information as part of "Options". - `sampling_size` is included in all `calcualte` methods as an explicit argument and no longer has to be infered with `self._samnt.` - Test suite updated DL_calculation is modified to assign sample_size when calling `.calculate` methods. Also: - The `config` dictionary is used explictly instead of assigning sub-dictionaries into variables. This helps understand the full path to the retrieved item at any point in the code, instead of having to remember what key corresponds to what variable. - Improved some parts where there was strange syntax like `if out_config.get('Demand', None) is not None` -> `if 'Demand' is in out_config`
Only formatting changes here.
- Don't need a second method for the deprecation warning. I'm not sure why I thought we do. - Update .gitignore
We can always place them back when we need to use them.
`_` is commonly used for representing unused variables and makes our linters happy.
Remove unused argument (PGB) from `DamageModel._prepare_dmg_quantities`
If there is no sample `aggregate_losses` returns None. Aggregating losses without a repair sample is unusual and we need to rethink what should be done in that case instad of returning None, which is a bit unintuitive and turns the output type of the method to optional, making things more complicated.
Addresses most pylint warnings after having enabled `pylint.extensions.docparams`. Left a few relating to empty property methods that are about to be removed.
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.
No description provided.