Skip to content

Commit 7710770

Browse files
authored
Install correct version of biosphere when choosing most recent (#1234)
* Install correct version of biosphere when choosing most recent * Whitespace formatting
1 parent e24b3ec commit 7710770

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

activity_browser/bwutils/ecoinvent_biosphere_versions/ecospold2biosphereimporter.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,18 @@
1515
logger = logging.getLogger('ab_logs')
1616
log = ABHandler.setup_with_logger(logger, __name__)
1717

18+
1819
def create_default_biosphere3(version) -> None:
1920
"""Reimplementation of bw.create_default_biosphere3 to allow import from older biosphere versions."""
2021
# format version number to only Major/Minor
2122
version = version[:3]
2223

23-
if version == sort_semantic_versions(__ei_versions__)[0]:
24+
if version == sort_semantic_versions(__ei_versions__)[0][:3]:
25+
log.debug(f'Installing biosphere version >{version}<')
2426
# most recent version
2527
eb = Ecospold2BiosphereImporter()
2628
else:
29+
log.debug(f'Installing legacy biosphere version >{version}<')
2730
# not most recent version, import legacy biosphere from AB
2831
eb = ABEcospold2BiosphereImporter(version=version)
2932
eb.apply_strategies()

activity_browser/controllers/database.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ def update_biosphere(self) -> None:
8585
# warn user of consequences of updating
8686
warn_dialog = QtWidgets.QMessageBox.question(
8787
self.window, "Update biosphere3?",
88-
'Newer versions of the biosphere database may not\n'
89-
'always be compatible with older ecoinvent versions.\n'
90-
'\nUpdating the biosphere3 database cannot be undone!\n',
88+
'Newer versions of the biosphere database may not'
89+
'always be compatible with older ecoinvent versions.'
90+
'\nUpdating the biosphere3 database cannot be undone!',
9191
QtWidgets.QMessageBox.Ok | QtWidgets.QMessageBox.Abort,
9292
QtWidgets.QMessageBox.Abort
9393
)

0 commit comments

Comments
 (0)