Skip to content

Image() signature/doc improvements #3309

@fperez

Description

@fperez

The Image call has proved to be remarkably popular, but its signature is a bit awkward.

  • The most common usage I've seen from looking at many notebooks is to call it with a filename, but that's the third positional argument, forcing the vast majority of usage to be done with Image(filename=...), instead of simply Image(...).
  • The data argument accepts raw data, a url or a filename, but the signature only mentions urls and data.

I think we should change the signature and dosctring to take simply a url/filename as the first argument, which could be called pathspec or location. For backwards compatibility we can continue accepting the keywords filename and url, but both aren't necessary.

The much less common usage of calling it with raw data can be relegated to be called with data = ..., though it's worth considering for backwards compatibility auto-detection of raw data if the argument is say longer than 10kbytes or so.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions