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

slice by label #3

Open
delgadom opened this issue Nov 30, 2018 · 0 comments
Open

slice by label #3

delgadom opened this issue Nov 30, 2018 · 0 comments

Comments

@delgadom
Copy link
Member

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}]>
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

1 participant