CosmiQ / solaris

CosmiQ Works Geospatial Machine Learning Analysis Toolkit
https://solaris.readthedocs.io
Apache License 2.0
414 stars 112 forks source link

ISS270: Can't read in directories of files #271

Closed nrweir closed 5 years ago

nrweir commented 5 years ago

Thank you for submitting your PR. Please read the template below, fill it out as appropriate, and make additional changes to your code as needed. Please feel free to submit your PR even if it doesn't satisfy all of the requirements below - simply prepend [WIP] to the PR title until it is ready for review by a maintainer. If you need assistance or review from a maintainer, add the label Status: Help Needed or Status: Review Needed respectively. After review, a maintainer will add the label Status: Revision Needed if further work is required for the PR to be merged.

Description

Fixed sol.data.coco.geojson2coco() so that it can handle paths to directories fed to it. In short, it wasn't loading in the full set of images.

While fixing this, I found a bug in sol.vector.polygon.geojson_to_px_gdf() such that it throws an error if you pass it an empty GeoDataFrame (or a geojson with no geometries in it). I added a catch for that.

Closes #270

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

Please describe tests that you added to the pytest codebase (if applicable).

Checklist:

If your PR does not fulfill all of the requirements in the checklist above, that's OK! Just prepend [WIP] to the PR title until they are all satisfied. If you need help, @-mention a maintainer and/or add the Status: Help Needed label.

nrweir commented 5 years ago

@jshermeyer this should fix the problem you were having.

codecov[bot] commented 5 years ago

Codecov Report

Merging #271 into dev will increase coverage by 0.12%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #271      +/-   ##
==========================================
+ Coverage   66.84%   66.96%   +0.12%     
==========================================
  Files          70       70              
  Lines        4950     4959       +9     
==========================================
+ Hits         3309     3321      +12     
+ Misses       1641     1638       -3
Impacted Files Coverage Δ
solaris/data/coco.py 72.9% <100%> (+0.49%) :arrow_up:
tests/test_data/test_coco.py 100% <100%> (ø) :arrow_up:
solaris/vector/polygon.py 83.78% <100%> (+0.22%) :arrow_up:
solaris/utils/core.py 69.73% <100%> (+2.63%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9f5e724...20ca90f. Read the comment docs.