bend_vg.bend relies on unsafe/foreign
raw source on the hub · import bend-visgraph@1.0.0.0/bend_vg.bend as Bend_vg
ts2vg's visibility graphs of time series, in Bend2, on every CPU thread.
bend-vg's command line takes ts2vg's options with the input first: bend_vg INPUT [-o OUTPUT] [-x XS] [-t TYPE] [-d DIRECTED] [-w WEIGHTED] [-p LIMIT] [-m MODE] where XS, which ts2vg's command line lacks, holds the x of each value.
6 imports
import Base import ./src/graph.bend as G import ./src/parallel.bend as Par import ./src/series.bend as Series import ./src/report.bend as Report import ./src/vg.bend as VG
Types
type Mode source · line 13 · raw
Data
EdgeListMode
DegreeSequenceMode
DegreeDistributionMode
DegreeCountsMode
type Flag source · line 19 · raw
Data
OutputFlag
XFileFlag
GraphTypeFlag
DirectedFlag
WeightedFlag
LimitFlag
OutputModeFlag
type Entry source · line 28 · raw
@-A:Data -> Data
Entry@-A:Data -> @name:String -> @value:A -> Entry<A>
type Config source · line 31 · raw
Data
Config@output:String -> @xs:String -> @g:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Graph -> @dir:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Direction -> @k:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Weight -> @limit:U32 -> @mode:Mode -> Config
Usage@msg:String -> Config
type Outcome source · line 35 · raw
Data
Ok@text:String -> Outcome
Err@msg:String -> Outcome
type XSource source · line 179 · raw
Data
Where x comes from: the index, or the values of the -x file, last first.
ByIndexXSource
Given@rev:List<&2, F32> -> XSource
type XsIn source · line 213 · raw
Data
The x coordinates of the -x file, if one was given.
NoXsXsIn
XsRead@p:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/series.Parsed -> XsIn
Definitions
def usage source · line 39 · raw
String
def flags source · line 44 · raw
List<&2, Entry<Flag>>
def graphs source · line 49 · raw
List<&2, Entry<0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Graph>>
def directions source · line 52 · raw
List<&2, Entry<0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Direction>>
def weights source · line 55 · raw
List<&2, Entry<0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Weight>>
def modes source · line 61 · raw
List<&2, Entry<Mode>>
def lookup.hit source · line 64 · raw
@-A:Data -> @hit:Bool -> @v:A -> @rest:Maybe<&2, A> -> Maybe<&2, A>
def lookup.entry source · line 71 · raw
@-A:Data -> @+s:String -> @e:Entry<A> -> @rest:Maybe<&2, A> -> Maybe<&2, A>
def lookup source · line 75 · raw
@-A:Data -> @+s:String -> @table:List<&2, Entry<A>> -> Maybe<&2, A>
def defaults source · line 84 · raw
Config
def bad source · line 87 · raw
@name:String -> @value:String -> Config
def with_graph source · line 90 · raw
@found:Maybe<&2, 0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Graph> -> @name:String -> @value:String -> @o:String -> @x:String -> @d:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Direction -> @k:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Weight -> @l:U32 -> @m:Mode -> Config
def with_direction source · line 97 · raw
@found:Maybe<&2, 0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Direction> -> @name:String -> @value:String -> @o:String -> @x:String -> @g:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Graph -> @k:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Weight -> @l:U32 -> @m:Mode -> Config
def with_weight source · line 104 · raw
@found:Maybe<&2, 0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Weight> -> @name:String -> @value:String -> @o:String -> @x:String -> @g:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Graph -> @d:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Direction -> @l:U32 -> @m:Mode -> Config
def with_limit source · line 111 · raw
@found:Maybe<&2, U32> -> @name:String -> @value:String -> @o:String -> @x:String -> @g:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Graph -> @d:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Direction -> @k:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Weight -> @m:Mode -> Config
def with_mode source · line 118 · raw
@found:Maybe<&2, Mode> -> @name:String -> @value:String -> @o:String -> @x:String -> @g:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Graph -> @d:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Direction -> @k:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Weight -> @l:U32 -> Config
def set source · line 125 · raw
@cfg:Config -> @flag:Maybe<&2, Flag> -> @+name:String -> @+value:String -> Config
def parse source · line 146 · raw
@opts:List<&1, String> -> @cfg:Config -> Config
def output source · line 157 · raw
@mode:Mode -> @+k:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Weight -> @es:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Edges -> @+n:U32 -> String
def only_degrees source · line 168 · raw
@mode:Mode -> Bool
def graph_of source · line 175 · raw
@+g:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Graph -> @+dir:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Direction -> @+k:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Weight -> @+limit:U32 -> @ys:Array<F32> -> @xs:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Xs -> @+n:U32 -> 0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Edges
def xs_of source · line 183 · raw
@x:XSource -> @+n:U32 -> 0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Xs
def report.built source · line 190 · raw
@weighted_degrees:Bool -> @+g:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Graph -> @+dir:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Direction -> @+k:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Weight -> @+limit:U32 -> @mode:Mode -> @rev:List<&2, F32> -> @x:XSource -> @+n:U32 -> Outcome
def report.sized source · line 198 · raw
@too_long:Bool -> @+g:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Graph -> @+dir:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Direction -> @+k:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Weight -> @+limit:U32 -> @+mode:Mode -> @rev:List<&2, F32> -> @+n:U32 -> Outcome
x as the index is an F32, which holds every index below 2^24 exactly.
def report.xs source · line 205 · raw
@x:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/series.XsCheck -> @+g:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Graph -> @+dir:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Direction -> @+k:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Weight -> @+limit:U32 -> @+mode:Mode -> @rev:List<&2, F32> -> @+n:U32 -> Outcome
def report source · line 217 · raw
@p:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/series.Parsed -> @x:XsIn -> @+g:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Graph -> @+dir:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Direction -> @+k:0xe3f5cb14a0b4bd4d5826a0042d3c3d23/src/graph.Weight -> @+limit:U32 -> @+mode:Mode -> Outcome
def write_text.done source · line 228 · raw
@m:Pair(File, Result<&1, &1, Pair(U32, String), Unit>) -> IO(Unit)
def write_text source · line 234 · raw
@path:String -> @text:String -> IO(Unit)
def emit.to source · line 240 · raw
@stdout:Bool -> @path:String -> @text:String -> IO(Unit)
def emit source · line 247 · raw
@+path:String -> @outcome:Outcome -> IO(Unit)
def read_xs source · line 254 · raw
@none:Bool -> @path:String -> IO(XsIn)
def run source · line 263 · raw
@input:String -> @cfg:Config -> IO(Unit)
def start source · line 273 · raw
@args:List<&1, String> -> IO(Unit)
def main source · line 280 · raw
IO(Unit)