Skip to content

Commit

Permalink
docformatter (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
caneff authored Oct 20, 2023
1 parent d235816 commit c87b5de
Show file tree
Hide file tree
Showing 3 changed files with 11 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 @@ -25,6 +25,8 @@ jobs:
run: isort --check .
- name: Lint with black
run: black --check .
- name: Lint with docformatter
run: docformatter --black -c **/*.py
- name: Lint with flake8
run: flake8
- name: Lint with mypy
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
mypy==1.6.1
flake8==6.1.0
black[jupyter]==23.10.0
docformatter==1.7.5
isort==5.12.0
coverage==7.3.2
pytest==7.4.2
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 @@ -22,8 +22,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 @@ -75,15 +76,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 @@ -92,8 +89,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 @@ -124,8 +120,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 c87b5de

Please sign in to comment.