-
Notifications
You must be signed in to change notification settings - Fork 794
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Reimplement
expr
as a class that is understood by IDEs (#3466)
* fix: Use absolute imports explicitly Fixes the mypy issue referenced in `alt.__init__.py` * refactor: remove dynamic globals manipulation The results of `_populate_namespace` were only visible in a `IPython` environment * feat: Reimplement `expr` as a class w/ identicial semantics as the singleton - all `ConstExpression`s are now read-only properties stored in a metaclass - `expr` subclasses `ExprRef`, replacing the `__call__` w/ `__new__` - No instances of `expr` are ever created - All `FunctionExpression`s are now classmethods - Each `Expression` can now be referenced in autocomplete, without needing `IPython`/`Jupyter` - Docstrings have been reformatted to be compatible with `sphinx` - Broken links in docstrings fixed (e.g. for d3) - class-level doc for `expr`, with references & doctest * fix: use absolute imports in `test_expr` Previously relied on the dynamic globals * test(perf): rewrite `expr` tests to run in parallel Previously 2 tests, now 170+ * test: confirm `expr` constants stay constant * chore(typing): add ignores not flagged by mypy * docs: adds `alt.expr` to API Reference Uses the section heading proposed in #3427 (comment) Expands on #2904 * test: ensure `test_expr_consts_immutable` pattern works for all versions * docs: fix typos, regex artifacts, apply some `ruff` `D` rules * docs: add doc for `_ConstExpressionType` * test: make `expr` doctest testable I left this out initially, but by adding static `Parameter` names it is now possible * fix: re-run `generate-schema-wrapper` https://github.com/vega/altair/actions/runs/10005909777/job/27657526013?pr=3466 * refactor: Remove `expr` test dependency on constants Fixes #3466 (comment) * style: remove trailing commas in `@pytest.mark.parametrize`
- Loading branch information
1 parent
80939e7
commit b9d3fd4
Showing
10 changed files
with
1,500 additions
and
90 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -637,6 +637,7 @@ API Utility Classes | |
:toctree: generated/api-cls/ | ||
:nosignatures: | ||
|
||
expr | ||
When | ||
Then | ||
ChainedWhen |
This file contains 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
This file contains 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
This file contains 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
This file contains 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