-
Notifications
You must be signed in to change notification settings - Fork 16
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
Move from TravelTimeMatrixComputer
etc. classes to TravelTimeMatrix
inheriting from pandas.DataFrame
/geopandas.GeoDataFrame
#337
Comments
Hm, not sure - it's simple code that people can vopy-and-paste almost verbatim, but it would require more diligence and probably maintenance if we add this to our code. On a similar note: I thought whether it would be smart to replace the '...Computer' classes with just 'TravelTimeMatrix', 'DetailedItineraries', and make them inherit from pandas.DataFrame/geopandas.GeoDataFrame, i.e., emphasise the output rather than the tool. Then we could also add all kind of (transparent) __-functions for typecasting and arithmetic operations (including child-class wrappesr of to_file() and explore() that handle the column type conversion before calling it's parent (That would be very pythonic, but a breaking change - which we could introduce now still, but which will be difficult later on. Of course we should add a thin wrapper named like the old 'Computer' class that raises a DeprecationWarning) |
Sorry for the typos, writing on my phone |
I actually really like the idea of simplifying the names and for using inheritance; would it be a significant (potentially worth it) departure from r5r? |
I wouldn't think so - R is function-oriented, while Python is an object-oriented language. This difference is reflected in the current differences, already, the change would not be significant, really |
I'm all for it. Do we need a 3rd? @HTenkanen? |
TravelTimeMatrixComputer
etc. classes to TravelTimeMatrix
inheriting from pandas.DataFrame
/geopandas.GeoDataFrame
Since this is a breaking namespace change I suggest this should probably be a target for v0.2 since this technically falls under a MAJOR change according to semantic versioning, but we don't have a MAJOR increment yet until we're at 1.0 |
Absolutely. We should do this soon, though, precisely because it is a breaking change (even though I’d propose wrappers that raise a |
Am in favour of this change |
I'm also supporting this change to shorter names 👍🏻 |
For consideration, an alternative way to extend without inheritance: |
This looks enticing! Have to take a closer look :) |
Having played around with it now I'm not sure it fits our model - it just adds separate methods to the namespace under a sub-space GeoPandas just extends the actual class which you can do with some additional namespace stuff. |
We have the code as written in the documentation, so let's perhaps make a helper function that does as follows:
Something like
r5py.utils.details_to_text(df)
or even passing an argument.The text was updated successfully, but these errors were encountered: