Code Monkey home page Code Monkey logo

Comments (5)

martinfleis avatar martinfleis commented on June 2, 2024

I think it should behave the same as binary predicates do when you don't specify align, which means align and warn.

from geopandas.

martinfleis avatar martinfleis commented on June 2, 2024

This is the current situation.

function param solution version
concave_hull ratio, allow_holes ignore index 0.14
delaunay_triangles tolerance, only_edges ignore index 0.14
offset_curve distance, quad_seqs... ignore index 0.14
remove_repeated_points tolerance ignore index 0.14
segmentize max_segment_length ignore index 0.14
force_3d z ignore index main
buffer distance... raise for distance, ignore for others 0.5
simplify tolerance, preserve_topology ignore index shapely 2
interpolate distance raise 0.5

So we don't align in any case. We either raise or ignore the index. Ignoring the index does not feel as a correct behaviour because users may expect alignment, which silently does not happen resulting in misaligned args. I think that we have two options:

  1. raise when the index is not equal like we do in buffer (for distance). This does not require any additional keywords and users can align themselves if needed. We can include a note on how in the error message.
  2. add align keyword everywhere and mirror the behaviour of binary geometry ops.

Given most of the affected methods are from 0.14, I think we can just do the hard breaking change here, whatever we decide. I am leaning towards the first option as it is easier but if we want to do full consistency, the second is probably better.

I would also hold with merging of shapely parity PRs affected by this so I can update them based on the selected behaviour.

from geopandas.

m-richards avatar m-richards commented on June 2, 2024

I'm leaning towards option 1, because we should be able to give a nice instructive error for this (here's how to align, and here's how to convert to an array if you didn't want to align). Personally feel adding an align keyword (and remembering to add an align keyword for any future methods) doesn't provide enough convenience to warrant extra complexity (even if it's not super complex).

From the perspective of a breaking change, I also like that we go from ignore -> raise, as then users need to deal with it in cases where it matters, vs ignore -> align (or align and and warn) by default which could be missed or ignored (appreciate not everyone would agree with that though)

from geopandas.

jorisvandenbossche avatar jorisvandenbossche commented on June 2, 2024

Yes, also agreed to go with option 1, and to do this as a breaking change. Adding an align keyword everywhere seems a lot of bloat for a corner case that users can solve themselves (either aligning manually first, or passing the .values), and in addition can also be ambiguous if there are multiple keywords where the value could be aligned or not.

from geopandas.

martinfleis avatar martinfleis commented on June 2, 2024

Cool. I'll shoot a PR for that in coming days and update relevant PRs accordingly.

from geopandas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.