Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Features/#392 include powerplants #453

Merged
merged 26 commits into from
Nov 2, 2021
Merged

Conversation

IlkaCu
Copy link
Member

@IlkaCu IlkaCu commented Sep 24, 2021

Closes #392 by allocating and integrating conventional non CHP power plants into the power plants table.
Branch still needs to be tested for Germany on the CI branch

@IlkaCu
Copy link
Member Author

IlkaCu commented Sep 30, 2021

This feature got tested on the CI branch and the tasks were run successfully, but no data for carrier 'gas' and 'oil' git written to the database. This needs to be solved.

@IlkaCu IlkaCu marked this pull request as ready for review September 30, 2021 07:57
Copy link
Contributor

@ClaraBuettner ClaraBuettner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I run this branch in testmode and it failed:

[2021-09-30 13:54:25,452] {logging_mixin.py:120} INFO - WARNING: No data returned by statement: 
 
        SELECT bnetza_id, name, carrier, capacity, postcode, city,
        federal_state, c2035_capacity
        FROM supply.egon_nep_2021_conventional_powerplants
        WHERE carrier = 'oil'
        AND chp = 'Nein'
        AND c2035_chp = 'Nein'
        AND c2035_capacity > 0
        AND postcode != 'None';
[2021-09-30 13:54:26,083] {taskinstance.py:1150} ERROR - Cannot transform naive geometries.  Please set a crs on the object first.
Traceback (most recent call last):

I think this happens because there are no oil power plants in Schleswig-Holstein.

@IlkaCu
Copy link
Member Author

IlkaCu commented Oct 4, 2021

I added an if...else and print statement to avoid problems with empty data frames imported from our NEP tables.

@ClaraBuettner
Copy link
Contributor

There were some issues in the CHP extension, but after I merged the dev branch into this feature-branch it was running successful.

@ClaraBuettner
Copy link
Contributor

The task power_plants.allocate-conventional-non-chp-power-plants failed on the CI-branch:

Traceback (most recent call last):
  File "/home/egondata/git-repos/friday-evening-weekend-run/environment/lib/python3.8/site-packages/airflow/models/taskinstance.py", line 984, in _run_raw_task
    result = task_copy.execute(context=context)
  File "/home/egondata/git-repos/friday-evening-weekend-run/code/src/egon/data/datasets/__init__.py", line 195, in skip_task
    result = super(type(task), task).execute(*xs, **ks)
  File "/home/egondata/git-repos/friday-evening-weekend-run/environment/lib/python3.8/site-packages/airflow/operators/python_operator.py", line 113, in execute
    return_value = self.execute_callable()
  File "/home/egondata/git-repos/friday-evening-weekend-run/environment/lib/python3.8/site-packages/airflow/operators/python_operator.py", line 118, in execute_callable
    return self.python_callable(*self.op_args, **self.op_kwargs)
  File "/home/egondata/git-repos/friday-evening-weekend-run/code/src/egon/data/datasets/power_plants/__init__.py", line 618, in allocate_conventional_non_chp_power_plants
    mastr = select_no_chp_combustion_mastr(carrier)
  File "/home/egondata/git-repos/friday-evening-weekend-run/code/src/egon/data/datasets/power_plants/conventional.py", line 72, in select_no_chp_combustion_mastr
    mastr = db.select_geodataframe(
  File "/home/egondata/git-repos/friday-evening-weekend-run/code/src/egon/data/db.py", line 205, in select_geodataframe
    gdf = gpd.read_postgis(
  File "/home/egondata/git-repos/friday-evening-weekend-run/environment/lib/python3.8/site-packages/geopandas/geodataframe.py", line 1247, in to_crs
    geom = df.geometry.to_crs(crs=crs, epsg=epsg)
  File "/home/egondata/git-repos/friday-evening-weekend-run/environment/lib/python3.8/site-packages/geopandas/geoseries.py", line 1028, in to_crs
    self.values.to_crs(crs=crs, epsg=epsg), index=self.index, name=self.name
  File "/home/egondata/git-repos/friday-evening-weekend-run/environment/lib/python3.8/site-packages/geopandas/array.py", line 780, in to_crs
    raise ValueError(
ValueError: Cannot transform naive geometries.  Please set a crs on the object first.

The used table for non chp plants is filled in the CHP-data set, but this is not a dependency of the PowerPlant-Dataset. I think adding the dependency should solve the problem.

@IlkaCu IlkaCu merged commit 8281e35 into dev Nov 2, 2021
@IlkaCu IlkaCu deleted the features/#392-include-powerplants branch November 2, 2021 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include missing power plants
2 participants