Skip to content

Maintenance: CI/CD, packaging, docs, C++ cleanup, and docstring fixes#40

Merged
ardiloot merged 3 commits intomasterfrom
fix/maintenance-high-medium
Feb 20, 2026
Merged

Maintenance: CI/CD, packaging, docs, C++ cleanup, and docstring fixes#40
ardiloot merged 3 commits intomasterfrom
fix/maintenance-high-medium

Conversation

@ardiloot
Copy link
Copy Markdown
Owner

Summary

Addresses high and medium priority maintenance items identified during a project audit, modernizes the Sphinx documentation setup, and fixes all library docstrings.

Changes

Commit 1: High & medium priority maintenance (e74a47a)

CI/CD (High)

  • Unified GitHub Actions artifact actions to v7 (upload-artifact, download-artifact)
  • Switched PyPI publishing to trusted publishing (removed token-based auth)
  • Added github-actions ecosystem to Dependabot

CI/CD (Medium)

  • Added timeout-minutes: 30 to pytest workflow
  • Pinned Python version (3.13) in pre-commit CI

Packaging (Medium)

  • Added PyPI classifiers (Development Status, Framework, Intended Audience, etc.)

Pre-commit (Medium)

  • Added check-yaml, check-toml, check-merge-conflict hooks

C++ cleanup (Medium)

  • Removed 32 redundant std::cerr lines (errors already thrown via exceptions)
  • Replaced 5 TODOs with descriptive comments
  • Fixed comment typos ("Shold not hapen" → "Should not happen")

Tests (Medium)

  • Added conftest.py with sys.path setup
  • Added test_MaterialConstructors.py (8 new tests for Material, TMM, public API)

Commit 2: Sphinx modernization (b9214d6)

  • Switched theme from alabaster to Furo
  • Added intersphinx mappings (Python, NumPy, SciPy)
  • Enabled autosummary_generate
  • Disabled false-positive numpydoc cross-refs (numpydoc_xref_param_type = False)
  • Suppressed ref.any warnings for parameter-name references
  • Fixed ambiguous :any: → explicit :class: roles
  • Fixed docstring definition-list formatting in .pyx
  • Removed legacy Makefile / make.bat
  • Added furo to dev dependencies

Commit 3: Docstring fixes (e8c7d04)

  • Fixed 22 distinct spelling errors across all library docstrings (amplitute, Electical, enhancment, absoprtiopn, contructor, vaccuum, etc.)
  • Fixed 8 grammar issues (missing articles, incorrect phrasing, dangling words)
  • Fixed 4 factual/semantic errors:
    • _SecondOrderNLIntensities: P1/P2 descriptions were swapped
    • _WaveSweepResultSecondOrderNLTMM: P2 attribute was listed as P1
    • _NonlinerLayer_NonlinearLayer class reference
    • WaveGetFields2D: param name "dir" → "dirStr" to match actual signature
  • Replaced all :any: roles with explicit :class:, :meth:, :attr:, or backtick literals

Validation

  • All 609 tests pass
  • All pre-commit hooks pass
  • Sphinx builds with 0 warnings (down from 131)

CI/CD:
- Unify artifact actions to upload-artifact@v7 + download-artifact@v7
- Switch to trusted publishing (remove token-based PyPI auth)
- Add github-actions ecosystem to Dependabot
- Add timeout-minutes to pytest workflow
- Pin Python 3.13 in pre-commit workflow

Packaging:
- Add PyPI classifiers (status, audience, Python versions, topic)

Pre-commit:
- Add check-yaml, check-toml, check-merge-conflict hooks

Docs:
- Replace sphinx.ext.imgmath with mathjax
- Remove references to non-existent _static/_templates dirs
- Clean up sphinx-quickstart boilerplate comments

C++:
- Remove 32 redundant std::cerr lines before throw statements
- Replace 5 bare TODO comments with descriptive notes
- Fix typos in comments ('Shold not hapen' -> 'Should not happen')

Tests:
- Add conftest.py for shared test config
- Add test_MaterialConstructors.py with constructor, interpolation,
  error-path, and public API surface tests
- Switch theme from alabaster to furo
- Add intersphinx mappings (Python, NumPy, SciPy)
- Enable autosummary_generate
- Disable numpydoc_xref_param_type (false-positive cross-refs)
- Suppress ref.any warnings for parameter-name references
- Fix ambiguous :any: refs → explicit :class: roles
- Fix docstring definition-list formatting in .pyx
- Remove legacy Makefile and make.bat (CI uses sphinx-build)
- Clean index.rst boilerplate comment
- Add furo to dev dependencies
Comprehensive review and correction of all library docstrings:

Spelling fixes:
- amplitute/amplitutes → amplitude/amplitudes
- Electical/electical → Electrical/electrical
- enhancment/enhencment/enchncment → enhancement
- absoprtiopn/asborption → absorption
- confortable → convenient
- Correspondig → Corresponding
- contructor → constructor
- Dafualt/Defualt → Default
- represenbt → represent
- neccesary → necessary
- fiedProfile → fieldProfile
- foreard → forward
- Innstance/inctance → Instance/instance
- vaccuum → vacuum
- propageted → propagated
- netagtive → negative
- inuput/imput → input
- nonliner → nonlinear
- thikness/thikness → thickness
- mathods → methods
- corrorrespond → corresponds
- z-coorinate/z-cooridnate → z-coordinate

Grammar and wording fixes:
- 'This class is helper class' → 'This is a helper class'
- 'For shortcut __call__ is defined as GetN' → proper sentence
- 'Allows to access' → 'Allows accessing'
- 'Other mode is,' → 'The other mode is'
- 'deviation form' → 'deviation from'
- 'First index is determines' → 'First index corresponds to'
- Trailing 'values' after period removed
- 'wave vector the generated' → 'wave vector of the generated'

Factual/semantic fixes:
- _SecondOrderNLIntensities: P1/P2 descriptions were swapped
- _WaveSweepResultSecondOrderNLTMM: P2 was listed as P1
- _NonlinerLayer → _NonlinearLayer (typo in class reference)
- WaveGetFields2D: 'dir' param name → 'dirStr' to match signature

Cross-reference modernization:
- Replaced all :any: roles with explicit :class:, :meth:, :attr:, or
  backtick literals as appropriate
- GettingStarted.rst: :any: → :meth:/:attr:/:class: for method/attr refs
@ardiloot ardiloot merged commit 5b2beb6 into master Feb 20, 2026
21 checks passed
@ardiloot ardiloot deleted the fix/maintenance-high-medium branch February 20, 2026 21: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