-
Notifications
You must be signed in to change notification settings - Fork 27
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
geopandas-centric api #135
Comments
Yeah, this is tricky... I don't mind functions having multiple inputs using something like But, output type should be consistent imho... what about an " |
Yes please. It feels really weird when teaching pointpats that it, out of nowhere, expects arrays. The same applies to mgwr and spreg. I don't like the Fully agree with @ljwolf that the output should be consistent, so I don't really understand the proposal there, which makes it controllable but inconsistent (dependent on the input type). Another question is whether we want to return Point or GeoSeries, where I tend to prefer the former. |
😅 I meant "output type should be consistent with input type"... I think if we have a function that accepts one of many possible input types, constructs a new object, and returns it, that output type should match the input type. I think it's generally ok to have options that return the output type of a function, hence making the output type "inconsistent" across runs. In numpy/scipy code, this is often a Hence, I thought Maybe I have just been using R too much... |
I think this is an important discussion, that perhaps should move to lib so that we ensure consistency across packages - if that makes sense? That would help with the surprises @martinfleis hits in pointpats - those surprises reflect the history of the packages - much of the early pysal packages were born pre pandas/geopandas, so it was numpy/numeric centric. I'm also old enough to remember debates about whether things that we take for granted today (pandas, matplotlib, geopandas) where going to become standards or not. So the philosophy has been conservative (which is probably an understatement when it comes to changing apis ;-.> ) |
i find the
the Point is probably more sensible (though the first thing im likely to do is wrap it in a geoseries and explore.. :) ) |
@ljwolf can you think of any example of a reduction (like
I am not sure where this comes from but given this is not a ufunc I don't see this an issue at all. Or to be more precise, I don't see the reason why input and output types shall be in sync for stuff like centrography. If I ignore what happens in R, I don't see a precedent, though that may just be my ignorance. I think we should pick this discussion during the next PySAL dev call, to be more efficient. |
I don't think it's that foreign, and we do something similar already in pointpats.geometry. But, fine to chat about this at the developer meeting. I would certainly like to avoid duplicating methods with
I think it makes sense, if provided shapely-based geometries, to emit shapely-based geometries, especially if the change is motivated by, as @knaaptime puts it:
|
pointpats predates geopandas and was originally designed around (n,2) arrays of coordinates. It hasnt been updated much over time like the rest of the pysal stack, but today it's much more common to work in geodataframes rather than numpy arrays (even though you can reformat into the structure pointpats expects fairly easily). It might be nice to have something that consumes geodataframes/series and outputs the same.
e.g. instead of (in addition to?) the current
weighted_mean_center
which takes and returns arrays, i end up using something likewould that be of general use? If so,
_from_gdf
set of functions or something?The text was updated successfully, but these errors were encountered: