Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@tpvasconcelos
Copy link
Contributor

@tpvasconcelos tpvasconcelos commented Dec 17, 2023

Reference Issues/PRs

Relates to #5630

What does this implement/fix? Explain your changes.

Small adjustment to FunctionTransformer's docstring, related to changed made in #5630

PR checklist

For all contributions
  • I've added myself to the list of contributors with any new badges I've earned :-)
    How to: add yourself to the all-contributors file in the sktime root directory (not the CONTRIBUTORS.md). Common badges: code - fixing a bug, or adding code logic. doc - writing or improving documentation or docstrings. bug - reporting or diagnosing a bug (get this plus code if you also fixed the bug in the PR).maintenance - CI, test framework, release.
    See here for full badge reference
  • Optionally, I've added myself and possibly others to the CODEOWNERS file - do this if you want to become the owner or maintainer of an estimator you added.
    See here for further details on the algorithm maintainer role.
  • The PR title starts with either [ENH], [MNT], [DOC], or [BUG]. [BUG] - bugfix, [MNT] - CI, test framework, [ENH] - adding or improving code, [DOC] - writing or improving documentation or docstrings.
For new estimators
  • I've added the estimator to the API reference - in docs/source/api_reference/taskname.rst, follow the pattern.
  • I've added one or more illustrative usage examples to the docstring, in a pydocstyle compliant Examples section.
  • If the estimator relies on a soft dependency, I've set the python_dependencies tag and ensured
    dependency isolation, see the estimator dependencies guide.

@tpvasconcelos tpvasconcelos marked this pull request as ready for review December 17, 2023 20:09
@tpvasconcelos tpvasconcelos changed the title Adjust FunctionTransformer's docstring [DOC] Adjust FunctionTransformer's docstring Dec 17, 2023
Copy link
Member

@yarnabrina yarnabrina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine.

(Note: even a class can be a callable object, and I doubt that is supported. So I'm a bit hesitant for use of that word, but otherwise it's all good.)

@tpvasconcelos
Copy link
Contributor Author

Technically it is supported if you do it right, but its quite out there indeed 😄

>>> class Foo():
...     def __new__(cls, X):
...         return X[::-1]
>>> Foo([1, 2, 3])
[3, 2, 1]
>>> type(Foo([]))
<class 'list'>

So technically it does accept any callable that follows the (X_type, **kwargs) -> X_type protocol. I guess the simples way to think about this is thinking how you'd type-annotate this paramter.

@fkiraly fkiraly merged commit ccc66f9 into sktime:main Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants