Skip to content

Commit

Permalink
Better communication of scenario processing message
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-vdm committed Sep 11, 2024
1 parent a097eed commit cb7039b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions premise/new_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -926,11 +926,14 @@ def update(self, sectors: [str, list, None] = None) -> None:
}

if isinstance(sectors, str):
description = f"Processing scenarios for sector '{sectors}'"
sectors = [
sectors,
]

if sectors is None:
elif isinstance(sectors, list):
description = f"Processing scenarios for {len(sectors)} sectors"
elif sectors is None:
description = "Processing scenarios for all sectors"
sectors = [s for s in list(sector_update_methods.keys())]

assert isinstance(sectors, list), "sector_name should be a list of strings"
Expand All @@ -944,7 +947,7 @@ def update(self, sectors: [str, list, None] = None) -> None:
)

with tqdm(
total=len(self.scenarios), desc="Processing scenarios", ncols=70
total=len(self.scenarios), desc=description, ncols=70
) as pbar_outer:
for scenario in self.scenarios:
# add database to scenarios
Expand Down

0 comments on commit cb7039b

Please sign in to comment.