Skip to content

fix: avoid warnings about typing deprecations and escape sequences#390

Open
phaverty-ginkgo wants to merge 1 commit into
chaidiscovery:mainfrom
phaverty-ginkgo:fix_warnings
Open

fix: avoid warnings about typing deprecations and escape sequences#390
phaverty-ginkgo wants to merge 1 commit into
chaidiscovery:mainfrom
phaverty-ginkgo:fix_warnings

Conversation

@phaverty-ginkgo
Copy link
Copy Markdown

@phaverty-ginkgo phaverty-ginkgo commented Jul 15, 2025

Description

Updates some typing inputs to beartype.typing as directed by warning messages.
Avoids a warning about an escape string by escaping as expected by docstring parser.

Motivation

Avoids these warnings:

<path>/python3.12/site-packages/jaxtyping/_decorator.py:71
  <path>/python3.12/site-packages/jaxtyping/_decorator.py:71: BeartypeDecorHintPep585DeprecationWarning: Function chai_lab.data.dataset.templates.align.align_2d() parameter "addtl_dims" PEP 484 type hint typing.Sequence[int] deprecated by PEP 585. This hint is scheduled for removal in the first Python version released after October 5th, 2025. To resolve this, import this hint from "beartype.typing" rather than "typing". For further commentary and alternatives, see also:
      https://beartype.readthedocs.io/en/latest/api_roar/#pep-585-deprecations
    return typechecker(fn)

.pixi/envs/dev/lib/python3.12/site-packages/jaxtyping/_decorator.py:71
.pixi/envs/dev/lib/python3.12/site-packages/jaxtyping/_decorator.py:71
  <path>/python3.12/site-packages/jaxtyping/_decorator.py:71: BeartypeDecorHintPep585DeprecationWarning: Function chai_lab.data.dataset.templates.load.get_template_data() parameter "template_hits" PEP 484 type hint typing.Iterator[chai_lab.data.parsing.templates.template_hit.TemplateHit] deprecated by PEP 585. This hint is scheduled for removal in the first Python version released after October 5th, 2025. To resolve this, import this hint from "beartype.typing" rather than "typing". For further commentary and alternatives, see also:
      https://beartype.readthedocs.io/en/latest/api_roar/#pep-585-deprecations
    return typechecker(fn)

.pixi/envs/dev/lib/python3.12/site-packages/jaxtyping/_decorator.py:71
.pixi/envs/dev/lib/python3.12/site-packages/jaxtyping/_decorator.py:71
  <path>/python3.12/site-packages/jaxtyping/_decorator.py:71: BeartypeDecorHintPep585DeprecationWarning: Function chai_lab.data.parsing.msas.aligned_pqt.merge_multi_a3m_to_aligned_dataframe() parameter "msa_a3m_files" PEP 484 type hint typing.Mapping[pathlib.Path, chai_lab.data.parsing.msas.data_source.MSADataSource] deprecated by PEP 585. This hint is scheduled for removal in the first Python version released after October 5th, 2025. To resolve this, import this hint from "beartype.typing" rather than "typing". For further commentary and alternatives, see also:
      https://beartype.readthedocs.io/en/latest/api_roar/#pep-585-deprecations
    return typechecker(fn)

.pixi/envs/dev/lib/python3.12/site-packages/chai_lab/ranking/ptm.py:100
  <path>/python3.12/site-packages/chai_lab/ranking/ptm.py:100: SyntaxWarning: invalid escape sequence '\i'
    ipTM is the max TM score over chains c \in C, restricting

Test plan

@arogozhnikov
Copy link
Copy Markdown
Contributor

Hi, Peter, thanks for reporting.
Need to think about best way to ensure future compat with static type-checkers too - beartype.typing may/may not be the right path.

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.

2 participants