Chris Mutel committed 5c7c8dd

Updated for new Brightway database and method managing

Comments (0)

Files changed (2)

 # -*- coding: utf-8 -*
 from __future__ import division
 from brightway2 import config as base_config
-from brightway2 import meta, methods, mapping
+from brightway2 import databases, methods, mapping
 from brightway2.proxies import OneDimensionalArrayProxy, \
 from brightway2.utils import MAX_INT_32
     def get_databases(self):
         """Get list of databases for functional unit"""
-        return set.union(*[set(meta[key[0]]["depends"] + [key[0]]) for key \
+        return set.union(*[set(databases[key[0]]["depends"] + [key[0]]) for key \
             in self.demand])
     def load_databases(self):
     def score(self):
         assert hasattr(self, "characterized_inventory"), "Must do LCIA first"
         return float(self.characterized_inventory.sum())
+    def reverse_dict(self):
+        """Construct reverse dicts from row and col indices to processes"""
+        rev_mapping = dict([(v, k) for k, v in mapping.iteritems()])
+        rev_tech = dict([(v, rev_mapping[k]) for k, v in \
+            self.technosphere_dict.iteritems()])
+        rev_bio = dict([(v, rev_mapping[k]) for k, v in \
+            self.biosphere_dict.iteritems()])
+        return rev_tech, rev_bio
   author="Chris Mutel",
+  url="",
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.