Skip to content
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

Homogenize arguments: inplace default of ops (reproject, crop) and georeferenced args (ref, dst_ref, etc...) #432

Closed
rhugonnet opened this issue Jan 16, 2024 · 3 comments
Assignees

Comments

@rhugonnet
Copy link
Contributor

Two problems linked to the default arguments of our functions:

  1. It's a bit un-intuitive that some operations would be inplace (crop) and others not (reproject).

We should probably do the same done by NumPy, Xarray and Pandas: never do inplace, and leave to the user to do it themselves by doing:

raster = raster.crop(mycropgeom)

If they want to.

  1. Arguments that do the same thing have different names in different functions.

For instance the "match-reference" argument: dst_ref, ref, etc... Same for many other arguments of functions of Raster and Vector (dst_shape, size, rst_shape, etc).

The sooner we homogenize the API, the better, otherwise it will be a hard change for users or would have to stay inconsistent for a long time! And doing it before mirroring the API in the Xarray accessor #383 would be great! 😃
So, I think is a top priority we should take care off soon! Was already listed but also a bit lost in the long list here: #361.

Maybe we should start a Google Docs to converge towards the arguments names that are the most intuitive to use everywhere?
What do you think @adehecq @atedstone @erikmannerfelt?

@adehecq
Copy link
Member

adehecq commented Jan 17, 2024

Overall I agree with both suggestions.
We can put this in a Google Doc, but ultimately we should maybe summarize this in a Wiki page, so we remember what was decided?

@atedstone
Copy link
Member

I also agree with both suggestions. I would prefer a wiki page over a Google Doc, but we can also simply add these information to CONTRIBUTING.md so that everything important about development is in one place?

@rhugonnet
Copy link
Contributor Author

Closed by #440, #445 and #449

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

3 participants