-
-
Notifications
You must be signed in to change notification settings - Fork 65
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
Simplify handler interface #128
Comments
Looks good to me, just a few comments:
And I'm thinking, that we could extend the list of decorators to include:
And probably, I'd made |
That's some good comments. Thoughts on that:
|
In the spirit of this, +1 to the existing behavior of using callbacks as being not-Pythonic. One very visible issue is that, as it stands now, the library can't really be used from a REPL/IPython/Jupyter notebook... Which is a real bummer for a couple of reasons:
Yes, technically you can write your handler class in a Jupyter notebook and then use it, but it's really atypical... Being able to use the library procedurally is important. Ultimately, part of a goal of any Python library/binding for a library written in C/C++ is not just being able to access the functionality provided by the library but also to be able to utilize the convenience/ease of Python to do that. (The reason Python has taken off as a major language in data science and other fields is definitely not because Python itself is fast -- it isn't. But it's comparatively easy to write native code [especially with things like Cython], compile it, and run complex stuff from Python at near-native speed (aka nearly the speed of pure C/C++).... ) Given that OSM data can be utilized heavily in data science, analysis, GIS applications, etc, I think it's really important to take a step back and make sure that some clear use cases are defined. Opening an OSM PBF dump/extract in a Jupyter notebook and pulling data for analysis is one such use case. |
Went a bit of a different way. We have now:
This should simplify the code enough even without decorators. |
The current concepts of handler classes mimics closely the C++ interface of osmium. There is no need to do this. pyosmium should get a simpler interface that is more in the spirit of python. I'm thinking about something along the way:
The text was updated successfully, but these errors were encountered: