Skip to content

Commit

Permalink
Align wrt pathways
Browse files Browse the repository at this point in the history
  • Loading branch information
romainsacchi authored and romainsacchi committed Aug 26, 2024
1 parent 9caf94e commit 6906afd
Show file tree
Hide file tree
Showing 7 changed files with 173 additions and 31 deletions.
2 changes: 1 addition & 1 deletion premise/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"clear_inventory_cache",
"get_regions_definition",
)
__version__ = (2, 1, 1, "dev9")
__version__ = (2, 1, 1)


from premise.new_database import NewDatabase
Expand Down
4 changes: 3 additions & 1 deletion premise/data/consequential/leadtimes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ petrol, synthetic, from coal, with CCS: 3
diesel, synthetic, from electrolysis: 3
diesel, synthetic, from coal: 3
diesel, synthetic, from coal, with CCS: 3
hydrogen, from electrolysis: 3
hydrogen, from electrolysis, PEM: 3
hydrogen, from electrolysis, AEC: 3
hydrogen, from electrolysis, SOEC: 3
hydrogen, from biomass: 3
hydrogen, from biomass, with CCS: 3
hydrogen, from coal: 3
Expand Down
3 changes: 3 additions & 0 deletions premise/data/consequential/lifetimes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ methanol, from grass: 35
methanol, from grass, with CCS: 35
natural gas: 35
biomethane: 35
hydrogen, from electrolysis, PEM: 30
hydrogen, from electrolysis, AEC: 30
hydrogen, from electrolysis, SOEC: 30
petrol, synthetic, from electrolysis: 35
petrol, synthetic, from coal: 35
petrol, synthetic, from coal, with CCS: 35
Expand Down
186 changes: 160 additions & 26 deletions premise/data/utils/export/simapro_categories.csv

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions premise/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,8 @@ def generate_scenario_factor_file(
# remove the column `original`
df = df.drop(columns=["original"])



# fetch a list of activities not present in original_db
list_original_acts = get_list_unique_acts([{"database": origin_db}])

Expand Down Expand Up @@ -888,6 +890,8 @@ def generate_superstructure_db(
# should not be any, but just in case
before = len(df)
df = df.drop_duplicates()
# detect duplicate based on `from key` and `to key`
df = df.drop_duplicates(subset=["from key", "to key"])
after = len(df)
print(f"Dropped {before - after} duplicate(s).")

Expand Down
2 changes: 0 additions & 2 deletions premise/transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,8 +630,6 @@ def adjust_battery_size(self, ds):
# detect size in name
size = [s for s in self.battery_size["truck"] if s in ds["name"]][0]

print(self.battery_size["truck"][size])

if self.year <= min(self.battery_size["truck"][size].keys()):
mean_battery_size = self.battery_size["truck"][size][
min(self.battery_size["truck"][size].keys())
Expand Down
3 changes: 2 additions & 1 deletion tests/test_process_ei310_cutoff_datapackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ def test_brightway():
ndb.write_datapackage(name="datapackage")

# check existence of files
assert os.path.exists("datapackage.zip")
cwd = os.getcwd()
assert os.path.exists(f"{cwd}/export/datapackage/datapackage.zip")

# destroy all objects
del ndb
Expand Down

0 comments on commit 6906afd

Please sign in to comment.