Skip to content

Make the docstrings of the e2v CCD64 depletion models raw - #268

Merged
roytsmart merged 1 commit into
mainfrom
bugfix/raw-docstrings-ccd64
Oct 27, 2026
Merged

roytsmart merged 1 commit into
mainfrom
bugfix/raw-docstrings-ccd64

Conversation

@roytsmart

Copy link
Copy Markdown
Collaborator

The docstrings of e2v_ccd64_thick and e2v_ccd64_thin in optika.sensors.materials.depletion write the unit of resistivity as :math:`\Omega`-cm in a plain string, where \O is an invalid escape sequence. Python keeps the backslash, so the docs are right, but it prints a SyntaxWarning each time it compiles either module, as on the first import optika after an install from source:

_e2v_ccd64_thick.py:16: SyntaxWarning: invalid escape sequence '\O'

and a future Python will make it an error. This makes both docstrings raw, as optika's other docstrings with LaTeX in them are, and their text is unchanged. It has been there since #124.

It also adds W605 (invalid escape sequence) to the rules ruff checks, so this can't come back. On main it finds these two and nothing else.

Both functions are cached by optika.memory, which keys on their source, so the first call after this fits each model again.

Checks

  • ruff (with W605) and black pass.
  • The docstrings parse to the same text as on main.
  • Every module of optika compiles with warnings as errors.
  • The 24 tests of optika/sensors/materials/depletion pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_011Bbxi6Vw6U8Q4gVCXHfEyN

Their `\Omega` is an invalid escape sequence in a plain string, so Python
prints a SyntaxWarning whenever it compiles either module, and a future
Python will refuse it. The text of the docstrings is unchanged. Ruff now
checks for invalid escapes (W605), which found only these two.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011Bbxi6Vw6U8Q4gVCXHfEyN
@codecov

codecov Bot commented Oct 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (b5ffed9) to head (022eb04).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #268   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          129       129           
  Lines        10540     10540           
=========================================
  Hits         10540     10540           
Flag Coverage Δ
unittests 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@roytsmart
roytsmart merged commit 771a4f2 into main Oct 27, 2026
12 checks passed
@roytsmart
roytsmart deleted the bugfix/raw-docstrings-ccd64 branch October 28, 2026 16:22
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.

1 participant