Skip to content

Commit

Permalink
docformatter
Browse files Browse the repository at this point in the history
  • Loading branch information
caneff committed Oct 20, 2023
1 parent 6499dc0 commit bc4ce9d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
pip install -r requirements-dev.txt
- name: Lint with black
run: black --check .
- name: Lint with docformatter
run: docformatter --black -c **/*.py
- name: Lint with flake8
run: |
flake8
Expand Down
20 changes: 8 additions & 12 deletions strictly_typed_pandas/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@

class DataSetBase(pd.DataFrame, ABC):
def __init__(self, *args, **kwargs) -> None:
"""
This class is a subclass of `pd.DataFrame`, hence it is initialized with the same parameters as a `DataFrame`.
"""This class is a subclass of `pd.DataFrame`, hence it is initialized with the
same parameters as a `DataFrame`.
See the Pandas `DataFrame` documentation for more information.
"""
super().__init__(*args, **kwargs)
Expand Down Expand Up @@ -76,15 +77,11 @@ def _continue_initialization(self) -> None:
pass # pragma: no cover

def to_dataframe(self) -> pd.DataFrame:
"""
Converts the object to a pandas `DataFrame`.
"""
"""Converts the object to a pandas `DataFrame`."""
return pd.DataFrame(self)

def to_frame(self) -> pd.DataFrame:
"""
Synonym of to to_dataframe(): converts the object to a pandas `DataFrame`.
"""
"""Synonym of to to_dataframe(): converts the object to a pandas `DataFrame`."""
return self.to_dataframe()


Expand All @@ -93,8 +90,7 @@ def to_frame(self) -> pd.DataFrame:


class DataSet(Generic[T], DataSetBase):
"""
`DataSet` allows for static type checking of pandas DataFrames, for example:
"""`DataSet` allows for static type checking of pandas DataFrames, for example:
.. code-block:: python
Expand Down Expand Up @@ -125,8 +121,8 @@ def _continue_initialization(self) -> None:


class IndexedDataSet(Generic[T, V], DataSetBase):
"""
`IndexedDataSet` allows for static type checking of indexed pandas DataFrames, for example:
"""`IndexedDataSet` allows for static type checking of indexed pandas DataFrames,
for example:
.. code-block:: text
Expand Down

0 comments on commit bc4ce9d

Please sign in to comment.