Skip to content

feat: docs restructure, show_versions, remove 1e-10 zero guards#5

Merged
quantbai merged 6 commits intodevfrom
feature/docs-and-zero-guard-removal
Mar 24, 2026
Merged

feat: docs restructure, show_versions, remove 1e-10 zero guards#5
quantbai merged 6 commits intodevfrom
feature/docs-and-zero-guard-removal

Conversation

@quantbai
Copy link
Copy Markdown
Owner

@quantbai quantbai commented Mar 24, 2026

Summary

  • Add show_versions() for bug report diagnostics
  • Add community templates (issue, PR, CODE_OF_CONDUCT, SECURITY)
  • Restructure docs: CLAUDE.md (AI memo), CONTRIBUTING.md (human guide), no duplication
  • [NUMERICAL] Remove arbitrary 1e-10 zero guards (23 instances)
  • Replace interval-based panel skeleton with union-based skeleton

Change Type

  • Bug fix (corrects incorrect behavior)
  • New feature (new operator or functionality)
  • Refactor (no behavior change)
  • Documentation only
  • Numerical change (alters factor computation results) [BREAKING]

Numerical Impact

Category Before After
divide, inverse abs(denom) < 1e-10 → null No guard. Inf → null via Factor
zscore, scale, etc. < 1e-10 → 0.0 == 0 → 0.0 (exact zero)
ts_regression, etc. < 1e-10 → 0.0 == 0 → 0.0 (exact zero)

Eliminates silent data loss from legitimate small values.

Testing

  • Added or updated tests
  • All tests pass (pytest tests/ -v) -- 141 passed
  • Lint passes (ruff check elvers/)

quantbai and others added 6 commits March 25, 2026 03:21
Provides Elvers, Polars, Python, platform, and architecture info
in a single call for bug reports.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Issue templates: bug report, feature request, new operator
- CODE_OF_CONDUCT.md (Contributor Covenant v2.1)
- SECURITY.md with scope definition
- Enhanced PR template with review criteria

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- CLAUDE.md: AI memo only (conduct, architecture, known limitations)
- CONTRIBUTING.md: human contributor guide (workflow, invariants, rationale)
- README.md: concise usage with design invariants
- OPERATORS.md: updated zero-handling descriptions
- Removed duplication across files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
[NUMERICAL]

Pure divisions (divide, inverse): guard removed entirely.
Inf -> null flows through Factor constructor.

Statistical operators (zscore, scale, normalize, signal, etc.):
threshold changed from < 1e-10 to == 0. Degenerate cases
(constant series) still return semantic defaults (0.0).

Regression operators (ts_regression, vector_neut, regression_neut):
threshold changed from < 1e-10 to == 0.

Test tolerances: removed hardcoded abs=1e-10 where pytest.approx
defaults are sufficient.

Impact: eliminates silent data loss from legitimate small values.
Near-zero denominators now produce large but finite values;
use winsorize/truncate to handle outliers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Removed interval parameter from load(). The balanced panel skeleton
is now built from the union of all timestamps present in the data,
not from a generated datetime_range.

This eliminates frequency inference and correctly handles weekends,
holidays, and irregular trading calendars without generating
spurious all-null rows.

Added _check_intervals() to warn about irregular timestamp spacing.
Added timestamp type validation (must be pl.Date or pl.Datetime).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@quantbai quantbai merged commit 1e43a84 into dev Mar 24, 2026
4 checks passed
@quantbai quantbai deleted the feature/docs-and-zero-guard-removal branch March 24, 2026 19:30
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