Process Refs

antelope.refs.process_ref module

exception antelope.refs.process_ref.MultipleReferences

Bases: Exception

exception antelope.refs.process_ref.NoReference

Bases: Exception

Indicates that a process has no reference flow matching a given specification

class antelope.refs.process_ref.ProcessRef(external_ref, query, **kwargs)

Bases: EntityRef

Processes can lookup:

signature_fields()
property reference_entity

Must have a .unit property that returns a string, should have .entity_type property that returns ‘quantity’ :return:

property name
property default_rx

The ‘primary’ reference exchange of a process CatalogRef. This is an external_ref for a flow. This can be set by a user for convenience for multi-reference processes.

(- which is req. unique among references) :return:

reference(flow=None)

This used to fallback to regular exchanges; no longer. :param flow: :return:

references()
exchanges(**kwargs)
exchange_values(flow, direction=None, termination=None, reference=None, **kwargs)

oooh kay… :param flow: :param direction: :param termination: :param reference: :param kwargs: :return:

inventory(ref_flow=None, **kwargs)
exchange_relation(ref_flow, exch_flow, direction, termination=None, **kwargs)
fg_lcia(lcia_qty, ref_flow=None, **kwargs)
reference_value(flow=None)

Attempts to return the un-allocated exchange value for the designated reference exchange :param flow: :return:

get_exchange(key)
property alloc_qty

This is hugely kludgely. What should be the expected behavior of a process ref asked to perform allocation? :return:

foreground(ref_flow=None, **kwargs)
consumers(ref_flow=None, **kwargs)
dependencies(ref_flow=None, **kwargs)
emissions(ref_flow=None, **kwargs)
cutoffs(ref_flow=None, **kwargs)
is_in_background(ref_flow=None, **kwargs)
ad(ref_flow=None, **kwargs)
bf(ref_flow=None, **kwargs)
lci(ref_flow=None, refresh=False, **kwargs)

Caches LCI results :param ref_flow: :param refresh: :param kwargs: :return:

unobserved_lci(observed, ref_flow=None, **kwargs)

Performs a sys_lci of the process’s unobserved exchanges. derived by excluding observed exchanges from the process’s inventory and passing the result to sys_lci. Note that terminations are ignored– if a process has an observed (e.g.) Electricity flow, all the process’s electricity exchanges are assumed to be accounted for by the observation. (flow.external_ref, direction) is the filter.

Problem with this implementation: if the exchanges do not contain termination info, then the resulting inclusion inventory will be non-operable in the background. Because it is a background method, it may be more appropriate to use the combined dependencies and emissions rather than inventory.

Parameters:
  • observed – iterable of exchanges or child flows, having a flow (with external_ref) and direction

  • ref_flow

  • kwargs

Returns:

contrib_lcia(quantity=None, ref_flow=None, **kwargs)
bg_lcia(lcia_qty, observed=None, ref_flow=None, **kwargs)
Parameters:
  • lcia_qty – should be a quantity ref (or qty), not an external ID

  • observed – see unobserved_lci

  • ref_flow

  • kwargs

Returns:

deep_lcia(lcia_qty, ref_flow=None, detailed=False, **kwargs)

Perform LCIA inside the black box, returning an LCIA result whose components are background processes. :param lcia_qty: :param ref_flow: :param detailed: [False] default- report only summaries. [True] - include full details for each component. This

can be very data intensive. (approx

Parameters:

kwargs

Returns: