Skip to content

Instantly share code, notes, and snippets.

View jrevels's full-sized avatar

Jarrett Revels jrevels

View GitHub Profile

Comprehensive row validation requires row construction

If I am given a row value x of unknown provenance that I'd like to comprehensively validate (i.e. validate field values as well as field types) against schema s, then my only option is to construct a new row y = Legolas.row(s, x), at which point I can use y as my "s-validated" row. There is no mechanism to fully validate x "in-place".

The primary reason that this is the case is that field assignments may introduce implicit value-level constraints on a schema's input/output domain, and there is no enforceable mechanism by which schema authors are made to explicitly surface independently computable predicates for these implicit constraints.

For example, take the schema:

@schema("foo@1",
using UUIDs, Dates, Arrow, Tables
#####
##### Signals/Annotations/Recordings
#####
struct Signal
file_uri::String
file_metadata::Union{Nothing,Dict{String,String}}
channel_names::Vector{String}
using UUIDs, Dates, Arrow, Tables
#####
##### Signals
#####
struct Signal <: Tables.AbstractRow
recording_uuid::UUID
type::String
file_uri::String
using UUIDs, Dates, Arrow, MsgPack
MsgPack.msgpack_type(::Type{Nanosecond}) = MsgPack.IntegerType()
MsgPack.from_msgpack(::Type{Nanosecond}, x::Integer) = Nanosecond(x)
MsgPack.to_msgpack(::MsgPack.IntegerType, x::Nanosecond) = x.value
MsgPack.msgpack_type(::Type{UUID}) = MsgPack.StringType()
MsgPack.from_msgpack(::Type{UUID}, x::String) = UUID(x)
MsgPack.to_msgpack(::MsgPack.StringType, x::UUID) = string(x)

Beacon Biosignals | UI/UX Engineer

(Boston, MA | Onsite Available, Remote Friendly | Full Time)

About Us:

Despite its significant potential for improving patient outcomes, brain monitoring is still not easily accessible or interpretable in clinical settings. We're going to fix that, and we'd like you to help.

We're a stealth-mode startup founded by numerical programmers, neuroscientists, ML researchers, and practicing neurologists who are committed to translating our best-of-breed clinical research from the lab into hospitals and beyond. We're well-funded, well-connected, and own a well-labeled set of brain data amassed over the past decade at some of the most prestigious medical institutions in the world. This dataset is, as far as we know, the largest of its kind in existence. We intend to put it to good use.

Beacon Biosignals | Senior Machine Learning Engineer

(Boston, MA | Onsite Available, Remote Friendly | Full Time)

Our early-stage startup is seeking an individual to lead machine learning research/development efforts at Beacon, and along the way teach us all all how to deliver robust models to improve human health.

About Us:

Despite its significant potential for improving patient outcomes, brain monitoring is still not easily accessible or interpretable in clinical settings. We're going to fix that, and we'd like you to help.

Beacon Biosignals | Lead Cloud Ops Engineer

(Boston, MA | Onsite Available, Remote Friendly | Full Time)

We're seeking an individual to lead the development/operations of our AWS infrastructure, and along the way teach us all how to deliver more robust software.

About Us:

Despite its significant potential for improving patient outcomes, brain monitoring is still not easily accessible or interpretable in clinical settings. We're going to fix that, and we'd like you to help.

using CuArrays
using CuArrays: CuArray, unsafe_free!, adapt, Mem, CuPtr
using BenchmarkTools
###############################################################################
mutable struct SimpleCuIterator{B}
batches::B
previous::Any
SimpleCuIterator(batches) = new{typeof(batches)}(batches)
using MsgPack, BenchmarkTools
struct MyType
a::Vector{Symbol}
b::Symbol
c::Float64
d::String
e::UInt64
f::Symbol
g::Union{Nothing,Dict{Symbol,Any}}
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDXOxV75iMypd/IrDZWz0zRX9EpLz7Bfk0C+qBFkqumir6FAJaBVwiL2PcwwOjMt8MgUNNxEvjs8PIEjDw8FefYT+TfIRXHGWKclZ8HuXyP54pR/pgjpYG9nUBt3DZVTZk5rynVmZEXQSgeHes5+3+31rEhaNhIc/vmTTUGZWS6ejvQe8vSfDGuLWnwpGtgiOIZNck4fq0ZAu9yje7O/VIhHCS6slKKN4iwwx1KS+UD2TMrXVot1JS5STiamGfVgxqAncOH4U+LrzCJWrJ8rncQu3+fSjmaUYKbiOlApL9y3nJQkRAUYgdNITUZcsn/2rYuPkjns2tP1X1g++szASeIRCFKfScnMRndt7/L3mHbn398+wUBLW74XuZsVVB4Fi54AxAbACjcN5blQ+IkbZCIZc4Mu+cOYrKFASN2YozW0R/VthdDuzeXEHPKtYPoYXKoxmopwiN9TTJAlAs/afaOdSjSYNLV8SHQfSzVR/nmWkUntHfj2bwhANNjZwzEClNU79WKi9CVIj3HQv5DcWDDfZFnZlDvPXyNNkT9qHpOhkrYqfpNUCKGHP8eitNbTZm8zzipm0Sx5OhJk+uZBt9zBxoIQoFYxEgdQ2pFk1TzvbAEMv6Y8/EL0YGa2HJBcLZAvSWtxho7DyqW0ehGGV5/7X+JakEcEHu129QQw5pSZQ== jarrettrevels@gmail.com