API index
Fricon client library.
Classes:
Name | Description |
---|---|
Dataset |
A dataset. |
DatasetManager |
Manager of datasets in workspace. |
DatasetWriter |
Writer for newly created dataset. |
Trace |
1-D list of values with optional x-axis values. |
Workspace |
A client of fricon workspace server. |
Functions:
Name | Description |
---|---|
arrow_to_numpy |
Convert Arrow array to numpy array. |
complex128 |
Get a pyarrow data type representing 128 bit compelex number. |
trace_ |
Get a pyarrow data type representing |
Dataset
A dataset.
Datasets can be created and opened using the DatasetManager
.
Methods:
Name | Description |
---|---|
to_arrow |
Load the dataset as an Arrow Table. |
to_polars |
Load the dataset as a polars DataFrame. |
Attributes:
Name | Type | Description |
---|---|---|
created_at |
datetime
|
Creation date of the dataset. |
description |
str
|
Description of the dataset. |
favorite |
bool
|
Favorite status of the dataset. |
id |
int
|
Id of the dataset. |
index |
list[str]
|
Index columns of the dataset. |
name |
str
|
Name of the dataset. |
path |
str
|
Path of the dataset. |
tags |
list[str]
|
Tags of the dataset. |
uid |
str
|
UUID of the dataset. |
created_at: datetime = <attribute 'created_at' of 'fricon._core.Dataset' objects>
class
Creation date of the dataset.
description: str = <attribute 'description' of 'fricon._core.Dataset' objects>
class
Description of the dataset.
favorite: bool = <attribute 'favorite' of 'fricon._core.Dataset' objects>
class
Favorite status of the dataset.
id: int = <attribute 'id' of 'fricon._core.Dataset' objects>
class
Id of the dataset.
index: list[str] = <attribute 'index' of 'fricon._core.Dataset' objects>
class
Index columns of the dataset.
name: str = <attribute 'name' of 'fricon._core.Dataset' objects>
class
Name of the dataset.
path: str = <attribute 'path' of 'fricon._core.Dataset' objects>
class
Path of the dataset.
tags: list[str] = <attribute 'tags' of 'fricon._core.Dataset' objects>
class
Tags of the dataset.
uid: str = <attribute 'uid' of 'fricon._core.Dataset' objects>
class
UUID of the dataset.
to_arrow()
method descriptor
to_polars()
method descriptor
Load the dataset as a polars DataFrame.
Returns:
Type | Description |
---|---|
DataFrame
|
A polars DataFrame. |
DatasetManager
Manager of datasets in workspace.
Methods:
Name | Description |
---|---|
create |
Create a new dataset. |
list_all |
List all datasets in the workspace. |
open |
Open a dataset by id. |
create(name, *, description=None, tags=None, schema=None, index=None)
method descriptor
Create a new dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the dataset. |
required |
description
|
str | None
|
Description of the dataset. |
None
|
tags
|
Iterable[str] | None
|
Tags of the dataset. Duplicate tags will be add only once. |
None
|
schema
|
Schema | None
|
Schema of the underlying arrow table. Can be only a subset of all columns, other fields will be inferred from first row. |
None
|
index
|
Sequence[str] | None
|
Names of index columns. |
None
|
Returns:
Type | Description |
---|---|
DatasetWriter
|
A writer of the newly created dataset. |
list_all()
method descriptor
List all datasets in the workspace.
Returns:
Type | Description |
---|---|
DataFrame
|
A pandas dataframe containing information of all datasets. |
open(dataset_id)
method descriptor
Open a dataset by id.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset_id
|
str | int
|
An integer |
required |
Returns:
Type | Description |
---|---|
Dataset
|
The requested dataset. |
Raises:
Type | Description |
---|---|
RuntimeError
|
Dataset not found. |
DatasetWriter
Writer for newly created dataset.
Writers are constructed by calling DatasetManager.create
.
Methods:
Name | Description |
---|---|
close |
Finish writing to dataset. |
write |
Write a row of values to the dataset. |
write_dict |
Write a row of values to the dataset. |
Attributes:
Name | Type | Description |
---|---|---|
id |
int
|
Id of the dataset. |
id: int = <attribute 'id' of 'fricon._core.DatasetWriter' objects>
class
close()
method descriptor
Finish writing to dataset.
write(**kwargs)
method descriptor
Write a row of values to the dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
kwargs
|
_ColumnType
|
Names and values in the row. |
required |
Trace
1-D list of values with optional x-axis values.
Methods:
Name | Description |
---|---|
fixed_step |
Create a new trace with fixed x steps. |
to_arrow_array |
Convert to an arrow array. |
variable_step |
Create a new trace with variable x steps. |
Attributes:
Name | Type | Description |
---|---|---|
data_type |
DataType
|
Arrow data type of the trace. |
data_type: pa.DataType = <attribute 'data_type' of 'fricon._core.Trace' objects>
class
Arrow data type of the trace.
fixed_step(x0, dx, ys)
staticmethod
to_arrow_array()
method descriptor
variable_step(xs, ys)
staticmethod
Workspace
A client of fricon workspace server.
Methods:
Name | Description |
---|---|
connect |
Connect to a fricon server. |
Attributes:
Name | Type | Description |
---|---|---|
dataset_manager |
DatasetManager
|
A dataset manager for this workspace. |
dataset_manager: DatasetManager = <attribute 'dataset_manager' of 'fricon._core.Workspace' objects>
class
A dataset manager for this workspace.
connect(path)
staticmethod
Connect to a fricon server.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
StrPath
|
The path to the workspace. |
required |
Returns:
Type | Description |
---|---|
Workspace
|
A workspace client. |
arrow_to_numpy(arr)
Convert Arrow array to numpy array.
If the Arrow array is of custom complex128
type, it will be converted to
a numpy array of complex numbers. Otherwise, the Arrow array will be
converted with pyarrow.Array.to_numpy
Parameters:
Name | Type | Description | Default |
---|---|---|---|
arr
|
Array[Any] | ChunkedArray[Any]
|
Arrow array. |
required |
Returns:
Type | Description |
---|---|
NDArray[Any]
|
Numpy array. |
Source code in src/fricon/_helper.py
complex128()
builtin
Get a pyarrow data type representing 128 bit compelex number.
Returns:
Type | Description |
---|---|
DataType
|
A pyarrow data type. |