These are the most significant polling results:
Partitioning | Votes |
---|---|
2, 3 | 5 |
7, 9 | 5 |
5, 6 | 4 |
10 | 4 |
"""Illustrate some strategies to cache potentially expensive results. | |
Sometimes results are obtained via code which has side effects and/or is | |
potentially expensive so you don't want to run it more often than | |
necessary. This script demonstrates a few different ways of caching | |
those results at the use site, so they only need to be generated once | |
and can be read from whatever is used as a cache afterwards. | |
""" | |
# First we need a function having an observable side effect, so we can |
#! /usr/bin/env python | |
from pathlib import Path | |
import csv | |
import json | |
from shapely.geometry import Point, shape | |
from shapely.prepared import prep | |
from egon.data import subprocess |
from functools import partial | |
import json | |
from geocube.api.core import make_geocube | |
from geocube.rasterize import rasterize_image | |
from rasterio.enums import MergeAlg | |
from shapely.wkt import loads | |
from shapely.geometry import box, mapping, MultiPoint | |
import pandas as pd | |
import geopandas as gpd |
import os | |
import zipfile | |
with zipfile.ZipFile(PATH_TO_ZIPFILE) as zf: | |
for filename in zf.namelist(): | |
zf.extract(filename) | |
# Do stuff with `filename`. | |
os.remove(filename) |
spec Sorting = | |
TotalOrder and List | |
then { | |
preds is_ordered : List; | |
permutation : List * List | |
vars x,y:Elem; L,L1,L2:List | |
. is_ordered([]) | |
. is_ordered(x::[]) | |
. is_ordered(x::y::L) <=> x<=y /\ is_ordered(y::L) | |
. permutation(L1,L2) <=> (forall x:Elem . count(x,L1) = count(x,L2)) |
from oemof.network import Source | |
class Investment: | |
""" Components (Nodes?) grouped under `Investment` objects are optimized | |
for investment. | |
""" | |
def __init__(self, maximum=float('+inf')): | |
self.maximum = maximum |