How to use the bw2io.SingleOutputEcospold2Importer function in bw2io

To help you get started, we’ve selected a few bw2io examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LCA-ActivityBrowser / activity-browser / activity_browser / app / ui / wizards / db_import_wizard.py View on Github external
def run_import(self, import_dir):
        try:
            importer = SingleOutputEcospold2Importer(
                import_dir,
                self.db_name,
                extractor=ActivityBrowserExtractor,
                signal=import_signals.strategy_progress
            )
            importer.apply_strategies()
            importer.write_database(backend='activitybrowser')
            if not import_signals.cancel_sentinel:
                import_signals.finished.emit()
            else:
                self.delete_canceled_db()
        except ImportCanceledError:
            self.delete_canceled_db()
        except InvalidExchange:
            # Likely caused by new version of ecoinvent not finding required
            # biosphere flows.