Skip to content

Instantly share code, notes, and snippets.

View ExpandingMan's full-sized avatar

ExpandingMan

  • Port Jefferson, NY
View GitHub Profile
@ExpandingMan
ExpandingMan / automatetestPOC.jl
Last active December 21, 2017 17:31
rough, primitive proof-of-concept for automated random unit testing in Julia
using Base.Test
using MacroTools
"""
argnametype(arg::Expr)
Given an argument of the form `x::DType` extracts the argument name (`x`) and
data type (`DType`) as a tuple.
"""
function argnametype(arg::Expr)
@ExpandingMan
ExpandingMan / convertaxis.jl
Created January 19, 2017 21:33
Converting `TimeArray`s to have `Float64` Axes
typealias Period Union{Dates.TimePeriod, Dates.DatePeriod}
# definition of year as 365 days is consistent with Dates package
convert_ms(::Type{Dates.Millisecond}, t::Number) = t
convert_ms(::Type{Dates.Second}, t::Number) = t/1000
convert_ms(::Type{Dates.Minute}, t::Number) = t/(1000*60)
convert_ms(::Type{Dates.Hour}, t::Number) = t/(1000*60*60)
convert_ms(::Type{Dates.Day}, t::Number) = t/(1000*60*60*24)
convert_ms(::Type{Dates.Year}, t::Number) = t/(1000*60*60*24*365)
@ExpandingMan
ExpandingMan / feather_performance.jl
Created October 4, 2016 16:52
testing performance of Feather.jl
using DataFrames
using Feather
using PyCall
@pyimport feather as pyfeather
# using DatasToolbox
const NROWS = 2*10^6
const FILENAME = "devtest1.feather"
const PYTHON_FILENAME = "pythontest.feather"
@ExpandingMan
ExpandingMan / deserialization_performance.jl
Created September 22, 2016 18:43
Julia deserialization performance (compared with Python pickle protocol 3)
using DataFrames
using PyCall
# using DatasToolbox
import Base.serialize
import Base.deserialize
const NROWS = 2*10^6
const FILENAME = "devtest1.jbin"
const PICKLE_FILENAME = "devtest1.pkl"