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

Dataset.image should be callable by element names #24

Open
iliiliiliili opened this issue Apr 7, 2020 · 3 comments
Open

Dataset.image should be callable by element names #24

iliiliiliili opened this issue Apr 7, 2020 · 3 comments
Assignees
Labels
behaviour Should this behaviour be changed?
Milestone

Comments

@iliiliiliili
Copy link
Collaborator

Dataset.image can be only called without parameters to convert all convertible data to image or with flags (True, False, True). We should also be able to call it with names: ds.image("image_2")

@iliiliiliili iliiliiliili added the behaviour Should this behaviour be changed? label Apr 7, 2020
@LukasHedegaard
Copy link
Owner

LukasHedegaard commented Apr 8, 2020

I agree with @iliiliiliili , that ds.image("image_2") is prettier than the flags.
The "positional" behaviour is currently used for multiple functions:

  • image
  • numpy
  • reshape
  • image_resize

We should decide between the "positional" behaviour (flags) or using keys.
To give an example, we're deciding between

ds = ds.named('label', 'image')
ds.reshape(False, new_shape)
ds.reshape(None, new_shape)

or

ds = ds.named('label', 'image')
ds.reshape(1, new_shape)
ds.reshape([1], new_shape)
ds.reshape('image', new_shape)
ds.reshape(['image'], new_shape)

What do you think, @clegaard ?

@clegaard
Copy link
Collaborator

clegaard commented Apr 9, 2020

I strongly favor option 2 since it is more readable in my opinion.

@LukasHedegaard
Copy link
Owner

It seems we're in agreement. I'll include the fix alongside the new image transformations after Easter.

@LukasHedegaard LukasHedegaard self-assigned this Apr 9, 2020
@LukasHedegaard LukasHedegaard added this to the 0.1.0 milestone Apr 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
behaviour Should this behaviour be changed?
Projects
None yet
Development

No branches or pull requests

3 participants