Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
romainsacchi committed Aug 28, 2024
2 parents 43c8fd8 + 1c2814c commit 8ef28f0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
18 changes: 15 additions & 3 deletions premise/inventory_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,11 @@ def load_inventory(self) -> bw2io.ExcelImporter:
def prepare_inventory(self) -> None:
if self.version_in != self.version_out:
# if version_out is 3.9 or 3.10, migrate towards 3.8 first, then 3.9 or 3.10
if self.version_out in ["3.9", "3.9.1", "3.10"] and self.version_in in ["3.5", "3.6", "3.7"]:
if self.version_out in ["3.9", "3.9.1", "3.10"] and self.version_in in [
"3.5",
"3.6",
"3.7",
]:
print("Migrating to 3.8 first")
self.import_db.migrate(
f"migration_{self.version_in.replace('.', '')}_38"
Expand Down Expand Up @@ -947,7 +951,11 @@ def load_inventory(self):
def prepare_inventory(self):
# if version_out is 3.9, migrate towards 3.8 first, then 3.9
if self.version_out in ["3.9", "3.9.1", "3.10"]:
if self.version_out in ["3.9", "3.9.1", "3.10"] and self.version_in in ["3.5", "3.6", "3.7"]:
if self.version_out in ["3.9", "3.9.1", "3.10"] and self.version_in in [
"3.5",
"3.6",
"3.7",
]:
print("Migrating to 3.8 first")
self.import_db.migrate(
f"migration_{self.version_in.replace('.', '')}_38"
Expand Down Expand Up @@ -1023,7 +1031,11 @@ def load_inventory(self):
def prepare_inventory(self):
if str(self.version_in) != self.version_out:
# if version_out is 3.9 or 3.10, migrate towards 3.8 first, then 3.9/3.10
if self.version_out in ["3.9", "3.9.1", "3.10"] and self.version_in in ["3.5", "3.6", "3.7"]:
if self.version_out in ["3.9", "3.9.1", "3.10"] and self.version_in in [
"3.5",
"3.6",
"3.7",
]:
print("Migrating to 3.8 first")
self.import_db.migrate(
f"migration_{self.version_in.replace('.', '')}_38"
Expand Down
1 change: 0 additions & 1 deletion premise/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ def check_matrix_squareness(self):
f"WARNING: matrix is not square: {len(list(set(activities)))} activities, {len(list(set(products)))} products."
)


def check_uncertainty(self):
MANDATORY_UNCERTAINTY_FIELDS = {
2: {"loc", "scale"},
Expand Down

0 comments on commit 8ef28f0

Please sign in to comment.