-
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
updates to enable water pipeline damage modeling and other minor enhancements #38
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
- This commit separates the objects defined in `model.py` and places them into dedicated files. We utilize `__init__.py` to maintain the same import syntax. `model.py` is removed. - Tests and linting are passing. - This commit may have interfered with the `autosummary` directive for the documentation, and we will revisit this later.
This commit only contains automated formatting changes (using `black`).
Eliminates repetition in resolving `PelicunDefault/`
This commit breaks down the signle `RandomVariable` object into individual dedicated random variable objects, utilizing class inheritance. This reduces if/else logic and optional arguments, making the code much easier to understand and work with. It attempts to minimize the extent of changes outside of the UQ module. Key changes include: - Introduction of a base `BaseRandomVariable` class and specialized RV classes for different distribution types (e.g., `NormalRandomVariable`, `LogNormalRandomVariable`). - Implementation of a `rv_class_map` function, allowing for the previously used distribution names to be mapped to the new objects. - Modifications to the `RandomVariableSet` and `RandomVariableRegistry` classes to accommodate the new RV structure. - Numerous updates to unit tests (`test_uq.py`) to reflect the changes in RV handling. - A limited numer of code formatting changes to other areas of the affected files. - [X] Linter checks and unit tests pass.
Improve `empirical_data` handling for saving/loading DemandModel objects.
Using `interp` for these operations is more straightforward and consistent with the rest of the linear interpolation operations in the code base.
- [X] Linter checks pass
This commit adds a default `truncation_limits` argument to all RV objects, even for those that don't support it yet. The default is `nan` in both directions, and for the RVs that don't support truncation, a `NotImplementedError` is raised if the attribute is set to a different value while instantiating the object. This helps eliminate the if/else logic in the `model` module code, where we had to check if the distribution family is one for which we support truncation and not add that argument if it doesn't. Now we rely on the users to avoid specifying truncation limits for families that don't support it, or they will be getting the `NotImplementedError` at runtime.
Pandas 2 is out. https://pandas.pydata.org/docs/whatsnew/v2.0.0.html Unit tests and additional trial runs pass with Pandas 2 installed. This commit raises the ceiling for the Pandas version to eliminate environment dependency incompatibilities for the users.
Windows sometimes uses different dtypes for ints there, but the values are the same. Instead of explicitly checking the OS, it's simpler to just not expect the dtypes to always match. The represented values should still be equal.
Begin including `Hazus_Earthquake_IM.py`, `Hazus_Earthquake_Story.py`, and `export_DB.py` in flake8 checks.
Getting ready to work on `db.py`
Reorder imports, silence `too-many...` warnings
Specify encoding
Remove `== True` after `pd.isna(...)`
Using `is` for `None` checks
- Code reformatting - Remove unused `target_meta_file` from `create_Hazus_EQ_bldg_injury_db`
- Enables pylint warnings on docstring issues. - Fixes the resulting warnings for `uq.py`.
- Roll back formatting changes on DataFrame definition
Removes unnecessary code
This merge was a bit messy, but I'll be more careful during the next one. --John
- Implemented a -LOC keyword for location-specific damage processes. - Redesigned damage evaluation to use a damage states when applying damage processes for more intuitive logic and to reduce if/else calls. - Modified the unit tests to align with the new approach and extended them to cover the -LOC damage process. - Updated loss estimation to bypass calculations if no damage is present, *subject to review*.
Utilizes location matching damage process tasks to aggregate pipe damage states.
Adds more cases and tests them: - `-LOC` + `NA` - `-LOC` + `ALL` + `NA`
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #38 +/- ##
==========================================
- Coverage 93.36% 92.58% -0.79%
==========================================
Files 6 12 +6
Lines 2428 2509 +81
==========================================
+ Hits 2267 2323 +56
- Misses 161 186 +25 ☔ View full report in Codecov by Sentry. |
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.