-
Notifications
You must be signed in to change notification settings - Fork 27
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
BUG: Ignore categorical columns not in measurements #161
Conversation
@@ -63,17 +69,31 @@ def load_vector_data( | |||
logger = get_logger() | |||
|
|||
if isinstance(vector_data, (str, os.PathLike)): | |||
vector_data = geopandas.read_file(vector_data) | |||
try: | |||
vector_data = geopandas.read_file(vector_data, include_fields=measurements) |
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.
Read subset of measurements for efficiency.
if "geometry" not in vector_data.columns: | ||
|
||
if measurements is not None: | ||
vector_data = vector_data[measurements + [vector_data.geometry.name]] |
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.
Ensure only measurements requested in dataframe.
5e21d3e
to
1495ab7
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #161 +/- ##
==========================================
- Coverage 97.03% 96.23% -0.80%
==========================================
Files 14 14
Lines 439 452 +13
==========================================
+ Hits 426 435 +9
- Misses 13 17 +4 ☔ View full report in Codecov by Sentry. |
Thanks @justingruca 👍 |
make_geocube
for a second categorical variable fails withKeyError
#160docs/history.rst
for all changes anddocs/geocube.rst
for new API