Define the public API in otava/__init__.py - #179
Open
MrlixiangWE wants to merge 2 commits into
Open
MrlixiangWE wants to merge 2 commits into
MrlixiangWE wants to merge 2 commits into
Conversation
otava had no __init__.py, so `import otava` gave an empty namespace package and the types a library user needs were spread over three submodules. Re-export them from the package root, and document the surface in docs/API.md. Closes apache#101
MrlixiangWE
force-pushed
the
feat/101-public-api
branch
from
September 9, 2026 13:03
19c5a7d to
610066f
Compare
Contributor
|
Thanks MirliangWE! I hope to review this soon.Defining an API for Otava use in a library is a valuable addition. |
Contributor
Author
|
Thanks, Henrik! I’ve also pushed a small follow-up to clarify the documentation around timestamp handling and the supported import surface. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Expose nine names from
otava, includingSeries,AnalysisOptionsandcompute_change_points, and document their use indocs/API.md. Existingsubmodule imports remain available.
The package root now loads SciPy, so importing a lightweight module such as
otava.csv_optionsalso loads those dependencies.Median import overhead in milliseconds, measured over 21 runs per checkout,
alternating base and branch, on a 4-core QEMU/KVM VM with Python 3.12.14.
Each sample subtracts a separate Python startup measurement, which can yield
negative estimates.
d2d51c9610066fotavaotava.csv_optionsotava.utilotava.seriesotava.mainThe tests check the documented export names against
__all__, check optionnames and defaults against
AnalysisOptions(), and run the documentationexamples. The wheel smoke test checks the installed package's exports and
calls
compute_change_pointswithout extras.Verified on Ubuntu 22.04 / x86_64 with
uv sync --locked --all-extras --dev:248 tests passed on each of Python 3.10.21, 3.11.16, 3.12.14, 3.13.15 and
3.14.7; the same suite passed 241 tests on
d2d51c9. This coverstestsandperf, excluding the Graphite, PostgreSQL and InfluxDB container e2e modules.On Python 3.12.14,
sphinx-build -W --keep-goingpassed on both checkouts.A wheel built from this branch passed
tests/core_install_smoke.pyin aninstallation without extras.
Closes #101