idmtools.utils.filter_simulations module

Filtering utility.

Copyright 2021, Bill & Melinda Gates Foundation. All rights reserved.

class idmtools.utils.filter_simulations.FilterItem

Bases: object

FilterItem provides a utility to filter items on a platform.

static filter_item(platform: IPlatform, item: IEntity, skip_sims=None, max_simulations: Optional[int] = None, **kwargs)

Filter simulations from Experiment or Suite, by default it filter status with Succeeded.

If user wants to filter by other status, it also can be done, for example:

filter_item(platform, exp, status=EntityStatus.FAILED

If user wants to filter by tags, it also can be done, for example:

filter_item(platform, exp, tags={'Run_Number': '2'})
Parameters:
  • platform – Platform item

  • item – Item to filter

  • skip_sims – list of sim ids

  • max_simulations – Total simulations

  • kwargs – extra filters

Returns: list of simulation ids

classmethod filter_item_by_id(platform: IPlatform, item_id: UUID, item_type: ItemType = ItemType.EXPERIMENT, skip_sims=None, max_simulations: Optional[int] = None, **kwargs)

Filter simulations from Experiment or Suite.

Parameters:
  • platform – COMPSPlatform

  • item_id – Experiment/Suite id

  • item_type – Experiment or Suite

  • skip_sims – list of sim ids

  • max_simulations – #sims to be returned

  • kwargs – extra filters

Returns: list of simulation ids