Skip to content

[codex] Add backend isscalar function#1808

Merged
FlorianPfaff merged 3 commits intomainfrom
codex-add-isscalar-backend-function
Apr 22, 2026
Merged

[codex] Add backend isscalar function#1808
FlorianPfaff merged 3 commits intomainfrom
codex-add-isscalar-backend-function

Conversation

@FlorianPfaff
Copy link
Copy Markdown
Owner

Summary

  • add isscalar to the shared backend interface
  • implement isscalar for the NumPy, PyTorch, and JAX backends, with the autograd mirror updated as well
  • add a backend smoke test that verifies NumPy-style scalar semantics across the backend CI matrix

Why

Some code paths need a backend-level scalar check instead of reaching for backend-specific helpers directly. This change exposes isscalar consistently through pyrecest.backend.

Impact

Backend consumers can now call pyrecest.backend.isscalar(...) regardless of whether the active backend is NumPy, PyTorch, or JAX.

Validation

  • PYRECEST_BACKEND=numpy python -m pytest -p no:cacheprovider --rootdir . -q pyrecest/tests/test_backend_interface.py
  • PYRECEST_BACKEND=pytorch python -m pytest -p no:cacheprovider --rootdir . -q pyrecest/tests/test_backend_interface.py
  • PYRECEST_BACKEND=jax python -m pytest -p no:cacheprovider --rootdir . -q pyrecest/tests/test_backend_interface.py

@FlorianPfaff FlorianPfaff marked this pull request as ready for review April 22, 2026 13:09
@FlorianPfaff FlorianPfaff enabled auto-merge (squash) April 22, 2026 13:10
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 22, 2026

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 12.03s
✅ JSON prettier 2 0 0 0 0.44s
✅ JSON v8r 2 0 0 2.45s
✅ MARKDOWN markdownlint 2 0 0 0 0.64s
✅ MARKDOWN markdown-table-formatter 2 0 0 0 0.19s
✅ PYTHON bandit 353 0 0 5.17s
✅ PYTHON black 353 8 0 0 8.2s
✅ PYTHON flake8 353 0 0 2.92s
✅ PYTHON isort 353 13 0 0 0.69s
✅ PYTHON mypy 353 0 0 4.84s
✅ PYTHON pylint 353 0 0 102.64s
✅ PYTHON ruff 353 13 0 0 0.07s
✅ REPOSITORY checkov yes no no 21.23s
✅ REPOSITORY gitleaks yes no no 6.07s
✅ REPOSITORY git_diff yes no no 0.08s
✅ REPOSITORY secretlint yes no no 7.37s
✅ REPOSITORY syft yes no no 5.86s
✅ REPOSITORY trivy-sbom yes no no 2.14s
✅ REPOSITORY trufflehog yes no no 18.61s
✅ YAML prettier 4 0 0 0 0.46s
✅ YAML v8r 4 0 0 4.55s
✅ YAML yamllint 4 0 0 0.4s

See detailed reports in MegaLinter artifacts

Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)

  • Documentation: Custom Flavors
  • Command: npx mega-linter-runner@9.4.0 --custom-flavor-setup --custom-flavor-linters PYTHON_PYLINT,PYTHON_BLACK,PYTHON_FLAKE8,PYTHON_ISORT,PYTHON_BANDIT,PYTHON_MYPY,PYTHON_RUFF,COPYPASTE_JSCPD,JSON_V8R,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_GITLEAKS,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,YAML_PRETTIER,YAML_YAMLLINT,YAML_V8R

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

@FlorianPfaff FlorianPfaff merged commit 61d59f3 into main Apr 22, 2026
17 checks passed
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