From 8bc297cb8a0886f36750eb60d47dbaf8cfd23e9a Mon Sep 17 00:00:00 2001 From: lewardo Date: Thu, 31 Aug 2023 15:39:12 +0100 Subject: [PATCH 1/5] `dataseries` initial ref --- doc/DataSeries.rst | 163 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 doc/DataSeries.rst diff --git a/doc/DataSeries.rst b/doc/DataSeries.rst new file mode 100644 index 0000000..29a17dc --- /dev/null +++ b/doc/DataSeries.rst @@ -0,0 +1,163 @@ +:digest: A set of data series associated with identifiers. +:species: data +:sc-categories: UGens>FluidManipulation +:sc-related: Classes/Dictionary +:see-also: LabelSet, DataSet, DTW, +:max-seealso: dict +:description: FluidDataSeries is a container associating series of data points with identifiers. + + +:control name: + + The name of the FluidDataSeries. This is unique between all FluidDataSeries. + + +:message addFrame: + + :arg identifier: The identifier for the series to add to. + + :arg buffer: A |buffer| containing the data for the frame (only the first channel is used). + + Add a new frame to the end of a series, creates the series if it does not exist. Sets the dimensionality of the DataSeries if it is the first frame added, otherwise if the buffer is too short an error will be reported. + + +:message addSeries: + + :arg identifier: The identifier for the series to add. + + :arg buffer: A |buffer| containing the data for the series (each channel is a distinct time frame). + + Add a new series from a buffer. Sets the dimensionality of the DataSeries if it is the first series added, otherwise if the buffer is too short an error will be reported. If the identifier already exists an error will be reported. + + +:message getFrame: + + :arg identifier: The identifier for the series to get from. + + :arg time: which time frame to get. + + :arg buffer: A |buffer| to write the frame to (only the first channel is used, will be resized). + + Get a frame from a series. If the identifier doesn't exist or if that series doesnt have a frame for that time point an error will be reported. + + +:message getSeries: + + :arg identifier: The identifier for the series to get. + + :arg buffer: A |buffer| containing the data for the series (each channel is a distinct time frame, will be resized). + + Get a series. If the identifier doesn't exist an error will be reported. + + +:message setFrame: + + :arg identifier: The identifier for the series to set a frame in. + + :arg time: which time frame to set. + + :arg buffer: A |buffer| containing the data for the frame (only the first channel is used). + + Updates a time frame in a series, or adds it to the end if there is no frame at that time point. Sets the dimensionality of the DataSeries if it is the first frame added, otherwise if the buffer is too short an error will be reported. + + +:message setSeries: + + :arg identifier: The identifier for the series to set. + + :arg buffer: A |buffer| containing the data for the series (each channel is a distinct time frame). + + Updates a time series, or adds it if it doesn't exist. Sets the dimensionality of the DataSeries if it is the first series added, otherwise if the buffer is too short an error will be reported. + + +:message updateFrame: + + :arg identifier: The identifier for the series to update a frame in. + + :arg time: which time frame to update. + + :arg buffer: A |buffer| containing the data for the frame (only the first channel is used). + + Updates an existing frame. If the buffer is too short an error will be reported. If the identifier doesn't exist or if that series doesnt have a frame for that time point an error will be reported. + + +:message updateSeries: + + :arg identifier: The identifier for the series to update. + + :arg buffer: A |buffer| containing the data for the series (each channel is a distinct time frame). + + Updates a new series. If the buffer is too short an error will be reported. If the identifier doesn't exist an error will be reported. + + +:message deleteFrame: + + :arg identifier: The identifier for the series to delete a frame from. + + :arg time: which time frame to remove. + + Delete a frame from a series, deletes the series if it is the last frame. If the identifier doesn't exist or if that series doesnt have a frame for that time point an error will be reported. + + +:message deleteSeries: + + :arg identifier: The identifier for the series to delete. + + Delete a series. If the identifier doesn't exist an error will be reported. + + +:message getDataSet: + + :arg dataSet: The Dataset to write the slice to. Will overwrite and resize. + + :arg time: which time frame to extract. + + Get a dataset with the `time`th frame of every series, for examples create a :fluid-obj:`DataSet` with every first frame of every point. If an identifier doesn't have enough points it is merely not added to the output dataset. + + +:message clear: + + Empty the data series of all series and frames. + + +:message getIds: + + :arg labelSet: The FluidLabelSet to export to. Its content will be replaced. + + Export the dataset identifiers to a :fluid-obj:`LabelSet`. + + +:message merge: + + :arg sourceDataSet: The source DataSet to be merged. + + :arg overwrite: A flag to allow overwrite points with the same identifier. + + Merge sourceDataSeries in the current DataSeries. It will replace the value of points with the same identifier if overwrite is set to 1. + + +:message print: + + Post an abbreviated content of the DataSeries in the window by default, but you can supply a custom action instead. + + +:message read: + + :arg filename: (optional) filename to save to + + Read a saved object in JSON format from disk, will prompt for file location if not filename not provided + + +:message write: + + Save the contents of the object to a JSON file on disk to the file specified, will prompt for file location if not filename not provided + + +:message load: + + Load the state of this object from a Dictionary. + + +:message dump: + + Dump the state of this object as a Dictionary. From 5187e937a2c1f861a7f0da32a3d7920c6ff049c7 Mon Sep 17 00:00:00 2001 From: lewardo Date: Sat, 9 Sep 2023 18:44:53 +0100 Subject: [PATCH 2/5] clean up ref --- doc/DataSeries.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/DataSeries.rst b/doc/DataSeries.rst index 29a17dc..70d5aee 100644 --- a/doc/DataSeries.rst +++ b/doc/DataSeries.rst @@ -45,7 +45,7 @@ :arg identifier: The identifier for the series to get. - :arg buffer: A |buffer| containing the data for the series (each channel is a distinct time frame, will be resized). + :arg buffer: A |buffer| to write the series to (each channel is a distinct time frame, will be resized). Get a series. If the identifier doesn't exist an error will be reported. @@ -96,7 +96,7 @@ :arg time: which time frame to remove. - Delete a frame from a series, deletes the series if it is the last frame. If the identifier doesn't exist or if that series doesnt have a frame for that time point an error will be reported. + Delete a frame from a series, deletes the series if it is the only frame. If the identifier doesn't exist or if that series doesnt have a frame for that time point an error will be reported. :message deleteSeries: @@ -112,7 +112,7 @@ :arg time: which time frame to extract. - Get a dataset with the `time`th frame of every series, for examples create a :fluid-obj:`DataSet` with every first frame of every point. If an identifier doesn't have enough points it is merely not added to the output dataset. + Get a dataset with the `time`th frame of every series, i.e. can create a :fluid-obj:`DataSet` with every Nth frame of every series. If an identifier doesn't have enough frames it is merely not added to the output dataset. :message clear: @@ -124,12 +124,12 @@ :arg labelSet: The FluidLabelSet to export to. Its content will be replaced. - Export the dataset identifiers to a :fluid-obj:`LabelSet`. + Export the dataseries identifiers to a :fluid-obj:`LabelSet`. :message merge: - :arg sourceDataSet: The source DataSet to be merged. + :arg sourceDataSeries: The source DataSeries to be merged. :arg overwrite: A flag to allow overwrite points with the same identifier. From d2a6d30085696482347eac7787acfdb7f3e2c3f9 Mon Sep 17 00:00:00 2001 From: lewardo Date: Sun, 10 Sep 2023 11:59:10 +0100 Subject: [PATCH 3/5] update getdataset argument order --- doc/DataSeries.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/DataSeries.rst b/doc/DataSeries.rst index 70d5aee..3d065fa 100644 --- a/doc/DataSeries.rst +++ b/doc/DataSeries.rst @@ -108,10 +108,10 @@ :message getDataSet: - :arg dataSet: The Dataset to write the slice to. Will overwrite and resize. - :arg time: which time frame to extract. + :arg dataSet: The Dataset to write the slice to. Will overwrite and resize. + Get a dataset with the `time`th frame of every series, i.e. can create a :fluid-obj:`DataSet` with every Nth frame of every series. If an identifier doesn't have enough frames it is merely not added to the output dataset. From 9faa7838066efd62bf6436a9c892330dbdcb840f Mon Sep 17 00:00:00 2001 From: lewardo Date: Sun, 10 Sep 2023 12:15:20 +0100 Subject: [PATCH 4/5] document negative indexing --- doc/DataSeries.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/DataSeries.rst b/doc/DataSeries.rst index 3d065fa..4b766cc 100644 --- a/doc/DataSeries.rst +++ b/doc/DataSeries.rst @@ -38,7 +38,7 @@ :arg buffer: A |buffer| to write the frame to (only the first channel is used, will be resized). - Get a frame from a series. If the identifier doesn't exist or if that series doesnt have a frame for that time point an error will be reported. + Get a frame from a series. Negative indexing starts from the last frame. If the identifier doesn't exist or if that series doesnt have a frame for that time point an error will be reported. :message getSeries: @@ -58,7 +58,7 @@ :arg buffer: A |buffer| containing the data for the frame (only the first channel is used). - Updates a time frame in a series, or adds it to the end if there is no frame at that time point. Sets the dimensionality of the DataSeries if it is the first frame added, otherwise if the buffer is too short an error will be reported. + Updates a time frame in a series, or adds it to the end if there is no frame at that time point. Negative indexing starts from the last frame. Sets the dimensionality of the DataSeries if it is the first frame added, otherwise if the buffer is too short an error will be reported. :message setSeries: @@ -78,7 +78,7 @@ :arg buffer: A |buffer| containing the data for the frame (only the first channel is used). - Updates an existing frame. If the buffer is too short an error will be reported. If the identifier doesn't exist or if that series doesnt have a frame for that time point an error will be reported. + Updates an existing frame. Negative indexing starts from the last frame. If the buffer is too short an error will be reported. If the identifier doesn't exist or if that series doesnt have a frame for that time point an error will be reported. :message updateSeries: @@ -96,7 +96,7 @@ :arg time: which time frame to remove. - Delete a frame from a series, deletes the series if it is the only frame. If the identifier doesn't exist or if that series doesnt have a frame for that time point an error will be reported. + Delete a frame from a series, deletes the series if it is the only frame. Negative indexing starts from the last frame. If the identifier doesn't exist or if that series doesnt have a frame for that time point an error will be reported. :message deleteSeries: @@ -112,7 +112,7 @@ :arg dataSet: The Dataset to write the slice to. Will overwrite and resize. - Get a dataset with the `time`th frame of every series, i.e. can create a :fluid-obj:`DataSet` with every Nth frame of every series. If an identifier doesn't have enough frames it is merely not added to the output dataset. + Get a dataset with the `time`th frame of every series, i.e. can create a :fluid-obj:`DataSet` with every Nth frame of every series. Negative indexing starts from the last frame. If an identifier doesn't have enough frames it is merely not added to the output dataset. :message clear: From da19767929430ceb81e2309a9394250beecc28ea Mon Sep 17 00:00:00 2001 From: lewardo Date: Mon, 11 Sep 2023 14:03:34 +0100 Subject: [PATCH 5/5] add dataseries to paramdump --- include/FluidParameterDump.hpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/include/FluidParameterDump.hpp b/include/FluidParameterDump.hpp index 557a93b..9627e6d 100644 --- a/include/FluidParameterDump.hpp +++ b/include/FluidParameterDump.hpp @@ -41,6 +41,10 @@ namespace dataset { class DataSetClient; } +namespace dataseries { +class DataSeriesClient; +} + namespace labelset { class LabelSetClient; } @@ -260,6 +264,11 @@ std::string getArgType(SharedClientRef) return "DataSet"; } +std::string getArgType(SharedClientRef) +{ + return "DataSeries"; +} + std::string getArgType(SharedClientRef) { return "LabelSet"; @@ -270,6 +279,11 @@ std::string getArgType(SharedClientRef&) return "Input DataSet"; } +std::string getArgType(SharedClientRef) +{ + return "Input DataSeries"; +} + std::string getArgType(SharedClientRef&) { return "Input LabelSet"; @@ -410,6 +424,13 @@ class ParameterDump { return "dataset"; } + + static std::string + getParamType(const SharedClientRef::ParamType&) + { + return "dataseries"; + } + static std::string getParamType(const SharedClientRef::ParamType&) {