Skip to content

fix(api): expose trend_analysis at top level - #82

Open
BnJam wants to merge 1 commit into
mainfrom
technocore/issue-81-fix
Open

fix(api): expose trend_analysis at top level#82
BnJam wants to merge 1 commit into
mainfrom
technocore/issue-81-fix

Conversation

@BnJam

@BnJam BnJam commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Closes #81

Summary

trend_analysis was listed in __all__ (python/eo_processor/init.py:151) but never imported or defined, so from eo_processor import trend_analysis and star-imports raised ImportError.

Changes

  • Import trend_analysis as _trend_analysis and TrendSegment as _TrendSegment from ._core in python/eo_processor/init.py
  • Add thin wrapper def trend_analysis(y, threshold) following the linear_regression pattern, plus a TrendSegment = _TrendSegment alias
  • Add trend_analysis stub and class TrendSegment (start_index, end_index, slope, intercept) to init.pyi
  • Add 5 tests in tests/test_trends.py: no-break single segment, break detection (>=2 segments), negative threshold rejection, NaN rejection, star-import regression
  • Update README.md and docs/source/README.md import example to use the public API

Tests

tests/test_trends.py (new coverage for the function)

Docs

Updated: README.md, docs/source/README.md, type stubs

Checklist

  • stub added
  • tests added
  • README updated
  • CI green

trend_analysis was listed in __all__ but never bound, breaking
'from eo_processor import trend_analysis' and star-imports. Import it
from _core, add a thin wrapper and TrendSegment alias, add the type
stub, tests, and update README examples to use the public API.
@BnJam

BnJam commented Aug 1, 2026

Copy link
Copy Markdown
Owner Author

CI checks failed. Blocked this PR and filed fix-up issue #83. A fix-up PR targeting branch technocore/issue-81-fix will resolve the CI failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(api): expose trend_analysis at top level (broken — listed in __all__ but unimportable)

1 participant