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

Mjb/feat/osw generate landfall costs #201

Merged
merged 61 commits into from
Feb 5, 2024

Conversation

mikebannis
Copy link
Collaborator

@mikebannis mikebannis commented Dec 27, 2023

Create landfall costs from raster and per cell costs by binning bathymetric depth. Also compute costs/friction/barriers for both dry and wet areas. Near full rewrite of layer creation code.

@mikebannis mikebannis force-pushed the mjb/feat/osw-generate-landfall-costs branch from 840bac6 to f36f019 Compare December 27, 2023 22:12
@mikebannis mikebannis force-pushed the mjb/feat/osw-generate-landfall-costs branch from f36f019 to 4790c1c Compare December 27, 2023 22:16
@codecov-commenter
Copy link

codecov-commenter commented Dec 27, 2023

Codecov Report

Attention: 393 lines in your changes are missing coverage. Please review.

Comparison is base (3d00f21) 76.75% compared to head (e0a7e10) 80.98%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #201      +/-   ##
==========================================
+ Coverage   76.75%   80.98%   +4.23%     
==========================================
  Files         114      124      +10     
  Lines       13692    14059     +367     
==========================================
+ Hits        10509    11386     +877     
+ Misses       3183     2673     -510     
Flag Coverage Δ
unittests 80.98% <53.38%> (+4.23%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
reVX/config/least_cost_xmission.py 94.35% <100.00%> (+14.35%) ⬆️
reVX/config/offshore.py 100.00% <ø> (ø)
reVX/config/rpm.py 100.00% <ø> (ø)
reVX/config/transmission_layer_creation.py 100.00% <100.00%> (ø)
reVX/handlers/sc_points.py 82.64% <ø> (ø)
reVX/least_cost_xmission/__init__.py 100.00% <100.00%> (ø)
reVX/least_cost_xmission/config/constants.py 100.00% <100.00%> (ø)
reVX/least_cost_xmission/costs/dry_cost_creator.py 88.15% <100.00%> (ø)
reVX/least_cost_xmission/least_cost_paths.py 97.43% <100.00%> (+0.01%) ⬆️
reVX/least_cost_xmission/least_cost_xmission.py 89.81% <100.00%> (+0.09%) ⬆️
... and 18 more

... and 10 files with indirect coverage changes

@mikebannis mikebannis force-pushed the mjb/feat/osw-generate-landfall-costs branch from faf931d to 16d5b70 Compare December 31, 2023 23:21
@mikebannis mikebannis marked this pull request as draft January 2, 2024 01:02
@mikebannis mikebannis force-pushed the mjb/feat/osw-generate-landfall-costs branch 2 times, most recently from 3d3cf18 to 44d4e30 Compare January 8, 2024 01:45
@mikebannis mikebannis force-pushed the mjb/feat/osw-generate-landfall-costs branch from 44d4e30 to c511d97 Compare January 8, 2024 02:04
@mikebannis mikebannis force-pushed the mjb/feat/osw-generate-landfall-costs branch from 49d2c5d to 72b1af4 Compare January 23, 2024 23:27
@mikebannis mikebannis force-pushed the mjb/feat/osw-generate-landfall-costs branch from db9f1d0 to 8183cd5 Compare February 1, 2024 22:49
Copy link
Collaborator

@ppinchuk ppinchuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whew, this was a big one! Great job on this. I especially love all the composition - makes tests easier and honestly the code looks better too! We need to get better about using some of these design principles on the reV team, so good job pushing that forward.

Threw some comments below, mostly about leftover TODO's and missing exceptions? I feel like the latter may have been intentional but I don't understand why, so def let me know what your thought process there was. I may be way off base.

reVX/config/transmission_layer_creation.py Show resolved Hide resolved
reVX/least_cost_xmission/README.md Show resolved Hide resolved
reVX/least_cost_xmission/README.md Show resolved Hide resolved
reVX/least_cost_xmission/costs/cost_combiner.py Outdated Show resolved Hide resolved
reVX/least_cost_xmission/transmission_layer_creator_cli.py Outdated Show resolved Hide resolved
reVX/least_cost_xmission/transmission_layer_creator_cli.py Outdated Show resolved Hide resolved
reVX/least_cost_xmission/transmission_layer_creator_cli.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@ppinchuk ppinchuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great! Just a few final things left to resolve and then we can merge this bad boy!

@ppinchuk ppinchuk marked this pull request as ready for review February 4, 2024 02:19
@ppinchuk ppinchuk added the feature New feature or request label Feb 4, 2024
@mikebannis mikebannis merged commit 1d92b5a into main Feb 5, 2024
9 checks passed
@mikebannis mikebannis deleted the mjb/feat/osw-generate-landfall-costs branch February 5, 2024 21:17
github-actions bot pushed a commit that referenced this pull request Feb 5, 2024
* Add method to rasterize vectors into cost layers

* Build cost raster using bins

* Combine cost rasters and optional barrier normalization

* Start OffshoreCostCreator

* Update tests

* Merge offshore and land costs

* Merge barriers with new masks & chunk h5

* Allow default value to be set when reprojecting rasters

* progress converting to new offshore system

* user standardized tiff load func

* Basic friction/barrier buildign

* combine friction/barrier layers

* Start on new trans cost/fric/barrier CLI

* cost combiner for wet and dry costs

* Update doc strings

* Update logger statements

* Remove old code

* Fix test

* Refactor and pylint updates

* Use chunks for h5, save profile in attrs

* Mask dir in JSON file does not need to exist

* fric/barrier processing optimizations

* reproject tiff layers on load if needed

* Allow multiple ranges for same TIFF file

* update setup.py and requirements.txt

* Reorganize xmission directory

* Update pylintrc

* Update README

* Start updating README

* combine friction and barriers before loading into h5

* Update config actions

* Replace TypedDicts with pydantic.BaseModel

* Allow forced inclusions to be used

* minor clean up

* Remove xmission example notebooks

* Update layer creation README

* More xmission README updates

* Move mask creation to a CLI option

* CLI flag to allow unknown keys in config file

* Added missing init file for sphinx to catch the dir

* move h5 creation to CLI optoin

* Fix docstrings that throw error

* Add hard links instead of relative for Sphinx

* Add transmission to exmaples docs

* Add docs for new clis

* move h5 creation to CLI option

* Add docs to pydantic model keys

* Fix merge bugs

* Formatting + docstring updates

* Linter fix

* Various PR style updates and refactors

* Remove unnecessary TODO

* Use unified RangeConfig class for barriers and costs

* Update README for RangeConfig change

---------

Co-authored-by: ppinchuk <ppinchuk@nrel.gov>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants