Env Functions
ts_timeline
env TS.ts_timeline(ts: 'TimeSeries')
Arguments:
ts: 'TimeSeries'=>
Get timeline of the timeseries as Series of strings
timeseries
env TS.timeseries(
timeline: '& [RString]',
series: 'Series',
fmt: '& str' = "%Y-%m-%d"
)
Arguments:
timeline: '& [RString]'=>series: 'Series'=>fmt: '& str' = "%Y-%m-%d"=>
build timeseries from timeline and series
Node Functions
ts_count
node TS.ts_count()
Arguments:
Number of timeseries in the node
ts_list
node TS.ts_list()
Arguments:
List all timeseries in the node
ts_delete
node TS.ts_delete(name: '& str')
Arguments:
name: '& str'=> Name of the timeseries to delete from this node
Delete the timeseries with the given name
ts_dtype
node TS.ts_dtype(name: '& str', safe: 'bool' = false)
Arguments:
name: '& str'=> Name of the timeseriessafe: 'bool' = false=> Do not error if timeseries does’t exist
Type name of the timeseries
ts_len
node TS.ts_len(
name: '& str',
safe: 'bool' = false,
valid: 'bool' = false
)
Arguments:
name: '& str'=> Name of the timeseriessafe: 'bool' = false=> Do not error if timeseries does’t existvalid: 'bool' = false=> Only count valid data (skip nulls)
Length of the timeseries
ts_complete
node TS.ts_complete(name: '& str')
Arguments:
name: '& str'=> Name of the timeseries
Convert the timeseries to complete if it doesn’t have gaps
ts_print
node TS.ts_print(
name: '& str',
header: 'bool' = true,
head: 'Option < i64 >',
missing: 'String' = ""
)
Arguments:
name: '& str'=> name of the timeseriesheader: 'bool' = true=> show headerhead: 'Option < i64 >'=> number of head rows to show (all by default)missing: 'String' = ""=> Show missing values as this string
Print the given timeseries values in csv format
TODO
- save to file instead of showing with
outfile: Option<PathBuf>
Network Functions
ts_print_csv
network TS.ts_print_csv(
name: '& str',
head: 'Option < usize >',
nodes: 'Option < HashSet < String > >',
missing: '& str' = ""
)
Arguments:
name: '& str'=> Name of the timeseries to savehead: 'Option < usize >'=> number of head rows to show (all by default)nodes: 'Option < HashSet < String > >'=> Include only these nodes (all by default)missing: '& str' = ""=> Show missing values as this string
Save timeseries from all nodes into a single csv file
TODO: error/not on unqual length
TODO: error/not on no timeseries, etc…
TODO: output to file: PathBuf
series_csv
network TS.series_csv(
filter: 'Vec < bool >',
outfile: '& Path',
attrs: 'Vec < String >',
series: 'Vec < String >',
missing: '& str' = ""
)
Arguments:
filter: 'Vec < bool >'=>outfile: '& Path'=> Path to the output csvattrs: 'Vec < String >'=> list of attributes to writeseries: 'Vec < String >'=> list of series to writemissing: '& str' = ""=> Show missing values as this string
Write the given nodes to csv with given attributes and series