~/bend-docscommunity

io.bend relies on unsafe/foreign

raw source on the hub · import bend-quant-signal@0.1.0.0/io.bend as Io

Panel.load: read a row-major t x n float32 file, as numpy's a.astype("<f4").tofile(path) writes it. Kept apart from signal.bend so the proofs import no effects.

Public: Panel.load. The load.* defs are internal.

4 imports
import Base
import bend-kit-f32array@0.2.1.0/f32array.bend as A
import bend-kit-f32array@0.2.1.0/io.bend as F
import ./signal.bend as S

Definitions

def load.panel source · line 11 · raw

@r:Result<&1, &1, Pair(U32, String), 0x10a054003f9647d4e93c2ae59fdb197a/f32array.F32Array> -> @+t:U32 -> @+n:U32 -> Result<&1, &1, Pair(U32, String), 0x5448dabcbe0822c3bf353ad2ca933826/signal.Panel>

def load.fin source · line 18 · raw

@got:Pair(File, Result<&1, &1, Pair(U32, String), 0x10a054003f9647d4e93c2ae59fdb197a/f32array.F32Array>) -> @+t:U32 -> @+n:U32 -> IO(Result<&1, &1, Pair(U32, String), 0x5448dabcbe0822c3bf353ad2ca933826/signal.Panel>)

def load.open source · line 24 · raw

@r:Result<&1, &1, Pair(U32, String), File> -> @+t:U32 -> @+n:U32 -> IO(Result<&1, &1, Pair(U32, String), 0x5448dabcbe0822c3bf353ad2ca933826/signal.Panel>)

def Panel.load source · line 35 · raw

@path:String -> @+t:U32 -> @+n:U32 -> IO(Result<&1, &1, Pair(U32, String), 0x5448dabcbe0822c3bf353ad2ca933826/signal.Panel>)

Fails when the file can't be opened or holds fewer than t * n floats. ponytail: one read of t * n floats, so t * n must stay under 2^30