Skip to content

Instantly share code, notes, and snippets.

@nesnoj
nesnoj / regions.csv
Last active January 3, 2022 08:30
simBEV scenario missing EVs 1
region_id RegioStaR7 bev_mini bev_medium bev_luxury phev_mini phev_medium phev_luxury
71 SR_Metro 1690 3844 1235 1047 2382 765
72 SR_Gross 1750 3676 1045 1084 2278 647
73 SR_Mitte 3548 7776 2421 2197 4818 1499
74 SR_Klein 880 1958 574 545 1213 355
75 LR_Zentr 816 1760 511 506 1090 317
76 LR_Mitte 2050 4625 1331 1269 2866 824
77 LR_Klein 2250 5230 1487 1394 3241 921
@nesnoj
nesnoj / edges.csv
Created November 16, 2021 10:22 — forked from gplssm/edges.csv
Test of Python skills with an example of graph analysis
node1 node2
Source 1
2 3
1 2
3 10
10 Target
1 4
4 5
5 Target
1 6
@nesnoj
nesnoj / write_db_table_comments_to_jsons.py
Last active September 23, 2021 14:15
Read all table comments from a database and write to json files
#
# Read all table comments from a database and write to json files
# * Tables without comment are skipped
# * Output format: <schema>.<table>.json
#
import json
import os
from sqlalchemy import create_engine, inspect, MetaData, Table
@nesnoj
nesnoj / dirtree.txt
Last active February 23, 2021 14:28
Dir tree of 2021-02-24_Test_Data
./output/
├── constituency.gpkg
├── country.gpkg
├── district.gpkg
├── municipality.gpkg
├── state.gpkg
├── datapackage
│   └── datapackage.json
├── LOD
│   ├── 1
@nesnoj
nesnoj / meta_stemp_abw.json
Created January 11, 2021 11:52
StEmp ABW Sources Metadata
{"id":25,"meta_data":{"name": "", "title": "Zeitreihen elektrisch Haushalte, GHD und Landwirtschaft", "review": {"path": "none", "badge": "none"}, "context": {"contact": "https://github.com/nesnoj", "grantNo": "03SFK4E1", "homepage": "https://reiner-lemoine-institut.de/kopernikus-projekt-enavi/", "sourceCode": "https://github.com/rl-institut/WAM_APP_stemp_abw", "documentation": "https://github.com/rl-institut/WAM_APP_stemp_abw"}, "sources": [{"path": "https://openenergy-platform.org/dataedit/view/demand/ego_dp_loadarea", "title": " eGo dataprocessing - Loadarea", "license": "Open Data Commons Open Database License 1.0 (ODbL-1.0) ", "copyright": "© Reiner Lemoine Institut", "description": "Below is the data that is contained in the table you selected. Only a limited amout of data is fetched at one time. You can browse different chuncks of data using the data view interface."}, {"path": "https://www.uni-flensburg.de/fileadmin/content/abteilungen/industrial/dokumente/downloads/veroeffentlichungen/forschungsergeb
@nesnoj
nesnoj / line_invest_min_example.py
Created June 14, 2020 08:11
Minimal example for line invest, based upon example from oemof-examples
# original example: https://github.com/oemof/oemof-examples/blob/master/oemof_examples/oemof.solph/v0.3.x/electrical/transshipment.py
import pandas as pd
# solph imports
from oemof.solph import (EnergySystem, Model, Bus, Flow, Source, Sink,
custom, Investment)
from oemof.outputlib import processing, views
from oemof.graph import create_nx_graph
@nesnoj
nesnoj / ashp_test_system.ipynb
Last active February 28, 2020 12:35
Testing COPs of ASHP and GSHP using oemof thermal
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nesnoj
nesnoj / powerplants2db.py
Created April 11, 2019 18:01
Write reegis powerplant data to db
import pandas as pd
import geopandas as gpd
from geoalchemy2 import Geometry, WKTElement
from shapely import wkt
from sqlalchemy import create_engine
from sqlalchemy.types import BIGINT
import getpass
import logging
filename = 'reegis_pp_ABW.h5'
@nesnoj
nesnoj / feedin_test.py
Last active February 7, 2019 16:18
Test max. turbine output of windpowerlib
import pandas as pd
from windpowerlib import ModelChain
from windpowerlib.wind_turbine import WindTurbine
weather_df = pd.read_csv('weather.csv', index_col=0, header=[0, 1])
# change type of index to datetime and set time zone
weather_df.index = pd.to_datetime(weather_df.index).tz_localize(
'UTC').tz_convert('Europe/Berlin')
# change type of height from str to int by resetting columns
weather_df.columns = [weather_df.axes[1].levels[0][
@nesnoj
nesnoj / README.md
Last active November 5, 2018 15:01
Jupyter Notebook aus der DINGO-Session auf des open_eGo-Abschlussworkshops vom 30.10.18