Module trase.tools.pcs.supply_chains.flows.retrieve
Functions
def get_flow_ids(ref_id, cur=None)-
Returns a list of flow_ids with specific ref_id.
ref_id – 'refs.id' in database
Keyword arguments: cur – database cursor object
def get_flow_ids_by_year(ref_id, year, cur=None)-
Returns a list of flow_ids with specific ref_id.
ref_id – 'refs.id' in database year – int Keyword arguments: cur – database cursor object
def get_flow_ids_with_node_and_position(ref_id, node_ids, position, year=None, cur=None)def get_flow_path(flow_id, cur=None)def get_flow_raw_vols(ref_id, position=None, cur=None)-
Returns flow_id, node_ids, years and raw_vols of flows with specific ref_id, based on a position in the flow_path
ref_id – 'refs.id' in database
Keyword arguments: position – integer of position in flow_path to get raw_vol from cur – database cursor object
def get_flow_year(flow_id, cur=None)def get_flows_data(flow_ids, year=None, cur=None)-
Return all data for list of flow_ids.
def get_limited_flow_ids(ref_id, limit=10, cur=None)-
Returns a list of X flow_ids with specific ref_id.
ref_id – 'refs.id' in database limit – number of ids returned
Keyword arguments: cur – database cursor object