Skip to content

Commit

Permalink
Improve data module docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
veghdev committed Aug 2, 2023
1 parent c7c1477 commit c4db617
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ipyvizzu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* [Json][ipyvizzu.json]
* [Template][ipyvizzu.template]
* [Schema][ipyvizzu.schema]
* [Data][ipyvizzu.data]
* [Integrations][ipyvizzu.integrations]
`ipyvizzu` package imports the following objects in `__init__.py`:
Expand Down
4 changes: 4 additions & 0 deletions src/ipyvizzu/data/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"""
This module serves as a collection of data-related utilities,
including converter classes, data infer types and data typing aliases.
"""
5 changes: 5 additions & 0 deletions src/ipyvizzu/data/converters/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""
This module contains converter classes that offer a user-friendly interface for data conversion,
enabling users to effortlessly transform various data formats into a standardized representation
of series compatible with `ipyvizzu`.
"""
27 changes: 27 additions & 0 deletions src/ipyvizzu/data/typing_alias.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,42 @@


DimensionValue = str
"""
Represents a value that can be either a string or a number,
but both will be treated as strings.
"""

MeasureValue = Union[int, float]
"""
Represents a numerical value, which can be either an int or a float.
"""

NestedMeasureValues = Union[MeasureValue, List["NestedMeasureValues"]]
"""
Represents a nested structure of MeasureValues.
It can be a single MeasureValue or a list containing other NestedMeasureValues.
"""

RecordValue = Union[DimensionValue, MeasureValue]
"""
Represents a value that can be either a DimensionValue or a MeasureValue.
"""

Record = List[RecordValue]
"""
Represents a Record, which is a list of RecordValues.
In other words, it's a list containing a mix of DimensionValues and MeasureValues.
"""

SeriesValues = Union[Sequence[DimensionValue], Sequence[MeasureValue]]
"""
Represents a collection of values for a Series.
It can be a list of DimensionValues or a list of MeasureValues.
"""

Series = Dict[str, Union[str, SeriesValues]]
"""
Represents a Series in a dictionary format.
It consists of a name (string), an optional type (also a string),
and a values key which contains a SeriesValues.
"""

0 comments on commit c4db617

Please # to comment.