diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 8a0a6e1..c287bc1 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-09-26T18:06:59","documenter_version":"1.7.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-09-26T18:12:05","documenter_version":"1.7.0"}} \ No newline at end of file diff --git a/dev/examples.html b/dev/examples.html index 5f0a7c6..4b3b18f 100644 --- a/dev/examples.html +++ b/dev/examples.html @@ -67,4 +67,4 @@ dimension_size = [num_stages, num_scenarios, num_blocks] # Merge the files -Quiver.merge(filename, filenames, Quiver.binary)
+Quiver.merge(filename, filenames, Quiver.binary)
diff --git a/dev/home.html b/dev/home.html index 42be600..13b5294 100644 --- a/dev/home.html +++ b/dev/home.html @@ -9,4 +9,4 @@ labels = ["agent_1", "agent_2", "agent_3"]

And the data is stored in a csv or binary file that contains the values of the time series. The csv format is as follows:

stage,scenario,block,agent_1,agent_2,agent_3
 1,1,1,1.0,1.0,1.0
 1,1,2,1.0,1.0,1.0
-1,1,3,1.0,1.0,1.0

Installation

pkg> add Quiver
+1,1,3,1.0,1.0,1.0

Installation

pkg> add Quiver
diff --git a/dev/reading.html b/dev/reading.html index 2eb0ce7..5d30157 100644 --- a/dev/reading.html +++ b/dev/reading.html @@ -11,4 +11,4 @@ data = goto!(reader, stage=1, scenario=2, block=5) # Display the retrieved data -println(data)

Key Functions:

Quiver.goto!Function
goto!(reader::Reader; dims...)

This function moves the reader to the specified dimensions and returns the corresponding data. It updates the internal cache and retrieves the necessary time series values.

  • For binary files, goto! allows random access to any part of the time series, meaning you can jump between stages, scenarios, and blocks in any order. This provides greater flexibility for accessing specific points in the data.

  • For CSV files, goto! works differently. It only supports forward sequential access, meaning that while you can still navigate through stages, scenarios, and blocks, you cannot randomly jump to previous positions. The function moves forward through the file, reading data sequentially.

Parameters

  • reader::Reader: The time series reader.
  • dims...: Specific dimensions to move the reader to.

Returns

  • The data at the specified dimensions.

Simple Example:

data = goto!(reader, stage = 1, scenario = 2, block = 5)
Quiver.next_dimension!Function
next_dimension!(reader::Reader)

This function advances the reader to the next dimension and returns the updated data. It's useful when iterating over multiple dimensions sequentially. This function is especially useful for CSV files, where random access is not available. It allows for easy iteration through multiple dimensions in a forward-only manner.

Parameters

  • reader::Reader: The time series reader.

Returns

  • The data in the next dimension.

Simples Example:

next_data = next_dimension!(reader)
Quiver.file_to_arrayFunction
file_to_array(filename::String, implementation::Type{I}; labels_to_read::Vector{String} = String[]) where {I <: Implementation}

Reads a file and returns the data and metadata as a tuple.

Parameters

  • filename::String: The name of the file to be read.
  • implementation::Type{I}: The implementation type for reading the file (binary or CSV).
  • labels_to_read::Vector{String}: Specific labels to read (optional).

Returns

  • A tuple containing the read data and associated metadata.
Quiver.file_to_dfFunction
file_to_df(filename::String, implementation::Type{I}; labels_to_read::Vector{String} = String[]) where {I <: Implementation}

Reads a file and returns the data and metadata as a DataFrame.

Parameters

  • filename::String: The name of the file to be read.
  • implementation::Type{I}: The implementation type for reading the file (binary or CSV).
  • labels_to_read::Vector{String}: Specific labels to read (optional).

Returns

  • A DataFrame with the read data and metadata.

Closing the Reader:

Always close the reader when done to release resources.

Quiver.close!Function
close!(reader::Reader)

Closes the reader and releases associated resources.

Parameters

  • reader::Reader: The time series reader to close.

Returns

  • nothing.

Simple Example:

close!(reader)
+println(data)

Key Functions:

Quiver.goto!Function
goto!(reader::Reader; dims...)

This function moves the reader to the specified dimensions and returns the corresponding data. It updates the internal cache and retrieves the necessary time series values.

  • For binary files, goto! allows random access to any part of the time series, meaning you can jump between stages, scenarios, and blocks in any order. This provides greater flexibility for accessing specific points in the data.

  • For CSV files, goto! works differently. It only supports forward sequential access, meaning that while you can still navigate through stages, scenarios, and blocks, you cannot randomly jump to previous positions. The function moves forward through the file, reading data sequentially.

Parameters

  • reader::Reader: The time series reader.
  • dims...: Specific dimensions to move the reader to.

Returns

  • The data at the specified dimensions.

Simple Example:

data = goto!(reader, stage = 1, scenario = 2, block = 5)
Quiver.next_dimension!Function
next_dimension!(reader::Reader)

This function advances the reader to the next dimension and returns the updated data. It's useful when iterating over multiple dimensions sequentially. This function is especially useful for CSV files, where random access is not available. It allows for easy iteration through multiple dimensions in a forward-only manner.

Parameters

  • reader::Reader: The time series reader.

Returns

  • The data in the next dimension.

Simples Example:

next_data = next_dimension!(reader)
Quiver.file_to_arrayFunction
file_to_array(filename::String, implementation::Type{I}; labels_to_read::Vector{String} = String[]) where {I <: Implementation}

Reads a file and returns the data and metadata as a tuple.

Parameters

  • filename::String: The name of the file to be read.
  • implementation::Type{I}: The implementation type for reading the file (binary or CSV).
  • labels_to_read::Vector{String}: Specific labels to read (optional).

Returns

  • A tuple containing the read data and associated metadata.
Quiver.file_to_dfFunction
file_to_df(filename::String, implementation::Type{I}; labels_to_read::Vector{String} = String[]) where {I <: Implementation}

Reads a file and returns the data and metadata as a DataFrame.

Parameters

  • filename::String: The name of the file to be read.
  • implementation::Type{I}: The implementation type for reading the file (binary or CSV).
  • labels_to_read::Vector{String}: Specific labels to read (optional).

Returns

  • A DataFrame with the read data and metadata.

Closing the Reader:

Always close the reader when done to release resources.

Quiver.close!Function
close!(reader::Reader)

Closes the reader and releases associated resources.

Parameters

  • reader::Reader: The time series reader to close.

Returns

  • nothing.

Simple Example:

close!(reader)
diff --git a/dev/writing.html b/dev/writing.html index e31fa56..949d913 100644 --- a/dev/writing.html +++ b/dev/writing.html @@ -84,4 +84,4 @@ initial_date::Union{String, DateTime} = "", unit::String = "", digits::Union{Int, Nothing} = nothing, -) where {I <:Implementation, T, N}

Write a time series file in Quiver format.

Required arguments:

Optional arguments:

+) where {I <:Implementation, T, N}

Write a time series file in Quiver format.

Required arguments:

Optional arguments: