-
Notifications
You must be signed in to change notification settings - Fork 11
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
Expand capability of geojson class #694
base: develop
Are you sure you want to change the base?
Conversation
pass | ||
|
||
|
||
# TODO: Inherit from GeoJSON Feature class, move to its own file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm now importing this class back into urbanopt_geojson, not inheriting. Is that the right pattern we should use?
@@ -47,6 +26,8 @@ def __init__(self, filename, building_ids=None, skip_validation=False): | |||
:param building_ids: list[str | int] | None, optional, list of GeoJSON building | |||
IDs to parse from the file. If None or an empty list, parse all buildings. | |||
""" | |||
|
|||
self._filename = Path(filename).resolve() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This came over from uo-des as well as the methods below.
@@ -122,3 +103,140 @@ def get_feature(self, jsonpath): | |||
|
|||
# otherwise return the list of values | |||
return results | |||
|
|||
# TODO: test the following methods |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We (I) should write some tests for these. Not sure if that should delay this PR or not.
pass | ||
|
||
|
||
class UrbanOptLoad: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is moved from urbanopt_geojson.py to its own file.
@@ -62,7 +62,7 @@ def __init__(self, system_parameters, template_dir): | |||
} | |||
# Get access to loop order output from ThermalNetwork package. | |||
if "fifth_generation" in district_params and "ghe_parameters" in district_params["fifth_generation"]: | |||
self.loop_order: list = load_loop_order(self.system_parameters.filename) | |||
self.loop_order = load_loop_order(self.system_parameters.filename) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mypy said this was an unnecessary type hint, since the load_loop_order
method is already hinted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks good. I would like to run my UO DES post processing before we merge this. So stay tuned! Approving for now!
Any background context you want to provide?
The urbanopt-des repo has a geojson parsing class as well as the one in the GMT. Combining them should DRY up some code. Updating the uo-des version is accomplished in urbanopt/urbanopt-des#8.
What does this PR accomplish?
How should this be manually tested?
CI is sufficient