Skip to content

slice by label #3

@delgadom

Description

@delgadom

Would be great to be able to slice a ComponentSet using a label along a dimension:

>>> runs.sel(rcp='rcp85')
[{'rcp': 'rcp85',
  'model': 'ACCESS1-0',
  'year': 2006,
  'func': <function __main__.<lambda>(x, thresh)>,
  'thresholds': 32},
 {'rcp': 'rcp85',
  'model': 'ACCESS1-0',
  'year': 2006,
  'func': <function __main__.<lambda>(x, thresh)>,
  'thresholds': 90},
 {'rcp': 'rcp85',
  'model': 'ACCESS1-0',
  'year': 2006,
  'func': <function __main__.<lambda>(x, thresh)>,
  'thresholds': 95},
 ...

This one really could return a new MultiComponentSet or ComponentSet
with the relevant Component domain limited to the provided label:

>>> runs.sel(rcp='rcp85')
<MultiComponentSet [{rcp: 1, model: 33, year: 96, func: 1, thresholds: 1},
{rcp: 1, model: 33, year: 96, func: 1, thresholds: 2}]>

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

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions