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

Coding style conventions/guide #101

Open
jni opened this issue Feb 10, 2019 · 1 comment
Open

Coding style conventions/guide #101

jni opened this issue Feb 10, 2019 · 1 comment

Comments

@jni
Copy link
Contributor

jni commented Feb 10, 2019

We had some discussions on #94 about coding style. @jakirkham suggested we open a specific issue to discuss them.

I have three specific things that I find "inelegant" (yes, I know, it's imprecise) as currently implemented in dask_image.

  1. fully specified imports, e.g. dask.array instead of da, numpy instead of np. Some of these abbreviations are very ingrained in the community and the full specification is surprising to read. (Not to mention annoying to write.)
  2. Code definitions in __init__.py. Again, this is unconventional. scikit-image doesn't use these and still gets a nice API generation from sphinx, so I don't think it's a major hurdle to get sphinx to behave well for a more conventional code structure.
  3. The import name with an underscore in it. ;)

I'll throw a bonus idea in here: we should rename input in all the ndimage functions. It was a bad choice from SciPy, and they're stuck with it, but I don't think dask-image should be bound by it.

Anyway, whatever is decided with the above points, it should probably be codified somewhere, and preferably it should reference the style guides for bigger projects, so that these aren't "just for dask-image" conventions.

@GenevieveBuckley
Copy link
Collaborator

To document our decision today, we will use image and label_image as names for arrays passed into dask-image functions.

This is a move away from strict adherence to the scipy API (we don't like using the name input for arrays passed into functions because input is also the name of a python built in command). Choosing image and label_image mirrors scikit-image's decision, and they've put a fair bit of thought into this subject already.

tkoyama010 added a commit to tkoyama010/dask-image that referenced this issue Nov 2, 2020
move code out of init.py, use standard import abbreviations, etc
tkoyama010 added a commit to tkoyama010/dask-image that referenced this issue Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants