dopo.methods

Module for Managing Brightway2 Methods

Provides functionality to filter and manage LCA methods in Brightway2. The MethodFinder class enables users to search for methods based on criteria and manage them efficiently.

Classes

MethodFinder

A class to find, filter, and store Brightway methods based on specific criteria.

Module Contents

class dopo.methods.MethodFinder[source]

A class to find, filter, and store Brightway methods based on specific criteria.

This class provides functionalities to search for methods within the Brightway2 framework, apply inclusion and exclusion criteria, and store the filtered methods in a dictionary for easy access and management. It allows users to generate a custom dictionary of method objects that match certain criteria.

Attributes

methodslist

A list of method objects that match the specified criteria.

Methods

find_and_create_method(criteria, exclude=None, custom_key=None)

Finds methods based on provided criteria, filters them, and stores the selected method in the dictionary with a unique or custom key.

Initializes the MethodFinder class with an empty dictionary for storing methods and a counter for generating unique method keys.

add_methods(methods: list) None[source]

Add a list of method objects to the self.methods attribute.

Parameters:

methods (list) – A list of method objects to add.

Returns:

None

find_methods(criteria: list, exclude: list = None) None[source]

Finds and filters methods based on the given criteria and optionally excludes methods based on exclusion criteria. The tuple representation of the selected method is then added to self.methods.

Parameters:
  • criteria (list) – A list of strings to search for in the method names.

  • exclude (list, optional) – A list of strings to exclude from the method names.

Returns:

None

methods = [][source]