Skip to content

Instantly share code, notes, and snippets.

Mark Mikofski mikofski

Block or report user

Report or block mikofski

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mikofski
mikofski / cython_optimize_brentq_benchmark.ipynb
Last active Mar 29, 2019
SciPy Cython Optimize Zeros API
View cython_optimize_brentq_benchmark.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mikofski
mikofski / .gitignore
Last active Jun 29, 2018
proof of an implicit solver
View .gitignore
.ipynb_checkpoints/
@mikofski
mikofski / solpos_mex.c
Last active Jun 7, 2018
MATLAB mex gateway function for NREL SOLPOS
View solpos_mex.c
/*==========================================================
* solpos.c - NREL solar position calculator
*
* calculates solar position from location and time
*
* The calling syntax is:
*
* angles = solpos(location,datetime,weather)
*
* This is a MEX-file for MATLAB.
@mikofski
mikofski / profile_active_mask.py
Created Mar 23, 2018
profiling script of scipy PR8357 to vectorize newton using a mask for active array items
View profile_active_mask.py
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
# Newton-Raphson method
def newton(func, x0, fprime=None, args=(), tol=1.48e-8, maxiter=50,
fprime2=None, **kwargs):
if tol <= 0:
@mikofski
mikofski / bench_scalar_array_newton.py
Created Mar 1, 2018
Comparison of scalar scipy.optimze.zeros.newton from v1.0.0 with proposed vectorized version from pr #8357
View bench_scalar_array_newton.py
from __future__ import division, print_function, absolute_import
from math import sqrt, exp, sin, cos
import warnings
import numpy as np
# Newton-Raphson method
def scalar_newton(func, x0, fprime=None, args=(), tol=1.48e-8, maxiter=50,
fprime2=None):
"""
@mikofski
mikofski / newton_example.pyx
Last active Apr 24, 2018
cythonized example of scipy.optimized.newton to solve solar-cell for 100,000 different cases
View newton_example.pyx
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
@mikofski
mikofski / hdf5dotnet_iso8601_ipy64_example.py
Last active May 19, 2017
IronPython Example of Writing ISO 8601 Strings to HDF5 from .NET
View hdf5dotnet_iso8601_ipy64_example.py
# Writing Fixed Length Strings to HDF5 file using HDF5DotNet
# http://hdf5.net/
# * download HDF5 library and install first
# * add shared objects to PATH
# set PATH=%PATH%;C:\Program Files\HDF Group\HDF5\1.8.9\bin
# * download and extract HDF5DotNet assemblies
# * start IronPython (ipy64.exe), must be 64-bit version!
# help links:
View tz_tools.py
from tzwhere import tzwhere
from datetime import datetime
import pytz
# timezone lookup, force nearest tz for coords outside of polygons
WHERETZ = tzwhere.tzwhere(shapely=True, forceTZ=True)
# daylight savings time (DST) in northern hemisphere starts in March and ends
# in November and the opposite in southern hemisphere
JAN1 = datetime(2016, 1, 1) # date with standard time in northern hemisphere
JUN1 = datetime(2016, 6, 1) # date with standard time in southern hemisphere
@mikofski
mikofski / Analysis of NREL mPERT Data for Validating Models.ipynb
Last active Nov 10, 2016
comparison of NREL mPERT data with SAPM model
View Analysis of NREL mPERT Data for Validating Models.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mikofski
mikofski / release_robot.py
Last active Apr 5, 2017
gets sorted list of latest git tags - part of dulwich.contrib see PR #462 and #489
View release_robot.py
"""Determine last version string from tags.
Alternate to `Versioneer <https://pypi.python.org/pypi/versioneer/>`_ using
`Dulwich <https://pypi.python.org/pypi/dulwich>`_ to sort tags by time from
newest to oldest.
Copy the following into the package ``__init__.py`` module::
from dulwich.contrib.release_robot import get_current_version
__version__ = get_current_version('..')
You can’t perform that action at this time.