Giter Club home page Giter Club logo

scenario-example-bread's People

Contributors

pan6ora avatar romainsacchi avatar

Stargazers

 avatar

scenario-example-bread's Issues

Error message, when creating fuel supply chains

Hi!
After successfully running the code that adds an external scenario (bread scenario), I applied the ndb.update_all() function.

Then, after a while, I got an error message when the code was updating the fuel supply chains (I copied and pasted below what I got). I would like to know how to solve it so that I can write the database with the bread scenario. Thanks a lot!

.....
////////////////////////////// FUELS ///////////////////////////////
Generate region-specific direct air capture processes.
Generate region-specific hydrogen production pathways.

IndexError Traceback (most recent call last)
Input In [6], in
----> 1 ndb.update_all()

File ~\Miniconda3\envs\bw2\lib\site-packages\premise\ecoinvent_modification.py:983, in NewDatabase.update_all(self)
981 self.update_cement()
982 self.update_steel()
--> 983 self.update_fuels()
984 self.update_external_scenario()

File ~\Miniconda3\envs\bw2\lib\site-packages\premise\ecoinvent_modification.py:781, in NewDatabase.update_fuels(self)
771 if "exclude" not in scenario or "update_fuels" not in scenario["exclude"]:
773 fuels = Fuels(
774 database=scenario["database"],
775 iam_data=scenario["iam data"],
(...)
779 version=self.version,
780 )
--> 781 fuels.generate_fuel_markets()
782 scenario["database"] = fuels.database

File ~\Miniconda3\envs\bw2\lib\site-packages\premise\fuels.py:1507, in Fuels.generate_fuel_markets(self)
1503 """Create new fuel supply chains
1504 and update existing fuel markets"""
1506 # Create new fuel supply chains
-> 1507 self.generate_fuel_supply_chains()
1509 print("Generate new fuel markets.")
1511 # we start by creating region-specific "diesel, burned in" markets

File ~\Miniconda3\envs\bw2\lib\site-packages\premise\fuels.py:1488, in Fuels.generate_fuel_supply_chains(self)
1486 # hydrogen
1487 print("Generate region-specific hydrogen production pathways.")
-> 1488 self.generate_hydrogen_activities()
1490 # biogas
1491 print("Generate region-specific biogas and syngas supply chains.")

File ~\Miniconda3\envs\bw2\lib\site-packages\premise\fuels.py:311, in Fuels.generate_hydrogen_activities(self)
307 hydrogen_sources = fetch_mapping(HYDROGEN_SOURCES)
309 for hydrogen_type, hydrogen_activity in hydrogen_sources.items():
--> 311 new_ds = self.fetch_proxies(
312 name=hydrogen_activity["name"],
313 ref_prod="Hydrogen",
314 production_variable=hydrogen_activity["var"],
315 relink=True,
316 )
318 for region, dataset in new_ds.items():
319
320 # we adjust the electrolysis efficiency
321 if hydrogen_type == "from electrolysis":

File ~\Miniconda3\envs\bw2\lib\site-packages\premise\transformation.py:381, in BaseTransformation.fetch_proxies(self, name, ref_prod, production_variable, relink, regions)
362 def fetch_proxies(
363 self, name, ref_prod, production_variable=None, relink=True, regions=None
364 ) -> Dict[str, dict]:
365 """
366 Fetch dataset proxies, given a dataset name and reference product.
367 Store a copy for each IAM region.
(...)
378 :return: dictionary with IAM regions as keys, proxy datasets as values.
379 """
--> 381 d_iam_to_eco = self.region_to_proxy_dataset_mapping(
382 name=name, ref_prod=ref_prod, regions=regions
383 )
385 d_act = {}
387 ds_name, ds_ref_prod = [None, None]

File ~\Miniconda3\envs\bw2\lib\site-packages\premise\transformation.py:358, in BaseTransformation.region_to_proxy_dataset_mapping(self, name, ref_prod, regions)
356 fallback_loc = "GLO"
357 else:
--> 358 fallback_loc = list(d_map.values())[0]
360 return {region: d_map.get(region, fallback_loc) for region in regions}

IndexError: list index out of range

โ€‹

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.