bw2io.importers.base
#
Module Contents#
Classes#
Base class for format-specific importers. |
- class bw2io.importers.base.ImportBase(*args, **kwargs)[source]#
Bases:
object
Base class for format-specific importers.
Defines workflow for applying strategies.
- property unlinked[source]#
Iterate through unique unlinked exchanges.
Uniqueness is determined by
activity_hash
.
- apply_strategies(strategies=None, verbose=True)[source]#
Apply a list of strategies.
Uses the default list
self.strategies
ifstrategies
isNone
.- Parameters
*strategies* (list, optional) β List of strategies to apply. Defaults to
self.strategies
.- Returns
Nothings, but modifies
self.data
, and adds each strategy toself.applied_strategies
.
- apply_strategy(strategy, verbose=True)[source]#
Apply
strategy
transform toself.data
.Adds strategy name to
self.applied_strategies
. IfStrategyError
is raised, print error message, but donβt raise error.Note
Strategies should not partially modify data before raising
StrategyError
.- Parameters
*strategy* (callable) β
- Returns
Nothing, but modifies
self.data
, and strategy toself.applied_strategies
.