Commits

Chris Mutel  committed 8753b22

Fix bugs in IA methods importing

  • Participants
  • Parent commits f7cd060

Comments (0)

Files changed (1)

File bw2data/io/import_ecospold.py

         log = get_logger(name)
         log.critical(u"Starting import of %s (from %s)" % (name, path))
         if os.path.isdir(path):
-            files = [os.path.join(path, filter(lambda x: x[-4:].lower(
-                ) == ".xml", os.listdir(path)))]
+            files = [os.path.join(path, y) for y in filter(
+                lambda x: x[-4:].lower() == ".xml", os.listdir(path))]
         else:
             files = [path]
 
                         exc, depends)
                 exc["technosphere"] = exc["input"][0] != "biosphere"
 
+            # Sort for consistent order to make import comparisons easier
+            ds["exchanges"].sort(key=lambda x: x["input"])
+
         data = dict([((name, int(o["code"])), o) for o in data])
 
         manager = Database(name)
 
             data.append(this)
 
-        # Sort for consistent order to make import comparisons easier
-        data.sort(key=lambda x: x["input"])
         return data