foundryts.functions.points

foundryts.functions.points(*list_of_points, name='point-set')

Creates a set of user-defined points that act as a time series and are not written by a sync.

This is useful for creating a reference time series for operations like interpolation or DSL formulas. This is also a helpful utility for getting familiar with FoundryTS without setting up a test time series.

  • Parameters:
    • *list_of_points (Tuple *[*TimestampType , float ] | Tuple *[*TimestampType , str ]) – Tuples of timestamp and the point value at that timestamp as a non-keyword position arg.
    • name (str , optional) – Alias for the point set which will be used as the time series ID for all downstream operations.
  • Returns: A point-set which acts like a time series for all downstream operations.
  • Return type: FunctionNode

Dataframe schema

Column nameTypeDescription
timestamppandas.TimestampTimestamp of the point
valueUnion[float, str]Value of the point
See Also

series()

Note

All point values should have the same type.

Examples

Copied!
1>>> numeric_series = F.points( 2... (0, 0.0), (100, 100.0), (140, 140.0), (200, 200.0), name="numeric" 3... ) 4>>> numeric_series.to_pandas() 5 timestamp value 60 1970-01-01 00:00:00.000000000 0.0 71 1970-01-01 00:00:00.000000100 100.0 82 1970-01-01 00:00:00.000000140 140.0 93 1970-01-01 00:00:00.000000200 200.0
Copied!
1>>> enum_series = F.points( 2... (100, "ON"), 3... (120, "ON"), 4... (130, "OFF"), 5... (150, "ON"), 6... (160, "OFF"), 7... name="enum", 8... ) 9>>> enum_series.to_pandas() 10 timestamp value 110 1970-01-01 00:00:00.000000100 ON 121 1970-01-01 00:00:00.000000120 ON 132 1970-01-01 00:00:00.000000130 OFF 143 1970-01-01 00:00:00.000000150 ON 154 1970-01-01 00:00:00.000000160 OFF