Skip to content

quantity

IlcdQuantityImplementation

Bases: QuantityImplementation

compartments(quantity=None, flowable=None, **kwargs)

Return a list of compartment strings. Use quantity and flowable parameters to narrow the result set to those characterized for a specific quantity, those with a specific flowable, or both

Parameters:

Name Type Description Default
quantity
None
flowable
None

Returns:

Type Description

list of strings

factors(quantity, flowable=None, context=None, **kwargs)

Return characterization factors for the given quantity, subject to optional flowable and compartment filter constraints. This is ill-defined because the reference unit is not explicitly reported in current serialization for characterizations (it is implicit in the flow)-- but it can be added to a web service layer.

Parameters:

Name Type Description Default
quantity
required
flowable
None
context

not implemented

None

Returns:

Type Description

flowables(quantity=None, compartment=None, **kwargs)

Return a list of flowable strings. Use quantity and compartment parameters to narrow the result set to those characterized by a specific quantity, those exchanged with a specific compartment, or both

Parameters:

Name Type Description Default
quantity
None
compartment

filter by compartment not implemented

None

Returns:

Type Description

list of pairs: CAS number, name

get_canonical(quantity, **kwargs)

Retrieve a canonical quantity from a qdb

Parameters:

Name Type Description Default
quantity

external_id of quantity

required

Returns:

Type Description

quantity entity

quantity_relation(flowable, ref_quantity, query_quantity, context, locale='GLO', **kwargs)

Return a single number that converts the a unit of the reference quantity into the query quantity for the given flowable, compartment, and locale (default 'GLO'). If no locale is found, this would be a great place to run a spatial best-match algorithm.

Parameters:

Name Type Description Default
flowable
required
ref_quantity
required
query_quantity
required
context
required
locale
'GLO'

Returns:

Type Description