Skip to content

Instantly share code, notes, and snippets.

@wholmgren
wholmgren / brentq.py
Last active March 6, 2018 21:42
preliminary results for numba'ed maximum power point code. non-numba code was developed in https://github.com/pvlib/pvlib-python/pull/409
# based on scipy/optimize/Zeros/brentq.c
# modified to python by
# William Holmgren william.holmgren@gmail.com @wholmgren
# University of Arizona, 2018
# /* Written by Charles Harris charles.harris@sdl.usu.edu */
#
# #include <math.h>
# #include "zeros.h"
#
@wholmgren
wholmgren / newton_example.pyx
Created February 5, 2018 20:24 — forked from mikofski/newton_example.pyx
cythonized example of scipy.optimized.newton to solve solar-cell for 100,000 different cases
from __future__ import division, print_function, absolute_import
from math import exp, sin
from scipy.optimize.cython_optimize cimport zeros
NUM_OF_IRRAD = 10
IL = [sin(il) + 6.0 for il in range(NUM_OF_IRRAD)]
# governing equations
# based on scipy/optimize/Zeros/brentq.c
# modified to python by
# William Holmgren william.holmgren@gmail.com @wholmgren
# University of Arizona, 2018
# /* Written by Charles Harris charles.harris@sdl.usu.edu */
#
# #include <math.h>
# #include "zeros.h"
#
@wholmgren
wholmgren / ktus_precip_probability_201802013.ipynb
Created February 13, 2018 00:49
a simple subjective probabilistic rain forecast
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# in ModelChain
def __init__(..., singlediode_calcparams_model=None)
# calls setters
self.singlediode_calcparams_model = singlediode_calcparams_model
@property
def singlediode_calcparams_model(self):
return self._singlediode_calcparams_model
@singlediode_calcparams_model.setter
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wholmgren
wholmgren / persistence.ipynb
Last active April 30, 2019 21:40
notebook to test solarforecastarbiter-core persistence forecast implementions
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wholmgren
wholmgren / bokeh_report.html
Last active May 24, 2019 19:10
rendered solarforecastarbiter report
This file has been truncated, but you can view the full file.
<!doctype html>
<html lang="en" class="h-100">
<head>
<link
href="https://cdn.pydata.org/bokeh/release/bokeh-1.1.0.min.css"
rel="stylesheet" type="text/css">
<link
href="https://cdn.pydata.org/bokeh/release/bokeh-widgets-1.1.0.min.css"
rel="stylesheet" type="text/css">
@wholmgren
wholmgren / reference_forecast_nwp.py
Created June 4, 2019 15:27
proof of concept for combining solar forecast arbiter NWP processing with api requirements. don't use this code.
import datetime
from functools import partial
from pathlib import Path
import pandas as pd
from solarforecastarbiter import datamodel
from solarforecastarbiter.reference_forecasts import main, models
from solarforecastarbiter.io.fetch import nwp as fetch_nwp