Skip to content

Modify API functions to accept arrays of inputs #34

Closed

Description

@horsburgh

For some of the API methods it makes sense to pass in an array rather than a single item. For example, getSamplingFeatures( ) will accept a SamplingFeatureID as an argument, but it should accept an array of SamplingFeatureIDs. Need to list which functions and arguments for which this makes sense.

Activity

  1. emiliom commented on Apr 11, 2016

    @emiliom
    Member

    @sreeder, this has been fully implemented, right? Let's close it.

  2. sreeder commented on Apr 11, 2016

    @sreeder
    Contributor

    @emiliom, I actually haven't implemented it yet. It is what I am working on now though.

  3. emiliom commented on Apr 11, 2016

    @emiliom
    Member

    Ok. For some reason I thought this was one of the many new capabilities now in your Dev1_0 branch.

  4. sreeder commented on Apr 13, 2016

    @sreeder
    Contributor

    @emiliom there has been a pull request created to address this issue. So if it is approved we can close this issue. Thanks

  5. emiliom commented on Apr 14, 2016

    @emiliom
    Member

    codes and ids are now expected to be a list, even if it only has a single element

    @sreeder, I haven't looked at your PR yet (hopefully late today). But I would say that it'd be more user friendly if either a scalar or a list can be passed as the argument. I think this is what @horsburgh was saying when he opened this issue. It should be fairly easy to implement this via a type check and turning scalar arguments into one-element lists. eg:

    if type(arg) != list:
        arg_lst = [arg]
    else:
        arg_lst = arg
  6. horsburgh commented on Apr 14, 2016

    @horsburgh
    MemberAuthor

    @emiliom - we discussed this yesterday and we arrived at just using a list. A list can have one item right?

  7. emiliom commented on Apr 14, 2016

    @emiliom
    Member

    A list can have one item right?

    Of course. But allowing for a scalar argument is a bit more user-friendly, that's all.

  8. horsburgh commented on Apr 14, 2016

    @horsburgh
    MemberAuthor

    I know - but there's an argument for consistency too.

    @sreeder - what's your call on how difficult it would be to do both? Should we do this now or should we make this a feature request for another version?

  9. emiliom commented on Apr 14, 2016

    @emiliom
    Member

    I know - but there's an argument for consistency too.

    Potato potatoh :)

    No worries, I won't belabor this. It was just an opinion, and not a strong one. It sounds like you two really prefer to stick with list arguments, so just go with that.

  10. added a commit that references this issue on Apr 22, 2016
  11. added this to the alpha Release 0.5 milestone on May 4, 2016
  12. self-assigned this
    on Jun 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions