How to use the bw2io.data.add_ecoinvent_35_biosphere_flows 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 / widgets / biosphere_update.py View on Github external
self.thread.exit(outcome)
        self.setMaximum(1)
        self.setValue(1)
        signals.database_changed.emit(bw.config.biosphere)
        signals.databases_changed.emit()

    @Slot(int)
    def update_progress(self, current: int):
        self.setValue(current)


class UpdateBiosphereThread(QtCore.QThread):
    PATCHES = (
        add_ecoinvent_33_biosphere_flows,
        add_ecoinvent_34_biosphere_flows,
        add_ecoinvent_35_biosphere_flows,
        add_ecoinvent_36_biosphere_flows,
    )
    progress = Signal(int)

    def __init__(self, parent=None):
        super().__init__(parent)
        self.total_patches = len(self.PATCHES)

    def run(self):
        try:
            for i, patch in enumerate(self.PATCHES):
                self.progress.emit(i)
                patch()
        except ValidityError as e:
            print("Could not patch biosphere: {}".format(str(e)))
            self.exit(1)