Skip to content

Commit

Permalink
[DOC] fixes to the mtype API reference (sktime#7393)
Browse files Browse the repository at this point in the history
Fixes some issues with the new API reference for data formats:

* adds missing `Table` scitype - broken link
* fixes missing mtype entries
  • Loading branch information
fkiraly authored Nov 15, 2024
1 parent 7ca9e1a commit 5c96fb8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 10 deletions.
16 changes: 16 additions & 0 deletions docs/source/api_reference/data_format.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ The ``Series`` mtype represents a single time series.

.. currentmodule:: sktime.datatypes._series._check

.. autosummary::
:toctree: auto_generated/
:template: class.rst

SeriesPdDataFrame
SeriesPdSeries
SeriesNp2D
Expand All @@ -93,6 +97,10 @@ The ``Panel`` mtype represents a flat collection of time series.

.. currentmodule:: sktime.datatypes._panel._check

.. autosummary::
:toctree: auto_generated/
:template: class.rst

PanelPdMultiIndex
PanelNp3D
PanelDfList
Expand All @@ -109,6 +117,10 @@ The ``Hierarchical`` mtype represents a hierarchical collection of time series.

.. currentmodule:: sktime.datatypes._hierarchical._check

.. autosummary::
:toctree: auto_generated/
:template: class.rst

HierarchicalPdMultiIndex
HierarchicalDask
HierarchicalPolarsEager
Expand All @@ -121,6 +133,10 @@ The ``Table`` mtype represents a (non-temporal) data frame table.

.. currentmodule:: sktime.datatypes._table._check

.. autosummary::
:toctree: auto_generated/
:template: class.rst

TablePdDataFrame
TablePdSeries
TableNp1D
Expand Down
4 changes: 2 additions & 2 deletions sktime/datatypes/_table/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from sktime.datatypes._base import BaseDatatype


class BaseTable(BaseDatatype):
"""Base class for Table data types.
class ScitypeTable(BaseDatatype):
"""Data Frame or Table data type.
Parameters
----------
Expand Down
16 changes: 8 additions & 8 deletions sktime/datatypes/_table/_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@

from sktime.datatypes._base._common import _req, _ret
from sktime.datatypes._dtypekind import _get_feature_kind, _get_table_dtypekind
from sktime.datatypes._table._base import BaseTable
from sktime.datatypes._table._base import ScitypeTable

PRIMITIVE_TYPES = (float, int, str)


class TablePdDataFrame(BaseTable):
class TablePdDataFrame(ScitypeTable):
"""Data type: pandas.DataFrame based specification of data frame table.
Parameters are inferred by check.
Expand Down Expand Up @@ -138,7 +138,7 @@ def _check_pddataframe_table(obj, return_metadata=False, var_name="obj"):
return _ret(True, None, metadata, return_metadata)


class TablePdSeries(BaseTable):
class TablePdSeries(ScitypeTable):
"""Data type: pandas.Series based specification of data frame table.
Parameters are inferred by check.
Expand Down Expand Up @@ -237,7 +237,7 @@ def _check_pdseries_table(obj, return_metadata=False, var_name="obj"):
return _ret(True, None, metadata, return_metadata)


class TableNp1D(BaseTable):
class TableNp1D(ScitypeTable):
"""Data type: 1D np.ndarray based specification of data frame table.
Parameters are inferred by check.
Expand Down Expand Up @@ -336,7 +336,7 @@ def _check_numpy1d_table(obj, return_metadata=False, var_name="obj"):
return _ret(True, None, metadata, return_metadata)


class TableNp2D(BaseTable):
class TableNp2D(ScitypeTable):
"""Data type: 2D np.ndarray based specification of data frame table.
Parameters are inferred by check.
Expand Down Expand Up @@ -434,7 +434,7 @@ def _check_numpy2d_table(obj, return_metadata=False, var_name="obj"):
return _ret(True, None, metadata, return_metadata)


class TableListOfDict(BaseTable):
class TableListOfDict(ScitypeTable):
"""Data type: list of dict based specification of data frame table.
Parameters are inferred by check.
Expand Down Expand Up @@ -555,7 +555,7 @@ def _check_list_of_dict_table(obj, return_metadata=False, var_name="obj"):
return _ret(True, None, metadata, return_metadata)


class TablePolarsEager(BaseTable):
class TablePolarsEager(ScitypeTable):
"""Data type: eager polars DataFrame based specification of data frame table.
Parameters are inferred by check.
Expand Down Expand Up @@ -620,7 +620,7 @@ def _check(self, obj, return_metadata=False, var_name="obj"):
return check_polars_frame(obj, return_metadata, var_name, lazy=False)


class TablePolarsLazy(BaseTable):
class TablePolarsLazy(ScitypeTable):
"""Data type: lazy polars DataFrame based specification of data frame table.
Parameters are inferred by check.
Expand Down

0 comments on commit 5c96fb8

Please sign in to comment.