euromod.container

Below are listed the main public classes of the euromod.container module.

Classes

Container

This class is a container for objects that allow for indexing and representation in multiple ways:

Function

filter(container, switches)

param container:

Elements that need to be filtered.

class euromod.container.Container(idDict=False)
This class is a container for objects that allow for indexing and representation in multiple ways:
- via keys that are the name of the objects or,
- via integer indexing as in a list.

Overview

Methods

find(key, pattern, return_children, case_insentive)

Find objects that match pattern.

items()

Get items of the Container.

keys()

Get keys of the Container.

values()

Get values of the Container.

Methods

find(key, pattern, return_children=False, case_insentive=True)

Find objects that match pattern.

Parameters:
  • key (str) – Name of the attribute or the attribute of a child element that you want to look for One can search child elements by using the dot-notation. E.g.: mod[“BE”][“BE_2023”].policies.find(“functions.name”,”BenCalc”)

  • pattern (str) – pattern that you want to match.

  • return_children (bool, optional) – When True, the return type will be a Container containing elements of the type for which the find method was used When False, the return type will be a Container of the elements of the deepest level specified by the pattern key-word. E.g.: mod[“BE”][“BE_2023”].policies.find(“function) The default is False.

  • case_insentive (bool, optional) – DESCRIPTION. The default is True.

Returns:

An object that matches the pattern.

Return type:

Container

items()

Get items of the Container.

Returns:

Object items.

Return type:

Container.items

keys()

Get keys of the Container.

Returns:

Names of the attribute or the attribute of a child element.

Return type:

Container.keys

values()

Get values of the Container.

Returns:

Value of the object attribute.

Return type:

Container.values

Functions

euromod.container.filter(container, switches)
Parameters:
  • container (Container) – Elements that need to be filtered.

  • switches (Dictionary[str,bool]) – switches that need to be applied to the container.

Returns:

ret – Filtered Container.

Return type:

Container