Skip to content

fix(docs): remove typehints_formatter.#1012

Open
tm91236 wants to merge 1 commit intomainfrom
fix/documentation-caching
Open

fix(docs): remove typehints_formatter.#1012
tm91236 wants to merge 1 commit intomainfrom
fix/documentation-caching

Conversation

@tm91236
Copy link
Copy Markdown
Member

@tm91236 tm91236 commented Mar 31, 2025

PR Type

  • Bugfix
  • Feature
  • Documentation content changes

Description

By removing the typehints_formatter we are able to resolve issues #570 and #734. The former issue is resolved by removing the non-picklable function, which enables build caching, and the second is solved by removing the TypeVar bound replacement.

While the TypeVar replacement does provide more concise documentation, it removes a key piece of information, which the reader must be aware of. For example, in:

T = TypeVar("T", bound=Data)

def typevar(a: T, b: T) -> None: ...
def bound(a: Data, b: Data): ...

def valid(a: SupervisedData, b: SupervisedData): ...
def invalid(a: Data, b: SupervisedData): ...

the typevar function is the actual specification, bound is the documented specification, valid is a valid specification, and invalid is an invalid specification which is presented as valid in the documentation (if we replace the TypeVar with the bound).

As an additional comment, we do now lose the functionality of the autodoc_custom_types -- it should be noted that the ArrayLike custom type (the only listed custom type) doesn't appear to be used anywhere in the codebase.

Refs: #570, #734

How Has This Been Tested?

Documentation builds without any warnings.

Does this PR introduce a breaking change?

N/A

Checklist before requesting a review

  • I have made sure that my PR is not a duplicate.
  • My code follows the style guidelines of this project.
  • I have ensured my code is easy to understand, including docstrings and comments where necessary.
  • I have performed a self-review of my code.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • New and existing unit tests pass locally with my changes.
  • Any dependent changes have been merged and published in downstream modules.
  • I have updated CHANGELOG.md, if appropriate.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 31, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link
Copy Markdown
Contributor

Performance review

Commit 623c082 - Merge d04d73a into 94fc03c

No significant changes to performance.

By removing the `typehints_formatter` we are able to resolve
issues #570 and #734. The former issue is resolved by removing
the non-picklable function, which enables build caching, and the
second is solved by removing the `TypeVar` bound replacement.

While the `TypeVar` replacement does provide more concise
documentation, it removes a key piece of information, which the
reader must be aware of. For example, in:
```python
T = TypeVar("T", bound=Data)

def typevar(a: T, b: T) -> None: ...
def bound(a: Data, b: Data): ...

def valid(a: SupervisedData, b: SupervisedData): ...
def invalid(a: Data, b: SupervisedData): ...
```
the `typevar` function is the actual specification, `bound` is the
documented specification, `valid` is a valid specification, and
`invalid` is an invalid specification which is presented as valid
in the documentation (if we replace the `TypeVar` with the bound).

As an additional comment, we do now lose the functionality of the
`autodoc_custom_types` -- it should be noted that the `ArrayLike`
custom type (the only listed custom type) doesn't appear to be
used anywhere in the codebase.

Refs: #570, #734
@tm91236 tm91236 force-pushed the fix/documentation-caching branch from d04d73a to bfaf30d Compare March 31, 2025 12:50
@github-actions
Copy link
Copy Markdown
Contributor

Performance review

Commit ad6b7a4 - Merge bfaf30d into 94fc03c

No significant changes to performance.

@tm91236 tm91236 requested review from db091756 and tl82649 April 1, 2025 08:10
@tm91236 tm91236 added this to the v1.0.1 milestone Apr 2, 2025
@tm91236 tm91236 added the documentation Improvements or additions to documentation label Apr 2, 2025
@tm91236 tm91236 removed this from the v1.0.1 milestone Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

2 participants