-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add write option for geopackage and geoparquet #42
Conversation
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.
Looks good. A range of suggestions for making things a bit slimmer and possibly more maintanable (fewer places to make changes in future).
Also, this would be a good opportunity to add a CLI test. You can check out how it's done in pam: https://github.com/arup-group/pam/blob/main/tests/test_99_cli.py (you basically create a dummy CLI call and then check that it did what you expected it to).
Note that when storing data, the tests do so to a temporary path tmp_path
. This is a pytest fixture: https://docs.pytest.org/en/6.2.x/tmpdir.html
RE pyarrow: add it to |
@brynpickering I've refactored The tests currently both fail...and I'm not sure what's going on... |
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.
Minor comments.
Understandable that you're having trouble with the CLI test debugging - it's always a bit of a pain. I've pushed a change with a helper function to add the full error traceback. You can hopefully use that traceback to debug the issue (something to do with the progress bar helper function).
Another point: don't forget to install pre-commit in your environment to have the code formatted correctly on commit (pre-commit install
).
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #42 +/- ##
===========================================
+ Coverage 63.75% 82.44% +18.69%
===========================================
Files 5 5
Lines 480 490 +10
Branches 116 118 +2
===========================================
+ Hits 306 404 +98
+ Misses 154 61 -93
- Partials 20 25 +5 ☔ View full report in Codecov by Sentry. |
Great @val-ismaili ! Now just need to run |
@brynpickering yeah i was running pre-commit but still getting the issue. unsure what im missing...
|
Once you run it, you should have 4 files with changes that you can then commit - right? |
i did yes, which is what the previous commit was here (8830df3). now when i run
|
Aha, you probably still have an |
I've pushed an update after runnign it on my local repo |
Yeah that was it - got it working now. Thanks for bearing with me on all this. Turns out writing the tests weren't too bad, it was the other stuff i was banging my head against 😅 Also updated |
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.
Nice, it's getting there!
Now that you have the hang of the tests, there's just some improvements to make to those that are there and one more I think is worth adding to match your code changes. Hopefully they won't be too difficult to implement.
I've added a test as per your comments for testing default crs is still saved when user enters a custom crs. And then also adding to the existing test. I've put in fixtures where I thought made sense. |
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.
Looking good!
I added a check for file existence when changing the file extension. I've also updated the config now that you've added these tests and raised project coverage from 60% to 84% (@mfitz won't be happy that it is through an integration test rather than unit tests, but we'll let that slide ;) ). |
I've add the option to write to geopackage or geoparquet. default is changed from
.geojson
to.gpkg
the new cli command looks like:
osmox run configs/example.json example/isle-of-man-latest.osm.pbf isle-of-man -f geopackage -crs epsg:27700 -l
To allow write to geoparquet I had to
pip install pyarrow
. What's the best way of updating the environment for the repo?