Skip to content

Instantly share code, notes, and snippets.

View fneum's full-sized avatar
🪐

Fabian Neumann fneum

🪐
View GitHub Profile
@fneum
fneum / rulegraphfilter.ipynb
Created August 14, 2019 15:17
rulegraphfilter.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fneum
fneum / pypsa-i88.ipynb
Created August 15, 2019 10:14
PyPSA issue #88
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
def create_view_object(cbgn_no_duplicate,buses_region):
"""Create object to view gas network data."""
cbgn_no_duplicate=cbgn_no_duplicate.merge(buses_region,left_on='buses_start',right_on='name')
cbgn_no_duplicate=cbgn_no_duplicate.merge(buses_region,left_on='buses_destination',right_on='name')
cbgn_no_duplicate.geometry_x=cbgn_no_duplicate.geometry_x.apply(lambda x: x.centroid)
cbgn_no_duplicate.geometry_y=cbgn_no_duplicate.geometry_y.apply(lambda x: x.centroid)
cbgn_no_duplicate['geometry']=list(zip(cbgn_no_duplicate['geometry_x'],
cbgn_no_duplicate['geometry_y']))
@fneum
fneum / joule.bst
Created June 8, 2023 16:19
Bibtex style for Joule journal
% (changes from apalike to cell by Tom Schneider are public domain.)
%
% BibTex `cell' bibliography style
% version = 1.28 of cell.bst 2009 Jul 21
% 2009 Jul 21, 1.28 upgrade documentation
% 2009 Jul 13, 1.27 suppress notes in article
% 2009 Jul 11, 1.26 upgrade to modern cell: &->and, give titles, \emph{vol}
% 1994 Oct 15, 1.25 from version = 1.27 of jmb.bst 1992 October 22
% This bibliography style is for the journal Cell.
@fneum
fneum / joule.sty
Created June 8, 2023 16:20
.sty file for Joule journal
% (changes from apalike to cell by Tom Schneider are public domain)
%
% version = 2.03 of cell.sty 2009 Jul 21
% 2009 Jul 21, 2.03: upgrade documentation
% 2009 Jul 15, 2.02: no bib indent
% 2009 Jul 14, 2.01: simplify
% 2009 Jul 13, 2.00: modernize to match current version of Cell
% 1998 Mar 3, 1.00: original version of cell.sty
% Dr. Thomas D. Schneider
@fneum
fneum / create_scenarios.py
Last active March 19, 2024 13:51
PyPSA-Eur `create_scenarios.py` for multiple weather years
# -*- coding: utf-8 -*-
# SPDX-FileCopyrightText: : 2023-2024 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
# This script helps to generate a scenarios.yaml file for PyPSA-Eur.
# You can modify the template to your needs and define all possible combinations of config values that should be considered.
if "snakemake" in globals():
filename = snakemake.output[0]
@fneum
fneum / hdd-runoff.py
Last active August 13, 2025 16:24
era5-annual-{HDD,runoff}-per-country.csv
import atlite
import geopandas as gpd
import pandas as pd
country_shapes = gpd.read_file("country_shapes.geojson").set_index('name')['geometry']
runoff = []
for year in range(1941, 2024):