bw2regional.pandarus
Module Contents
Functions
|
Return all geo- and topocollections for a file hash. |
|
Handle an intersection between one or more topographies and a single geocollection. |
Load output file from Pandarus job. |
|
|
|
|
Load Pandarus JSON output file. |
|
Add geocollection names to geo identifiers |
- bw2regional.pandarus.get_possible_collections(kwargs)[source]
Return all geo- and topocollections for a file hash.
Returns list of (collection name, collection type) tuples.
- bw2regional.pandarus.handle_topographical_intersection(metadata, data, first_collections, second_collections, filepath)[source]
Handle an intersection between one or more topographies and a single geocollection.
Each topography is associated with exactly one geocollection.
Each topography is not empty, i.e. we can use the topographical definitions to filter.
The procedure is: #. Check metadata validity, and make sure the topography ids are in the first column #. To split data into each topography #. Squash the topography to geocollections #. Create a new intersection for each geocollection/topography pair
We use Pandas DataFrames to do aggregation in a resource efficient way. We also write the processed Intersection arrays directly.
- bw2regional.pandarus.import_from_pandarus(fp)[source]
Load output file from Pandarus job.
This function will:
Load pandarus output file
Locate the appropriate geo- or topocollection
Check to make sure that SHA256 hashes and other metadata match
If
firstis a topocollection, make sure the appropriateTopologyexists, and squash the pandarus results to the linked geocollection(s).