mdbartos / pysheds

:earth_americas: Simple and fast watershed delineation in python.
GNU General Public License v3.0
717 stars 196 forks source link

#110 add kwarg to nearest_cell for indexing #112

Closed debboutr closed 4 years ago

debboutr commented 4 years ago

Here's an attempt at adding the functionality of the nearest_cell method to allow the user to define another approach to how the pour point geometry will be indexed in the raster. I'd be happy to add a test, but I am unsure of how you are running tests right now. Is there a testing package that you are using? Thanks

coveralls commented 4 years ago

Pull Request Test Coverage Report for Build 279


Totals Coverage Status
Change from base Build 272: 0.007%
Covered Lines: 2022
Relevant Lines: 2483

💛 - Coveralls
mdbartos commented 4 years ago

Thanks for the PR. To add tests, add a new function to /tests/test_grid.py that checks the new functionality. The new function will be called automatically by pytest.

You can run tests locally by navigating to the root directory of the repo and running:

pytest

To run tests + coverage check, run:

pytest --cov=pysheds/

For more info, see: https://docs.pytest.org/en/latest/

Note that pushing to your fork will automatically trigger the test on Travis.

debboutr commented 4 years ago

Just popped a test in that I think provides some coverage for this feature. Any feedback towards improvement would be appreciated. One thing I noticed when trying to run pytest was that you can't have pyproj installed from `conda or you will get this error

installing w/ pip did the trick for me though. I got the tests to pass, but not with the --cov flag, not sure what to do there, sorry. It says unrecognized arguments, is there another package that I need to do that?

Thanks!