From ec5164e44875fe80a94eb3b42729378b9e53666d Mon Sep 17 00:00:00 2001 From: dangotbanned <125183946+dangotbanned@users.noreply.github.com> Date: Mon, 22 Jul 2024 16:02:18 +0100 Subject: [PATCH 01/11] ci(ruff): Update rules to use `pydocstyle` Based on https://github.com/vega/altair/pull/3466#discussion_r1671952334 With some additional ignores added during test runs on `/v5/schema/*.py` --- pyproject.toml | 52 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1690384ec..3363e85a2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -222,6 +222,14 @@ extend-safe-fixes=[ "W293", # unsorted-dunder-all "RUF022", + # pydocstyle # + # ---------- # + # fits-on-one-line + "D200", + # escape-sequence-in-docstring + "D301", + # ends-in-period + "D400" ] # https://docs.astral.sh/ruff/preview/#using-rules-that-are-in-preview @@ -292,6 +300,11 @@ select = [ "PLW1510", # nested-min-max "PLW3301", + # pydocstyle # + # ---------- # + "D", + # multi-line-summary-second-line + "D213", ] ignore = [ # Whitespace before ':' @@ -310,20 +323,55 @@ ignore = [ # suppressible-exception # https://github.com/vega/altair/pull/3431#discussion_r1629808660 "SIM105", + # pydocstyle/ https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules # + # ------------------------------------------------------------------------- # + # undocumented-public-module + "D100", + # undocumented-public-class + "D101", + # undocumented-public-method + "D102", + # undocumented-public-function + "D103", + # undocumented-public-package + "D104", + # undocumented-magic-method + "D105", + # undocumented-public-init + "D107", + # indent-with-spaces + "D206", + # multi-line-summary-first-line ((D213) is the opposite of this) + "D212", + # Imperative mood + "D401", + # Blank line after last section + "D413", + # doc-line-too-long + "W505", ] +# https://docs.astral.sh/ruff/settings/#lintpydocstyle +pydocstyle={ convention="numpy" } +mccabe={ max-complexity=18 } -[tool.ruff.lint.mccabe] -max-complexity = 18 [tool.ruff.lint.flake8-tidy-imports.banned-api] # https://docs.astral.sh/ruff/settings/#lint_flake8-tidy-imports_banned-api "typing.Optional".msg = "Use `Union[T, None]` instead.\n`typing.Optional` is likely to be confused with `altair.Optional`, which have a similar but different semantic meaning.\nSee https://github.com/vega/altair/pull/3449" +[tool.ruff.lint.per-file-ignores] +# Ignore `D` rules everywhere *except* for auto-generated code. +"!altair/vegalite/v5/schema/*.py" = ["D","D213"] + + [tool.ruff.format] quote-style = "double" indent-style = "space" skip-magic-trailing-comma = false line-ending = "lf" +# Enable once `D` are applied to non-generated code +# https://docs.astral.sh/ruff/formatter/#docstring-formatting +# docstring-code-format = true [tool.pytest.ini_options] # Pytest does not need to search these folders for test functions. From 10f693edfbe6f429bc2b763fb270e1e3cc50a569 Mon Sep 17 00:00:00 2001 From: dangotbanned <125183946+dangotbanned@users.noreply.github.com> Date: Mon, 22 Jul 2024 16:05:54 +0100 Subject: [PATCH 02/11] fix: update `.encode()` indent for method, instead of function I should have updated in https://github.com/vega/altair/pull/3444 but the problem didn't become apparent until running through `ruff` --- tools/generate_schema_wrapper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/generate_schema_wrapper.py b/tools/generate_schema_wrapper.py index 545cc4083..490d15a8f 100644 --- a/tools/generate_schema_wrapper.py +++ b/tools/generate_schema_wrapper.py @@ -892,7 +892,7 @@ def _create_encode_signature( if len(docstring_parameters) > 1: docstring_parameters += [""] docstring = indent_docstring( - docstring_parameters, indent_level=4, width=100, lstrip=False + docstring_parameters, indent_level=8, width=100, lstrip=False ) return ENCODE_METHOD.format( encode_method_args=", ".join(signature_args), docstring=docstring From 29b151dc9a6b115907a37a5ec6ab4e17ddcdfa94 Mon Sep 17 00:00:00 2001 From: dangotbanned <125183946+dangotbanned@users.noreply.github.com> Date: Mon, 22 Jul 2024 16:07:53 +0100 Subject: [PATCH 03/11] fix: Update `SchemaGenerator.docstring` to use `numpy` extended summary https://numpydoc.readthedocs.io/en/latest/format.html#extended-summary --- tools/schemapi/codegen.py | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/tools/schemapi/codegen.py b/tools/schemapi/codegen.py index ee41bfcaf..8f2fb1d4c 100644 --- a/tools/schemapi/codegen.py +++ b/tools/schemapi/codegen.py @@ -197,18 +197,22 @@ def arg_info(self) -> ArgInfo: def docstring(self, indent: int = 0) -> str: info = self.info - doc = [ - f"{self.classname} schema wrapper", - ] + # https://numpydoc.readthedocs.io/en/latest/format.html#short-summary + doc = [f"{self.classname} schema wrapper"] if info.description: - doc += self._process_description( # remove condition description - re.sub(r"\n\{\n(\n|.)*\n\}", "", info.description) - ).splitlines() - # Remove lines which contain the "raw-html" directive which cannot be processed - # by Sphinx at this level of the docstring. It works for descriptions - # of attributes which is why we do not do the same below. The removed - # lines are anyway non-descriptive for a user. - doc = [line for line in doc if ":raw-html:" not in line] + # https://numpydoc.readthedocs.io/en/latest/format.html#extended-summary + # Remove condition from description + desc: str = re.sub(r"\n\{\n(\n|.)*\n\}", "", info.description) + ext_summary: list[str] = self._process_description(desc).splitlines() + # Remove lines which contain the "raw-html" directive which cannot be processed + # by Sphinx at this level of the docstring. It works for descriptions + # of attributes which is why we do not do the same below. The removed + # lines are anyway non-descriptive for a user. + ext_summary = [line for line in ext_summary if ":raw-html:" not in line] + # Only add an extended summary if the above did not result in an empty list. + if ext_summary: + doc.append("") + doc.extend(ext_summary) if info.properties: arg_info = self.arg_info From 4267a72b7eb954ea6db2a00a1bccd00a83cea61a Mon Sep 17 00:00:00 2001 From: dangotbanned <125183946+dangotbanned@users.noreply.github.com> Date: Mon, 22 Jul 2024 16:09:49 +0100 Subject: [PATCH 04/11] build: run `generate-schema-wrapper` with new `pydocstyle` rules Rules are strictly only applied to autogenerated code currently, until the final style has been approved --- altair/vegalite/v5/schema/channels.py | 604 +++++----- altair/vegalite/v5/schema/core.py | 1450 +++++++++++++------------ altair/vegalite/v5/schema/mixins.py | 38 +- 3 files changed, 1093 insertions(+), 999 deletions(-) diff --git a/altair/vegalite/v5/schema/channels.py b/altair/vegalite/v5/schema/channels.py index 07ba8c099..5dfb64de1 100644 --- a/altair/vegalite/v5/schema/channels.py +++ b/altair/vegalite/v5/schema/channels.py @@ -141,11 +141,11 @@ def to_dict( @with_property_setters class Angle(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber): - """Angle schema wrapper + r""" + Angle schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -930,11 +930,11 @@ def __init__( @with_property_setters class AngleDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumber): - """AngleDatum schema wrapper + """ + AngleDatum schema wrapper. Parameters ---------- - bandPosition : float Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, @@ -1108,11 +1108,11 @@ def __init__( class AngleValue( ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber ): - """AngleValue schema wrapper + """ + AngleValue schema wrapper. Parameters ---------- - condition : dict, :class:`ConditionalValueDefnumberExprRef`, :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalParameterValueDefnumberExprRef`, :class:`ConditionalPredicateValueDefnumberExprRef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, Sequence[dict, :class:`ConditionalValueDefnumberExprRef`, :class:`ConditionalParameterValueDefnumberExprRef`, :class:`ConditionalPredicateValueDefnumberExprRef`] A field definition or one or more value definition(s) with a parameter predicate. value : dict, float, :class:`ExprRef` @@ -1250,11 +1250,11 @@ class Color( FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull, ): - """Color schema wrapper + r""" + Color schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -2041,11 +2041,11 @@ def __init__( class ColorDatum( DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefGradientstringnull ): - """ColorDatum schema wrapper + """ + ColorDatum schema wrapper. Parameters ---------- - bandPosition : float Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, @@ -2220,11 +2220,11 @@ class ColorValue( ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull, ): - """ColorValue schema wrapper + """ + ColorValue schema wrapper. Parameters ---------- - condition : dict, :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, :class:`ConditionalValueDefGradientstringnullExprRef`, :class:`ConditionalParameterValueDefGradientstringnullExprRef`, :class:`ConditionalPredicateValueDefGradientstringnullExprRef`, Sequence[dict, :class:`ConditionalValueDefGradientstringnullExprRef`, :class:`ConditionalParameterValueDefGradientstringnullExprRef`, :class:`ConditionalPredicateValueDefGradientstringnullExprRef`] A field definition or one or more value definition(s) with a parameter predicate. value : str, dict, None, :class:`ExprRef`, :class:`Gradient`, :class:`LinearGradient`, :class:`RadialGradient` @@ -2359,11 +2359,11 @@ def __init__( @with_property_setters class Column(FieldChannelMixin, core.RowColumnEncodingFieldDef): - """Column schema wrapper + r""" + Column schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -2965,11 +2965,11 @@ def __init__( @with_property_setters class Description(FieldChannelMixin, core.StringFieldDefWithCondition): - """Description schema wrapper + r""" + Description schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -3492,11 +3492,11 @@ def __init__( @with_property_setters class DescriptionValue(ValueChannelMixin, core.StringValueDefWithCondition): - """DescriptionValue schema wrapper + """ + DescriptionValue schema wrapper. Parameters ---------- - condition : dict, :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalValueDefstringnullExprRef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, :class:`ConditionalParameterValueDefstringnullExprRef`, :class:`ConditionalPredicateValueDefstringnullExprRef`, Sequence[dict, :class:`ConditionalValueDefstringnullExprRef`, :class:`ConditionalParameterValueDefstringnullExprRef`, :class:`ConditionalPredicateValueDefstringnullExprRef`] A field definition or one or more value definition(s) with a parameter predicate. value : str, dict, None, :class:`ExprRef` @@ -3631,12 +3631,13 @@ def __init__( @with_property_setters class Detail(FieldChannelMixin, core.FieldDefWithoutScale): - """Detail schema wrapper + r""" + Detail schema wrapper. + Definition object for a data field, its type and transformation of an encoding channel. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -4079,11 +4080,11 @@ def __init__( @with_property_setters class Facet(FieldChannelMixin, core.FacetEncodingFieldDef): - """Facet schema wrapper + r""" + Facet schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -4760,11 +4761,11 @@ class Fill( FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull, ): - """Fill schema wrapper + r""" + Fill schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -5551,11 +5552,11 @@ def __init__( class FillDatum( DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefGradientstringnull ): - """FillDatum schema wrapper + """ + FillDatum schema wrapper. Parameters ---------- - bandPosition : float Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, @@ -5730,11 +5731,11 @@ class FillValue( ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull, ): - """FillValue schema wrapper + """ + FillValue schema wrapper. Parameters ---------- - condition : dict, :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, :class:`ConditionalValueDefGradientstringnullExprRef`, :class:`ConditionalParameterValueDefGradientstringnullExprRef`, :class:`ConditionalPredicateValueDefGradientstringnullExprRef`, Sequence[dict, :class:`ConditionalValueDefGradientstringnullExprRef`, :class:`ConditionalParameterValueDefGradientstringnullExprRef`, :class:`ConditionalPredicateValueDefGradientstringnullExprRef`] A field definition or one or more value definition(s) with a parameter predicate. value : str, dict, None, :class:`ExprRef`, :class:`Gradient`, :class:`LinearGradient`, :class:`RadialGradient` @@ -5871,11 +5872,11 @@ def __init__( class FillOpacity( FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber ): - """FillOpacity schema wrapper + r""" + FillOpacity schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -6662,11 +6663,11 @@ def __init__( class FillOpacityDatum( DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumber ): - """FillOpacityDatum schema wrapper + """ + FillOpacityDatum schema wrapper. Parameters ---------- - bandPosition : float Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, @@ -6840,11 +6841,11 @@ def __init__( class FillOpacityValue( ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber ): - """FillOpacityValue schema wrapper + """ + FillOpacityValue schema wrapper. Parameters ---------- - condition : dict, :class:`ConditionalValueDefnumberExprRef`, :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalParameterValueDefnumberExprRef`, :class:`ConditionalPredicateValueDefnumberExprRef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, Sequence[dict, :class:`ConditionalValueDefnumberExprRef`, :class:`ConditionalParameterValueDefnumberExprRef`, :class:`ConditionalPredicateValueDefnumberExprRef`] A field definition or one or more value definition(s) with a parameter predicate. value : dict, float, :class:`ExprRef` @@ -6979,11 +6980,11 @@ def __init__( @with_property_setters class Href(FieldChannelMixin, core.StringFieldDefWithCondition): - """Href schema wrapper + r""" + Href schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -7506,11 +7507,11 @@ def __init__( @with_property_setters class HrefValue(ValueChannelMixin, core.StringValueDefWithCondition): - """HrefValue schema wrapper + """ + HrefValue schema wrapper. Parameters ---------- - condition : dict, :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalValueDefstringnullExprRef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, :class:`ConditionalParameterValueDefstringnullExprRef`, :class:`ConditionalPredicateValueDefstringnullExprRef`, Sequence[dict, :class:`ConditionalValueDefstringnullExprRef`, :class:`ConditionalParameterValueDefstringnullExprRef`, :class:`ConditionalPredicateValueDefstringnullExprRef`] A field definition or one or more value definition(s) with a parameter predicate. value : str, dict, None, :class:`ExprRef` @@ -7645,12 +7646,13 @@ def __init__( @with_property_setters class Key(FieldChannelMixin, core.FieldDefWithoutScale): - """Key schema wrapper + r""" + Key schema wrapper. + Definition object for a data field, its type and transformation of an encoding channel. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -8093,11 +8095,11 @@ def __init__( @with_property_setters class Latitude(FieldChannelMixin, core.LatLongFieldDef): - """Latitude schema wrapper + r""" + Latitude schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -8516,11 +8518,11 @@ def __init__( @with_property_setters class LatitudeDatum(DatumChannelMixin, core.DatumDef): - """LatitudeDatum schema wrapper + """ + LatitudeDatum schema wrapper. Parameters ---------- - bandPosition : float Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, @@ -8655,13 +8657,14 @@ def __init__( @with_property_setters class Latitude2(FieldChannelMixin, core.SecondaryFieldDef): - """Latitude2 schema wrapper + r""" + Latitude2 schema wrapper. + A field definition of a secondary channel that shares a scale with another primary channel. For example, ``x2``, ``xError`` and ``xError2`` share the same scale with ``x``. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -9006,11 +9009,11 @@ def __init__( @with_property_setters class Latitude2Datum(DatumChannelMixin, core.DatumDef): - """Latitude2Datum schema wrapper + """ + Latitude2Datum schema wrapper. Parameters ---------- - bandPosition : float Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, @@ -9145,13 +9148,14 @@ def __init__( @with_property_setters class Latitude2Value(ValueChannelMixin, core.PositionValueDef): - """Latitude2Value schema wrapper + """ + Latitude2Value schema wrapper. + Definition object for a constant value (primitive value or gradient definition) of an encoding channel. Parameters ---------- - value : str, dict, float, :class:`ExprRef` A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition `__ for color, @@ -9167,11 +9171,11 @@ def __init__(self, value, **kwds): @with_property_setters class Longitude(FieldChannelMixin, core.LatLongFieldDef): - """Longitude schema wrapper + r""" + Longitude schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -9590,11 +9594,11 @@ def __init__( @with_property_setters class LongitudeDatum(DatumChannelMixin, core.DatumDef): - """LongitudeDatum schema wrapper + """ + LongitudeDatum schema wrapper. Parameters ---------- - bandPosition : float Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, @@ -9729,13 +9733,14 @@ def __init__( @with_property_setters class Longitude2(FieldChannelMixin, core.SecondaryFieldDef): - """Longitude2 schema wrapper + r""" + Longitude2 schema wrapper. + A field definition of a secondary channel that shares a scale with another primary channel. For example, ``x2``, ``xError`` and ``xError2`` share the same scale with ``x``. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -10080,11 +10085,11 @@ def __init__( @with_property_setters class Longitude2Datum(DatumChannelMixin, core.DatumDef): - """Longitude2Datum schema wrapper + """ + Longitude2Datum schema wrapper. Parameters ---------- - bandPosition : float Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, @@ -10219,13 +10224,14 @@ def __init__( @with_property_setters class Longitude2Value(ValueChannelMixin, core.PositionValueDef): - """Longitude2Value schema wrapper + """ + Longitude2Value schema wrapper. + Definition object for a constant value (primitive value or gradient definition) of an encoding channel. Parameters ---------- - value : str, dict, float, :class:`ExprRef` A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition `__ for color, @@ -10243,11 +10249,11 @@ def __init__(self, value, **kwds): class Opacity( FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber ): - """Opacity schema wrapper + r""" + Opacity schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -11032,11 +11038,11 @@ def __init__( @with_property_setters class OpacityDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumber): - """OpacityDatum schema wrapper + """ + OpacityDatum schema wrapper. Parameters ---------- - bandPosition : float Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, @@ -11210,11 +11216,11 @@ def __init__( class OpacityValue( ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber ): - """OpacityValue schema wrapper + """ + OpacityValue schema wrapper. Parameters ---------- - condition : dict, :class:`ConditionalValueDefnumberExprRef`, :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalParameterValueDefnumberExprRef`, :class:`ConditionalPredicateValueDefnumberExprRef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, Sequence[dict, :class:`ConditionalValueDefnumberExprRef`, :class:`ConditionalParameterValueDefnumberExprRef`, :class:`ConditionalPredicateValueDefnumberExprRef`] A field definition or one or more value definition(s) with a parameter predicate. value : dict, float, :class:`ExprRef` @@ -11349,11 +11355,11 @@ def __init__( @with_property_setters class Order(FieldChannelMixin, core.OrderFieldDef): - """Order schema wrapper + r""" + Order schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -11803,11 +11809,11 @@ def __init__( @with_property_setters class OrderValue(ValueChannelMixin, core.OrderValueDef): - """OrderValue schema wrapper + """ + OrderValue schema wrapper. Parameters ---------- - value : dict, float, :class:`ExprRef` A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition `__ for color, @@ -11859,11 +11865,11 @@ def __init__( @with_property_setters class Radius(FieldChannelMixin, core.PositionFieldDefBase): - """Radius schema wrapper + r""" + Radius schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -12536,11 +12542,11 @@ def __init__( @with_property_setters class RadiusDatum(DatumChannelMixin, core.PositionDatumDefBase): - """RadiusDatum schema wrapper + """ + RadiusDatum schema wrapper. Parameters ---------- - bandPosition : float Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, @@ -12786,13 +12792,14 @@ def __init__( @with_property_setters class RadiusValue(ValueChannelMixin, core.PositionValueDef): - """RadiusValue schema wrapper + """ + RadiusValue schema wrapper. + Definition object for a constant value (primitive value or gradient definition) of an encoding channel. Parameters ---------- - value : str, dict, float, :class:`ExprRef` A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition `__ for color, @@ -12808,13 +12815,14 @@ def __init__(self, value, **kwds): @with_property_setters class Radius2(FieldChannelMixin, core.SecondaryFieldDef): - """Radius2 schema wrapper + r""" + Radius2 schema wrapper. + A field definition of a secondary channel that shares a scale with another primary channel. For example, ``x2``, ``xError`` and ``xError2`` share the same scale with ``x``. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -13159,11 +13167,11 @@ def __init__( @with_property_setters class Radius2Datum(DatumChannelMixin, core.DatumDef): - """Radius2Datum schema wrapper + """ + Radius2Datum schema wrapper. Parameters ---------- - bandPosition : float Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, @@ -13298,13 +13306,14 @@ def __init__( @with_property_setters class Radius2Value(ValueChannelMixin, core.PositionValueDef): - """Radius2Value schema wrapper + """ + Radius2Value schema wrapper. + Definition object for a constant value (primitive value or gradient definition) of an encoding channel. Parameters ---------- - value : str, dict, float, :class:`ExprRef` A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition `__ for color, @@ -13320,11 +13329,11 @@ def __init__(self, value, **kwds): @with_property_setters class Row(FieldChannelMixin, core.RowColumnEncodingFieldDef): - """Row schema wrapper + r""" + Row schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -13929,11 +13938,11 @@ class Shape( FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull, ): - """Shape schema wrapper + r""" + Shape schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -14718,11 +14727,11 @@ def __init__( class ShapeDatum( DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefstringnull ): - """ShapeDatum schema wrapper + """ + ShapeDatum schema wrapper. Parameters ---------- - bandPosition : float Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, @@ -14897,11 +14906,11 @@ class ShapeValue( ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull, ): - """ShapeValue schema wrapper + """ + ShapeValue schema wrapper. Parameters ---------- - condition : dict, :class:`ConditionalValueDefstringnullExprRef`, :class:`ConditionalParameterValueDefstringnullExprRef`, :class:`ConditionalPredicateValueDefstringnullExprRef`, :class:`ConditionalMarkPropFieldOrDatumDefTypeForShape`, :class:`ConditionalParameterMarkPropFieldOrDatumDefTypeForShape`, :class:`ConditionalPredicateMarkPropFieldOrDatumDefTypeForShape`, Sequence[dict, :class:`ConditionalValueDefstringnullExprRef`, :class:`ConditionalParameterValueDefstringnullExprRef`, :class:`ConditionalPredicateValueDefstringnullExprRef`] A field definition or one or more value definition(s) with a parameter predicate. value : str, dict, None, :class:`ExprRef` @@ -15036,11 +15045,11 @@ def __init__( @with_property_setters class Size(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber): - """Size schema wrapper + r""" + Size schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -15825,11 +15834,11 @@ def __init__( @with_property_setters class SizeDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumber): - """SizeDatum schema wrapper + """ + SizeDatum schema wrapper. Parameters ---------- - bandPosition : float Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, @@ -16003,11 +16012,11 @@ def __init__( class SizeValue( ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber ): - """SizeValue schema wrapper + """ + SizeValue schema wrapper. Parameters ---------- - condition : dict, :class:`ConditionalValueDefnumberExprRef`, :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalParameterValueDefnumberExprRef`, :class:`ConditionalPredicateValueDefnumberExprRef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, Sequence[dict, :class:`ConditionalValueDefnumberExprRef`, :class:`ConditionalParameterValueDefnumberExprRef`, :class:`ConditionalPredicateValueDefnumberExprRef`] A field definition or one or more value definition(s) with a parameter predicate. value : dict, float, :class:`ExprRef` @@ -16145,11 +16154,11 @@ class Stroke( FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull, ): - """Stroke schema wrapper + r""" + Stroke schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -16936,11 +16945,11 @@ def __init__( class StrokeDatum( DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefGradientstringnull ): - """StrokeDatum schema wrapper + """ + StrokeDatum schema wrapper. Parameters ---------- - bandPosition : float Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, @@ -17115,11 +17124,11 @@ class StrokeValue( ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull, ): - """StrokeValue schema wrapper + """ + StrokeValue schema wrapper. Parameters ---------- - condition : dict, :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, :class:`ConditionalValueDefGradientstringnullExprRef`, :class:`ConditionalParameterValueDefGradientstringnullExprRef`, :class:`ConditionalPredicateValueDefGradientstringnullExprRef`, Sequence[dict, :class:`ConditionalValueDefGradientstringnullExprRef`, :class:`ConditionalParameterValueDefGradientstringnullExprRef`, :class:`ConditionalPredicateValueDefGradientstringnullExprRef`] A field definition or one or more value definition(s) with a parameter predicate. value : str, dict, None, :class:`ExprRef`, :class:`Gradient`, :class:`LinearGradient`, :class:`RadialGradient` @@ -17256,11 +17265,11 @@ def __init__( class StrokeDash( FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray ): - """StrokeDash schema wrapper + r""" + StrokeDash schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -18047,11 +18056,11 @@ def __init__( class StrokeDashDatum( DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumberArray ): - """StrokeDashDatum schema wrapper + """ + StrokeDashDatum schema wrapper. Parameters ---------- - bandPosition : float Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, @@ -18225,11 +18234,11 @@ def __init__( class StrokeDashValue( ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray ): - """StrokeDashValue schema wrapper + """ + StrokeDashValue schema wrapper. Parameters ---------- - condition : dict, :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalValueDefnumberArrayExprRef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, :class:`ConditionalParameterValueDefnumberArrayExprRef`, :class:`ConditionalPredicateValueDefnumberArrayExprRef`, Sequence[dict, :class:`ConditionalValueDefnumberArrayExprRef`, :class:`ConditionalParameterValueDefnumberArrayExprRef`, :class:`ConditionalPredicateValueDefnumberArrayExprRef`] A field definition or one or more value definition(s) with a parameter predicate. value : dict, Sequence[float], :class:`ExprRef` @@ -18366,11 +18375,11 @@ def __init__( class StrokeOpacity( FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber ): - """StrokeOpacity schema wrapper + r""" + StrokeOpacity schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -19157,11 +19166,11 @@ def __init__( class StrokeOpacityDatum( DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumber ): - """StrokeOpacityDatum schema wrapper + """ + StrokeOpacityDatum schema wrapper. Parameters ---------- - bandPosition : float Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, @@ -19335,11 +19344,11 @@ def __init__( class StrokeOpacityValue( ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber ): - """StrokeOpacityValue schema wrapper + """ + StrokeOpacityValue schema wrapper. Parameters ---------- - condition : dict, :class:`ConditionalValueDefnumberExprRef`, :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalParameterValueDefnumberExprRef`, :class:`ConditionalPredicateValueDefnumberExprRef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, Sequence[dict, :class:`ConditionalValueDefnumberExprRef`, :class:`ConditionalParameterValueDefnumberExprRef`, :class:`ConditionalPredicateValueDefnumberExprRef`] A field definition or one or more value definition(s) with a parameter predicate. value : dict, float, :class:`ExprRef` @@ -19476,11 +19485,11 @@ def __init__( class StrokeWidth( FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber ): - """StrokeWidth schema wrapper + r""" + StrokeWidth schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -20267,11 +20276,11 @@ def __init__( class StrokeWidthDatum( DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumber ): - """StrokeWidthDatum schema wrapper + """ + StrokeWidthDatum schema wrapper. Parameters ---------- - bandPosition : float Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, @@ -20445,11 +20454,11 @@ def __init__( class StrokeWidthValue( ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber ): - """StrokeWidthValue schema wrapper + """ + StrokeWidthValue schema wrapper. Parameters ---------- - condition : dict, :class:`ConditionalValueDefnumberExprRef`, :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalParameterValueDefnumberExprRef`, :class:`ConditionalPredicateValueDefnumberExprRef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, Sequence[dict, :class:`ConditionalValueDefnumberExprRef`, :class:`ConditionalParameterValueDefnumberExprRef`, :class:`ConditionalPredicateValueDefnumberExprRef`] A field definition or one or more value definition(s) with a parameter predicate. value : dict, float, :class:`ExprRef` @@ -20584,11 +20593,11 @@ def __init__( @with_property_setters class Text(FieldChannelMixin, core.FieldOrDatumDefWithConditionStringFieldDefText): - """Text schema wrapper + r""" + Text schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -21115,11 +21124,11 @@ def __init__( @with_property_setters class TextDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionStringDatumDefText): - """TextDatum schema wrapper + """ + TextDatum schema wrapper. Parameters ---------- - bandPosition : float Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, @@ -21342,11 +21351,11 @@ def __init__( @with_property_setters class TextValue(ValueChannelMixin, core.ValueDefWithConditionStringFieldDefText): - """TextValue schema wrapper + """ + TextValue schema wrapper. Parameters ---------- - condition : dict, :class:`ConditionalStringFieldDef`, :class:`ConditionalValueDefTextExprRef`, :class:`ConditionalParameterStringFieldDef`, :class:`ConditionalPredicateStringFieldDef`, :class:`ConditionalParameterValueDefTextExprRef`, :class:`ConditionalPredicateValueDefTextExprRef`, Sequence[dict, :class:`ConditionalValueDefTextExprRef`, :class:`ConditionalParameterValueDefTextExprRef`, :class:`ConditionalPredicateValueDefTextExprRef`] A field definition or one or more value definition(s) with a parameter predicate. value : str, dict, :class:`Text`, Sequence[str], :class:`ExprRef` @@ -21434,11 +21443,11 @@ def __init__( @with_property_setters class Theta(FieldChannelMixin, core.PositionFieldDefBase): - """Theta schema wrapper + r""" + Theta schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -22111,11 +22120,11 @@ def __init__( @with_property_setters class ThetaDatum(DatumChannelMixin, core.PositionDatumDefBase): - """ThetaDatum schema wrapper + """ + ThetaDatum schema wrapper. Parameters ---------- - bandPosition : float Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, @@ -22361,13 +22370,14 @@ def __init__( @with_property_setters class ThetaValue(ValueChannelMixin, core.PositionValueDef): - """ThetaValue schema wrapper + """ + ThetaValue schema wrapper. + Definition object for a constant value (primitive value or gradient definition) of an encoding channel. Parameters ---------- - value : str, dict, float, :class:`ExprRef` A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition `__ for color, @@ -22383,13 +22393,14 @@ def __init__(self, value, **kwds): @with_property_setters class Theta2(FieldChannelMixin, core.SecondaryFieldDef): - """Theta2 schema wrapper + r""" + Theta2 schema wrapper. + A field definition of a secondary channel that shares a scale with another primary channel. For example, ``x2``, ``xError`` and ``xError2`` share the same scale with ``x``. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -22734,11 +22745,11 @@ def __init__( @with_property_setters class Theta2Datum(DatumChannelMixin, core.DatumDef): - """Theta2Datum schema wrapper + """ + Theta2Datum schema wrapper. Parameters ---------- - bandPosition : float Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, @@ -22873,13 +22884,14 @@ def __init__( @with_property_setters class Theta2Value(ValueChannelMixin, core.PositionValueDef): - """Theta2Value schema wrapper + """ + Theta2Value schema wrapper. + Definition object for a constant value (primitive value or gradient definition) of an encoding channel. Parameters ---------- - value : str, dict, float, :class:`ExprRef` A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition `__ for color, @@ -22895,11 +22907,11 @@ def __init__(self, value, **kwds): @with_property_setters class Tooltip(FieldChannelMixin, core.StringFieldDefWithCondition): - """Tooltip schema wrapper + r""" + Tooltip schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -23422,11 +23434,11 @@ def __init__( @with_property_setters class TooltipValue(ValueChannelMixin, core.StringValueDefWithCondition): - """TooltipValue schema wrapper + """ + TooltipValue schema wrapper. Parameters ---------- - condition : dict, :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalValueDefstringnullExprRef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, :class:`ConditionalParameterValueDefstringnullExprRef`, :class:`ConditionalPredicateValueDefstringnullExprRef`, Sequence[dict, :class:`ConditionalValueDefstringnullExprRef`, :class:`ConditionalParameterValueDefstringnullExprRef`, :class:`ConditionalPredicateValueDefstringnullExprRef`] A field definition or one or more value definition(s) with a parameter predicate. value : str, dict, None, :class:`ExprRef` @@ -23561,11 +23573,11 @@ def __init__( @with_property_setters class Url(FieldChannelMixin, core.StringFieldDefWithCondition): - """Url schema wrapper + r""" + Url schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -24088,11 +24100,11 @@ def __init__( @with_property_setters class UrlValue(ValueChannelMixin, core.StringValueDefWithCondition): - """UrlValue schema wrapper + """ + UrlValue schema wrapper. Parameters ---------- - condition : dict, :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalValueDefstringnullExprRef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, :class:`ConditionalParameterValueDefstringnullExprRef`, :class:`ConditionalPredicateValueDefstringnullExprRef`, Sequence[dict, :class:`ConditionalValueDefstringnullExprRef`, :class:`ConditionalParameterValueDefstringnullExprRef`, :class:`ConditionalPredicateValueDefstringnullExprRef`] A field definition or one or more value definition(s) with a parameter predicate. value : str, dict, None, :class:`ExprRef` @@ -24227,11 +24239,11 @@ def __init__( @with_property_setters class X(FieldChannelMixin, core.PositionFieldDef): - """X schema wrapper + r""" + X schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -25059,11 +25071,11 @@ def __init__( @with_property_setters class XDatum(DatumChannelMixin, core.PositionDatumDef): - """XDatum schema wrapper + """ + XDatum schema wrapper. Parameters ---------- - axis : dict, None, :class:`Axis` An object defining properties of axis's gridlines, ticks and labels. If ``null``, the axis for the encoding channel will be removed. @@ -25462,13 +25474,14 @@ def __init__( @with_property_setters class XValue(ValueChannelMixin, core.PositionValueDef): - """XValue schema wrapper + """ + XValue schema wrapper. + Definition object for a constant value (primitive value or gradient definition) of an encoding channel. Parameters ---------- - value : str, dict, float, :class:`ExprRef` A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition `__ for color, @@ -25484,13 +25497,14 @@ def __init__(self, value, **kwds): @with_property_setters class X2(FieldChannelMixin, core.SecondaryFieldDef): - """X2 schema wrapper + r""" + X2 schema wrapper. + A field definition of a secondary channel that shares a scale with another primary channel. For example, ``x2``, ``xError`` and ``xError2`` share the same scale with ``x``. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -25835,11 +25849,11 @@ def __init__( @with_property_setters class X2Datum(DatumChannelMixin, core.DatumDef): - """X2Datum schema wrapper + """ + X2Datum schema wrapper. Parameters ---------- - bandPosition : float Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, @@ -25974,13 +25988,14 @@ def __init__( @with_property_setters class X2Value(ValueChannelMixin, core.PositionValueDef): - """X2Value schema wrapper + """ + X2Value schema wrapper. + Definition object for a constant value (primitive value or gradient definition) of an encoding channel. Parameters ---------- - value : str, dict, float, :class:`ExprRef` A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition `__ for color, @@ -25996,13 +26011,14 @@ def __init__(self, value, **kwds): @with_property_setters class XError(FieldChannelMixin, core.SecondaryFieldDef): - """XError schema wrapper + r""" + XError schema wrapper. + A field definition of a secondary channel that shares a scale with another primary channel. For example, ``x2``, ``xError`` and ``xError2`` share the same scale with ``x``. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -26347,13 +26363,14 @@ def __init__( @with_property_setters class XErrorValue(ValueChannelMixin, core.ValueDefnumber): - """XErrorValue schema wrapper + """ + XErrorValue schema wrapper. + Definition object for a constant value (primitive value or gradient definition) of an encoding channel. Parameters ---------- - value : float A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition `__ for color, @@ -26369,13 +26386,14 @@ def __init__(self, value, **kwds): @with_property_setters class XError2(FieldChannelMixin, core.SecondaryFieldDef): - """XError2 schema wrapper + r""" + XError2 schema wrapper. + A field definition of a secondary channel that shares a scale with another primary channel. For example, ``x2``, ``xError`` and ``xError2`` share the same scale with ``x``. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -26720,13 +26738,14 @@ def __init__( @with_property_setters class XError2Value(ValueChannelMixin, core.ValueDefnumber): - """XError2Value schema wrapper + """ + XError2Value schema wrapper. + Definition object for a constant value (primitive value or gradient definition) of an encoding channel. Parameters ---------- - value : float A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition `__ for color, @@ -26742,11 +26761,11 @@ def __init__(self, value, **kwds): @with_property_setters class XOffset(FieldChannelMixin, core.ScaleFieldDef): - """XOffset schema wrapper + r""" + XOffset schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -27374,11 +27393,11 @@ def __init__( @with_property_setters class XOffsetDatum(DatumChannelMixin, core.ScaleDatumDef): - """XOffsetDatum schema wrapper + """ + XOffsetDatum schema wrapper. Parameters ---------- - bandPosition : float Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, @@ -27580,13 +27599,14 @@ def __init__( @with_property_setters class XOffsetValue(ValueChannelMixin, core.ValueDefnumber): - """XOffsetValue schema wrapper + """ + XOffsetValue schema wrapper. + Definition object for a constant value (primitive value or gradient definition) of an encoding channel. Parameters ---------- - value : float A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition `__ for color, @@ -27602,11 +27622,11 @@ def __init__(self, value, **kwds): @with_property_setters class Y(FieldChannelMixin, core.PositionFieldDef): - """Y schema wrapper + r""" + Y schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -28434,11 +28454,11 @@ def __init__( @with_property_setters class YDatum(DatumChannelMixin, core.PositionDatumDef): - """YDatum schema wrapper + """ + YDatum schema wrapper. Parameters ---------- - axis : dict, None, :class:`Axis` An object defining properties of axis's gridlines, ticks and labels. If ``null``, the axis for the encoding channel will be removed. @@ -28837,13 +28857,14 @@ def __init__( @with_property_setters class YValue(ValueChannelMixin, core.PositionValueDef): - """YValue schema wrapper + """ + YValue schema wrapper. + Definition object for a constant value (primitive value or gradient definition) of an encoding channel. Parameters ---------- - value : str, dict, float, :class:`ExprRef` A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition `__ for color, @@ -28859,13 +28880,14 @@ def __init__(self, value, **kwds): @with_property_setters class Y2(FieldChannelMixin, core.SecondaryFieldDef): - """Y2 schema wrapper + r""" + Y2 schema wrapper. + A field definition of a secondary channel that shares a scale with another primary channel. For example, ``x2``, ``xError`` and ``xError2`` share the same scale with ``x``. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -29210,11 +29232,11 @@ def __init__( @with_property_setters class Y2Datum(DatumChannelMixin, core.DatumDef): - """Y2Datum schema wrapper + """ + Y2Datum schema wrapper. Parameters ---------- - bandPosition : float Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, @@ -29349,13 +29371,14 @@ def __init__( @with_property_setters class Y2Value(ValueChannelMixin, core.PositionValueDef): - """Y2Value schema wrapper + """ + Y2Value schema wrapper. + Definition object for a constant value (primitive value or gradient definition) of an encoding channel. Parameters ---------- - value : str, dict, float, :class:`ExprRef` A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition `__ for color, @@ -29371,13 +29394,14 @@ def __init__(self, value, **kwds): @with_property_setters class YError(FieldChannelMixin, core.SecondaryFieldDef): - """YError schema wrapper + r""" + YError schema wrapper. + A field definition of a secondary channel that shares a scale with another primary channel. For example, ``x2``, ``xError`` and ``xError2`` share the same scale with ``x``. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -29722,13 +29746,14 @@ def __init__( @with_property_setters class YErrorValue(ValueChannelMixin, core.ValueDefnumber): - """YErrorValue schema wrapper + """ + YErrorValue schema wrapper. + Definition object for a constant value (primitive value or gradient definition) of an encoding channel. Parameters ---------- - value : float A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition `__ for color, @@ -29744,13 +29769,14 @@ def __init__(self, value, **kwds): @with_property_setters class YError2(FieldChannelMixin, core.SecondaryFieldDef): - """YError2 schema wrapper + r""" + YError2 schema wrapper. + A field definition of a secondary channel that shares a scale with another primary channel. For example, ``x2``, ``xError`` and ``xError2`` share the same scale with ``x``. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -30095,13 +30121,14 @@ def __init__( @with_property_setters class YError2Value(ValueChannelMixin, core.ValueDefnumber): - """YError2Value schema wrapper + """ + YError2Value schema wrapper. + Definition object for a constant value (primitive value or gradient definition) of an encoding channel. Parameters ---------- - value : float A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition `__ for color, @@ -30117,11 +30144,11 @@ def __init__(self, value, **kwds): @with_property_setters class YOffset(FieldChannelMixin, core.ScaleFieldDef): - """YOffset schema wrapper + r""" + YOffset schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -30749,11 +30776,11 @@ def __init__( @with_property_setters class YOffsetDatum(DatumChannelMixin, core.ScaleDatumDef): - """YOffsetDatum schema wrapper + """ + YOffsetDatum schema wrapper. Parameters ---------- - bandPosition : float Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, @@ -30955,13 +30982,14 @@ def __init__( @with_property_setters class YOffsetValue(ValueChannelMixin, core.ValueDefnumber): - """YOffsetValue schema wrapper + """ + YOffsetValue schema wrapper. + Definition object for a constant value (primitive value or gradient definition) of an encoding channel. Parameters ---------- - value : float A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition `__ for color, @@ -31040,44 +31068,48 @@ def encode( str | YOffset | Map | YOffsetDatum | YOffsetValue ] = Undefined, ) -> Self: - """Map properties of the data to visual properties of the chart (see :class:`FacetedEncoding`) + """ + Map properties of the data to visual properties of the chart (see :class:`FacetedEncoding`). Parameters ---------- angle : str, :class:`Angle`, Dict, :class:`AngleDatum`, :class:`AngleValue` Rotation angle of point and text marks. color : str, :class:`Color`, Dict, :class:`ColorDatum`, :class:`ColorValue` - Color of the marks - either fill or stroke color based on the ``filled`` property - of mark definition. By default, ``color`` represents fill color for ``"area"``, - ``"bar"``, ``"tick"``, ``"text"``, ``"trail"``, ``"circle"``, and ``"square"`` / - stroke color for ``"line"`` and ``"point"``. + Color of the marks - either fill or stroke color based on the ``filled`` + property of mark definition. By default, ``color`` represents fill color for + ``"area"``, ``"bar"``, ``"tick"``, ``"text"``, ``"trail"``, ``"circle"``, + and ``"square"`` / stroke color for ``"line"`` and ``"point"``. **Default value:** If undefined, the default color depends on `mark config - `__ 's ``color`` - property. - - *Note:* 1) For fine-grained control over both fill and stroke colors of the marks, - please use the ``fill`` and ``stroke`` channels. The ``fill`` or ``stroke`` - encodings have higher precedence than ``color``, thus may override the ``color`` - encoding if conflicting encodings are specified. 2) See the scale documentation for - more information about customizing `color scheme - `__. + `__ 's + ``color`` property. + + *Note:* 1) For fine-grained control over both fill and stroke colors of the + marks, please use the ``fill`` and ``stroke`` channels. The ``fill`` or + ``stroke`` encodings have higher precedence than ``color``, thus may + override the ``color`` encoding if conflicting encodings are specified. 2) + See the scale documentation for more information about customizing `color + scheme `__. column : str, :class:`Column`, Dict A field definition for the horizontal facet of trellis plots. description : str, :class:`Description`, Dict, :class:`DescriptionValue` - A text description of this mark for ARIA accessibility (SVG output only). For SVG - output the ``"aria-label"`` attribute will be set to this description. + A text description of this mark for ARIA accessibility (SVG output only). + For SVG output the ``"aria-label"`` attribute will be set to this + description. detail : str, :class:`Detail`, Dict, List - Additional levels of detail for grouping data in aggregate views and in line, trail, - and area marks without mapping data to a specific visual channel. + Additional levels of detail for grouping data in aggregate views and in + line, trail, and area marks without mapping data to a specific visual + channel. facet : str, :class:`Facet`, Dict A field definition for the (flexible) facet of trellis plots. If either ``row`` or ``column`` is specified, this channel will be ignored. fill : str, :class:`Fill`, Dict, :class:`FillDatum`, :class:`FillValue` - Fill color of the marks. **Default value:** If undefined, the default color depends - on `mark config `__ - 's ``color`` property. + Fill color of the marks. **Default value:** If undefined, the default color + depends on `mark config + `__ 's + ``color`` property. *Note:* The ``fill`` encoding has higher precedence than ``color``, thus may override the ``color`` encoding if conflicting encodings are specified. @@ -31090,41 +31122,42 @@ def encode( href : str, :class:`Href`, Dict, :class:`HrefValue` A URL to load upon mouse click. key : str, :class:`Key`, Dict - A data field to use as a unique key for data binding. When a visualization's data is - updated, the key value will be used to match data elements to existing mark - instances. Use a key channel to enable object constancy for transitions over dynamic - data. + A data field to use as a unique key for data binding. When a visualization's + data is updated, the key value will be used to match data elements to + existing mark instances. Use a key channel to enable object constancy for + transitions over dynamic data. latitude : str, :class:`Latitude`, Dict, :class:`LatitudeDatum` Latitude position of geographically projected marks. latitude2 : str, :class:`Latitude2`, Dict, :class:`Latitude2Datum`, :class:`Latitude2Value` - Latitude-2 position for geographically projected ranged ``"area"``, ``"bar"``, - ``"rect"``, and ``"rule"``. + Latitude-2 position for geographically projected ranged ``"area"``, + ``"bar"``, ``"rect"``, and ``"rule"``. longitude : str, :class:`Longitude`, Dict, :class:`LongitudeDatum` Longitude position of geographically projected marks. longitude2 : str, :class:`Longitude2`, Dict, :class:`Longitude2Datum`, :class:`Longitude2Value` - Longitude-2 position for geographically projected ranged ``"area"``, ``"bar"``, - ``"rect"``, and ``"rule"``. + Longitude-2 position for geographically projected ranged ``"area"``, + ``"bar"``, ``"rect"``, and ``"rule"``. opacity : str, :class:`Opacity`, Dict, :class:`OpacityDatum`, :class:`OpacityValue` Opacity of the marks. **Default value:** If undefined, the default opacity depends on `mark config - `__ 's ``opacity`` - property. + `__ 's + ``opacity`` property. order : str, :class:`Order`, Dict, List, :class:`OrderValue` Order of the marks. * For stacked marks, this ``order`` channel encodes `stack order `__. - * For line and trail marks, this ``order`` channel encodes order of data points in - the lines. This can be useful for creating `a connected scatterplot - `__. Setting - ``order`` to ``{"value": null}`` makes the line marks use the original order in - the data sources. + * For line and trail marks, this ``order`` channel encodes order of data + points in the lines. This can be useful for creating `a connected + scatterplot + `__. + Setting ``order`` to ``{"value": null}`` makes the line marks use the + original order in the data sources. * Otherwise, this ``order`` channel encodes layer order of the marks. - **Note** : In aggregate plots, ``order`` field should be ``aggregate`` d to avoid - creating additional aggregation grouping. + **Note** : In aggregate plots, ``order`` field should be ``aggregate`` d to + avoid creating additional aggregation grouping. radius : str, :class:`Radius`, Dict, :class:`RadiusDatum`, :class:`RadiusValue` The outer radius in pixels of arc marks. radius2 : str, :class:`Radius2`, Dict, :class:`Radius2Datum`, :class:`Radius2Value` @@ -31136,39 +31169,40 @@ def encode( #. - For ``point`` marks the supported values include: - plotting shapes: ``"circle"``, - ``"square"``, ``"cross"``, ``"diamond"``, ``"triangle-up"``, ``"triangle-down"``, - ``"triangle-right"``, or ``"triangle-left"``. - the line symbol ``"stroke"`` - - centered directional shapes ``"arrow"``, ``"wedge"``, or ``"triangle"`` - a custom - `SVG path string - `__ (For correct - sizing, custom shape paths should be defined within a square bounding box with - coordinates ranging from -1 to 1 along both the x and y dimensions.) + For ``point`` marks the supported values include: - plotting shapes: + ``"circle"``, ``"square"``, ``"cross"``, ``"diamond"``, ``"triangle-up"``, + ``"triangle-down"``, ``"triangle-right"``, or ``"triangle-left"``. - the + line symbol ``"stroke"`` - centered directional shapes ``"arrow"``, + ``"wedge"``, or ``"triangle"`` - a custom `SVG path string + `__ (For + correct sizing, custom shape paths should be defined within a square + bounding box with coordinates ranging from -1 to 1 along both the x and y + dimensions.) #. For ``geoshape`` marks it should be a field definition of the geojson data **Default value:** If undefined, the default shape depends on `mark config - `__ 's ``shape`` - property. ( ``"circle"`` if unset.) + `__ 's + ``shape`` property. ( ``"circle"`` if unset.) size : str, :class:`Size`, Dict, :class:`SizeDatum`, :class:`SizeValue` Size of the mark. - * For ``"point"``, ``"square"`` and ``"circle"``, - the symbol size, or pixel area - of the mark. + * For ``"point"``, ``"square"`` and ``"circle"``, - the symbol size, or + pixel area of the mark. * For ``"bar"`` and ``"tick"`` - the bar and tick's size. * For ``"text"`` - the text's font size. - * Size is unsupported for ``"line"``, ``"area"``, and ``"rect"``. (Use ``"trail"`` - instead of line with varying size) + * Size is unsupported for ``"line"``, ``"area"``, and ``"rect"``. (Use + ``"trail"`` instead of line with varying size) stroke : str, :class:`Stroke`, Dict, :class:`StrokeDatum`, :class:`StrokeValue` - Stroke color of the marks. **Default value:** If undefined, the default color - depends on `mark config - `__ 's ``color`` - property. + Stroke color of the marks. **Default value:** If undefined, the default + color depends on `mark config + `__ 's + ``color`` property. - *Note:* The ``stroke`` encoding has higher precedence than ``color``, thus may - override the ``color`` encoding if conflicting encodings are specified. + *Note:* The ``stroke`` encoding has higher precedence than ``color``, thus + may override the ``color`` encoding if conflicting encodings are specified. strokeDash : str, :class:`StrokeDash`, Dict, :class:`StrokeDashDatum`, :class:`StrokeDashValue` Stroke dash of the marks. @@ -31182,23 +31216,23 @@ def encode( strokeWidth : str, :class:`StrokeWidth`, Dict, :class:`StrokeWidthDatum`, :class:`StrokeWidthValue` Stroke width of the marks. - **Default value:** If undefined, the default stroke width depends on `mark config - `__ 's + **Default value:** If undefined, the default stroke width depends on `mark + config `__ 's ``strokeWidth`` property. text : str, :class:`Text`, Dict, :class:`TextDatum`, :class:`TextValue` Text of the ``text`` mark. theta : str, :class:`Theta`, Dict, :class:`ThetaDatum`, :class:`ThetaValue` - For arc marks, the arc length in radians if theta2 is not specified, otherwise the - start arc angle. (A value of 0 indicates up or “north”, increasing values proceed - clockwise.) + For arc marks, the arc length in radians if theta2 is not specified, + otherwise the start arc angle. (A value of 0 indicates up or “north”, + increasing values proceed clockwise.) For text marks, polar coordinate angle in radians. theta2 : str, :class:`Theta2`, Dict, :class:`Theta2Datum`, :class:`Theta2Value` The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise. tooltip : str, :class:`Tooltip`, Dict, List, :class:`TooltipValue` - The tooltip text to show upon mouse hover. Specifying ``tooltip`` encoding overrides - `the tooltip property in the mark definition + The tooltip text to show upon mouse hover. Specifying ``tooltip`` encoding + overrides `the tooltip property in the mark definition `__. See the `tooltip `__ @@ -31206,39 +31240,43 @@ def encode( url : str, :class:`Url`, Dict, :class:`UrlValue` The URL of an image mark. x : str, :class:`X`, Dict, :class:`XDatum`, :class:`XValue` - X coordinates of the marks, or width of horizontal ``"bar"`` and ``"area"`` without - specified ``x2`` or ``width``. + X coordinates of the marks, or width of horizontal ``"bar"`` and ``"area"`` + without specified ``x2`` or ``width``. - The ``value`` of this channel can be a number or a string ``"width"`` for the width - of the plot. + The ``value`` of this channel can be a number or a string ``"width"`` for + the width of the plot. x2 : str, :class:`X2`, Dict, :class:`X2Datum`, :class:`X2Value` - X2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. + X2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and + ``"rule"``. - The ``value`` of this channel can be a number or a string ``"width"`` for the width - of the plot. + The ``value`` of this channel can be a number or a string ``"width"`` for + the width of the plot. xError : str, :class:`XError`, Dict, :class:`XErrorValue` - Error value of x coordinates for error specified ``"errorbar"`` and ``"errorband"``. - xError2 : str, :class:`XError2`, Dict, :class:`XError2Value` - Secondary error value of x coordinates for error specified ``"errorbar"`` and + Error value of x coordinates for error specified ``"errorbar"`` and ``"errorband"``. + xError2 : str, :class:`XError2`, Dict, :class:`XError2Value` + Secondary error value of x coordinates for error specified ``"errorbar"`` + and ``"errorband"``. xOffset : str, :class:`XOffset`, Dict, :class:`XOffsetDatum`, :class:`XOffsetValue` Offset of x-position of the marks y : str, :class:`Y`, Dict, :class:`YDatum`, :class:`YValue` - Y coordinates of the marks, or height of vertical ``"bar"`` and ``"area"`` without - specified ``y2`` or ``height``. + Y coordinates of the marks, or height of vertical ``"bar"`` and ``"area"`` + without specified ``y2`` or ``height``. - The ``value`` of this channel can be a number or a string ``"height"`` for the - height of the plot. + The ``value`` of this channel can be a number or a string ``"height"`` for + the height of the plot. y2 : str, :class:`Y2`, Dict, :class:`Y2Datum`, :class:`Y2Value` - Y2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. + Y2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and + ``"rule"``. - The ``value`` of this channel can be a number or a string ``"height"`` for the - height of the plot. + The ``value`` of this channel can be a number or a string ``"height"`` for + the height of the plot. yError : str, :class:`YError`, Dict, :class:`YErrorValue` - Error value of y coordinates for error specified ``"errorbar"`` and ``"errorband"``. - yError2 : str, :class:`YError2`, Dict, :class:`YError2Value` - Secondary error value of y coordinates for error specified ``"errorbar"`` and + Error value of y coordinates for error specified ``"errorbar"`` and ``"errorband"``. + yError2 : str, :class:`YError2`, Dict, :class:`YError2Value` + Secondary error value of y coordinates for error specified ``"errorbar"`` + and ``"errorband"``. yOffset : str, :class:`YOffset`, Dict, :class:`YOffsetDatum`, :class:`YOffsetValue` Offset of y-position of the marks """ diff --git a/altair/vegalite/v5/schema/core.py b/altair/vegalite/v5/schema/core.py index 89f35d0dd..cfdda875d 100644 --- a/altair/vegalite/v5/schema/core.py +++ b/altair/vegalite/v5/schema/core.py @@ -478,7 +478,7 @@ def load_schema() -> dict: - """Load the json schema associated with this module's functions""" + """Load the json schema associated with this module's functions.""" schema_bytes = pkgutil.get_data(__name__, "vega-lite-schema.json") if schema_bytes is None: msg = "Unable to load vega-lite-schema.json" @@ -495,7 +495,9 @@ def _default_wrapper_classes(cls) -> Iterator[type[Any]]: class Root(VegaLiteSchema): - """Root schema wrapper + """ + Root schema wrapper. + A Vega-Lite top-level specification. This is the root class for all Vega-Lite specifications. (The json schema is generated from this type.) """ @@ -507,7 +509,7 @@ def __init__(self, *args, **kwds): class Aggregate(VegaLiteSchema): - """Aggregate schema wrapper""" + """Aggregate schema wrapper.""" _schema = {"$ref": "#/definitions/Aggregate"} @@ -516,7 +518,7 @@ def __init__(self, *args, **kwds): class AggregateOp(VegaLiteSchema): - """AggregateOp schema wrapper""" + """AggregateOp schema wrapper.""" _schema = {"$ref": "#/definitions/AggregateOp"} @@ -525,11 +527,11 @@ def __init__(self, *args): class AggregatedFieldDef(VegaLiteSchema): - """AggregatedFieldDef schema wrapper + """ + AggregatedFieldDef schema wrapper. Parameters ---------- - op : :class:`AggregateOp`, Literal['argmax', 'argmin', 'average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] The aggregation operation to apply to the fields (e.g., ``"sum"``, ``"average"``, or ``"count"`` ). See the `full list of supported aggregation operations @@ -553,7 +555,7 @@ def __init__( class Align(VegaLiteSchema): - """Align schema wrapper""" + """Align schema wrapper.""" _schema = {"$ref": "#/definitions/Align"} @@ -562,7 +564,7 @@ def __init__(self, *args): class AnyMark(VegaLiteSchema): - """AnyMark schema wrapper""" + """AnyMark schema wrapper.""" _schema = {"$ref": "#/definitions/AnyMark"} @@ -571,7 +573,7 @@ def __init__(self, *args, **kwds): class AnyMarkConfig(VegaLiteSchema): - """AnyMarkConfig schema wrapper""" + """AnyMarkConfig schema wrapper.""" _schema = {"$ref": "#/definitions/AnyMarkConfig"} @@ -580,11 +582,11 @@ def __init__(self, *args, **kwds): class AreaConfig(AnyMarkConfig): - """AreaConfig schema wrapper + """ + AreaConfig schema wrapper. Parameters ---------- - align : dict, :class:`Align`, :class:`ExprRef`, Literal['left', 'center', 'right'] The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of ``"left"``, ``"right"``, ``"center"``. @@ -1164,11 +1166,11 @@ def __init__( class ArgmaxDef(Aggregate): - """ArgmaxDef schema wrapper + """ + ArgmaxDef schema wrapper. Parameters ---------- - argmax : str, :class:`FieldName` """ @@ -1180,11 +1182,11 @@ def __init__(self, argmax: Optional[str | SchemaBase] = Undefined, **kwds): class ArgminDef(Aggregate): - """ArgminDef schema wrapper + """ + ArgminDef schema wrapper. Parameters ---------- - argmin : str, :class:`FieldName` """ @@ -1196,11 +1198,11 @@ def __init__(self, argmin: Optional[str | SchemaBase] = Undefined, **kwds): class AutoSizeParams(VegaLiteSchema): - """AutoSizeParams schema wrapper + """ + AutoSizeParams schema wrapper. Parameters ---------- - contains : Literal['content', 'padding'] Determines how size calculation should be performed, one of ``"content"`` or ``"padding"``. The default setting ( ``"content"`` ) interprets the width and height @@ -1237,7 +1239,7 @@ def __init__( class AutosizeType(VegaLiteSchema): - """AutosizeType schema wrapper""" + """AutosizeType schema wrapper.""" _schema = {"$ref": "#/definitions/AutosizeType"} @@ -1246,11 +1248,11 @@ def __init__(self, *args): class Axis(VegaLiteSchema): - """Axis schema wrapper + """ + Axis schema wrapper. Parameters ---------- - aria : bool, dict, :class:`ExprRef` A boolean flag indicating if `ARIA attributes `__ should be @@ -1822,11 +1824,11 @@ def __init__( class AxisConfig(VegaLiteSchema): - """AxisConfig schema wrapper + """ + AxisConfig schema wrapper. Parameters ---------- - aria : bool, dict, :class:`ExprRef` A boolean flag indicating if `ARIA attributes `__ should be @@ -2402,7 +2404,7 @@ def __init__( class AxisOrient(VegaLiteSchema): - """AxisOrient schema wrapper""" + """AxisOrient schema wrapper.""" _schema = {"$ref": "#/definitions/AxisOrient"} @@ -2411,11 +2413,11 @@ def __init__(self, *args): class AxisResolveMap(VegaLiteSchema): - """AxisResolveMap schema wrapper + """ + AxisResolveMap schema wrapper. Parameters ---------- - x : :class:`ResolveMode`, Literal['independent', 'shared'] y : :class:`ResolveMode`, Literal['independent', 'shared'] @@ -2434,7 +2436,9 @@ def __init__( class BBox(VegaLiteSchema): - """BBox schema wrapper + """ + BBox schema wrapper. + Bounding box https://tools.ietf.org/html/rfc7946#section-5 """ @@ -2445,11 +2449,11 @@ def __init__(self, *args, **kwds): class BarConfig(AnyMarkConfig): - """BarConfig schema wrapper + """ + BarConfig schema wrapper. Parameters ---------- - align : dict, :class:`Align`, :class:`ExprRef`, Literal['left', 'center', 'right'] The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of ``"left"``, ``"right"``, ``"center"``. @@ -3027,11 +3031,11 @@ def __init__( class BaseTitleNoValueRefs(VegaLiteSchema): - """BaseTitleNoValueRefs schema wrapper + """ + BaseTitleNoValueRefs schema wrapper. Parameters ---------- - align : :class:`Align`, Literal['left', 'center', 'right'] Horizontal text alignment for title text. One of ``"left"``, ``"center"``, or ``"right"``. @@ -3175,7 +3179,7 @@ def __init__( class BinExtent(VegaLiteSchema): - """BinExtent schema wrapper""" + """BinExtent schema wrapper.""" _schema = {"$ref": "#/definitions/BinExtent"} @@ -3184,12 +3188,13 @@ def __init__(self, *args, **kwds): class BinParams(VegaLiteSchema): - """BinParams schema wrapper + """ + BinParams schema wrapper. + Binning properties or boolean flag for determining whether to bin data or not. Parameters ---------- - anchor : float A value in the binned domain at which to anchor the bins, shifting the bin boundaries if necessary to ensure that a boundary aligns with the anchor value. @@ -3263,7 +3268,7 @@ def __init__( class Binding(VegaLiteSchema): - """Binding schema wrapper""" + """Binding schema wrapper.""" _schema = {"$ref": "#/definitions/Binding"} @@ -3272,11 +3277,11 @@ def __init__(self, *args, **kwds): class BindCheckbox(Binding): - """BindCheckbox schema wrapper + """ + BindCheckbox schema wrapper. Parameters ---------- - input : str debounce : float @@ -3307,11 +3312,11 @@ def __init__( class BindDirect(Binding): - """BindDirect schema wrapper + """ + BindDirect schema wrapper. Parameters ---------- - element : str, dict, :class:`Element` An input element that exposes a *value* property and supports the `EventTarget `__ interface, or a @@ -3340,11 +3345,11 @@ def __init__( class BindInput(Binding): - """BindInput schema wrapper + """ + BindInput schema wrapper. Parameters ---------- - autocomplete : str A hint for form autofill. See the `HTML autocomplete attribute `__ for @@ -3391,11 +3396,11 @@ def __init__( class BindRadioSelect(Binding): - """BindRadioSelect schema wrapper + """ + BindRadioSelect schema wrapper. Parameters ---------- - input : Literal['radio', 'select'] options : Sequence[Any] @@ -3439,11 +3444,11 @@ def __init__( class BindRange(Binding): - """BindRange schema wrapper + """ + BindRange schema wrapper. Parameters ---------- - input : str debounce : float @@ -3493,7 +3498,7 @@ def __init__( class BinnedTimeUnit(VegaLiteSchema): - """BinnedTimeUnit schema wrapper""" + """BinnedTimeUnit schema wrapper.""" _schema = {"$ref": "#/definitions/BinnedTimeUnit"} @@ -3502,7 +3507,7 @@ def __init__(self, *args, **kwds): class Blend(VegaLiteSchema): - """Blend schema wrapper""" + """Blend schema wrapper.""" _schema = {"$ref": "#/definitions/Blend"} @@ -3511,11 +3516,11 @@ def __init__(self, *args): class BoxPlotConfig(VegaLiteSchema): - """BoxPlotConfig schema wrapper + """ + BoxPlotConfig schema wrapper. Parameters ---------- - box : bool, dict, :class:`BarConfig`, :class:`AreaConfig`, :class:`LineConfig`, :class:`MarkConfig`, :class:`RectConfig`, :class:`TickConfig`, :class:`AnyMarkConfig` extent : str, float @@ -3568,11 +3573,11 @@ def __init__( class BrushConfig(VegaLiteSchema): - """BrushConfig schema wrapper + """ + BrushConfig schema wrapper. Parameters ---------- - cursor : :class:`Cursor`, Literal['auto', 'default', 'none', 'context-menu', 'help', 'pointer', 'progress', 'wait', 'cell', 'crosshair', 'text', 'vertical-text', 'alias', 'copy', 'move', 'no-drop', 'not-allowed', 'e-resize', 'n-resize', 'ne-resize', 'nw-resize', 's-resize', 'se-resize', 'sw-resize', 'w-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize', 'col-resize', 'row-resize', 'all-scroll', 'zoom-in', 'zoom-out', 'grab', 'grabbing'] The mouse cursor used over the interval mark. Any valid `CSS cursor type `__ can be used. @@ -3627,7 +3632,7 @@ def __init__( class Color(VegaLiteSchema): - """Color schema wrapper""" + """Color schema wrapper.""" _schema = {"$ref": "#/definitions/Color"} @@ -3636,7 +3641,7 @@ def __init__(self, *args, **kwds): class ColorDef(VegaLiteSchema): - """ColorDef schema wrapper""" + """ColorDef schema wrapper.""" _schema = {"$ref": "#/definitions/ColorDef"} @@ -3645,7 +3650,7 @@ def __init__(self, *args, **kwds): class ColorName(Color): - """ColorName schema wrapper""" + """ColorName schema wrapper.""" _schema = {"$ref": "#/definitions/ColorName"} @@ -3654,7 +3659,7 @@ def __init__(self, *args): class ColorScheme(VegaLiteSchema): - """ColorScheme schema wrapper""" + """ColorScheme schema wrapper.""" _schema = {"$ref": "#/definitions/ColorScheme"} @@ -3663,7 +3668,7 @@ def __init__(self, *args, **kwds): class Categorical(ColorScheme): - """Categorical schema wrapper""" + """Categorical schema wrapper.""" _schema = {"$ref": "#/definitions/Categorical"} @@ -3672,7 +3677,7 @@ def __init__(self, *args): class CompositeMark(AnyMark): - """CompositeMark schema wrapper""" + """CompositeMark schema wrapper.""" _schema = {"$ref": "#/definitions/CompositeMark"} @@ -3681,7 +3686,7 @@ def __init__(self, *args, **kwds): class BoxPlot(CompositeMark): - """BoxPlot schema wrapper""" + """BoxPlot schema wrapper.""" _schema = {"$ref": "#/definitions/BoxPlot"} @@ -3690,7 +3695,7 @@ def __init__(self, *args): class CompositeMarkDef(AnyMark): - """CompositeMarkDef schema wrapper""" + """CompositeMarkDef schema wrapper.""" _schema = {"$ref": "#/definitions/CompositeMarkDef"} @@ -3699,11 +3704,11 @@ def __init__(self, *args, **kwds): class BoxPlotDef(CompositeMarkDef): - """BoxPlotDef schema wrapper + """ + BoxPlotDef schema wrapper. Parameters ---------- - type : str, :class:`BoxPlot` The mark type. This could a primitive mark type (one of ``"bar"``, ``"circle"``, ``"square"``, ``"tick"``, ``"line"``, ``"area"``, ``"point"``, ``"geoshape"``, @@ -3828,11 +3833,11 @@ def __init__( class CompositionConfig(VegaLiteSchema): - """CompositionConfig schema wrapper + """ + CompositionConfig schema wrapper. Parameters ---------- - columns : float The number of columns to include in the view composition layout. @@ -3869,7 +3874,7 @@ def __init__( class ConditionalAxisColor(VegaLiteSchema): - """ConditionalAxisColor schema wrapper""" + """ConditionalAxisColor schema wrapper.""" _schema = {"$ref": "#/definitions/ConditionalAxisColor"} @@ -3878,7 +3883,7 @@ def __init__(self, *args, **kwds): class ConditionalAxisLabelAlign(VegaLiteSchema): - """ConditionalAxisLabelAlign schema wrapper""" + """ConditionalAxisLabelAlign schema wrapper.""" _schema = {"$ref": "#/definitions/ConditionalAxisLabelAlign"} @@ -3887,7 +3892,7 @@ def __init__(self, *args, **kwds): class ConditionalAxisLabelBaseline(VegaLiteSchema): - """ConditionalAxisLabelBaseline schema wrapper""" + """ConditionalAxisLabelBaseline schema wrapper.""" _schema = {"$ref": "#/definitions/ConditionalAxisLabelBaseline"} @@ -3896,7 +3901,7 @@ def __init__(self, *args, **kwds): class ConditionalAxisLabelFontStyle(VegaLiteSchema): - """ConditionalAxisLabelFontStyle schema wrapper""" + """ConditionalAxisLabelFontStyle schema wrapper.""" _schema = {"$ref": "#/definitions/ConditionalAxisLabelFontStyle"} @@ -3905,7 +3910,7 @@ def __init__(self, *args, **kwds): class ConditionalAxisLabelFontWeight(VegaLiteSchema): - """ConditionalAxisLabelFontWeight schema wrapper""" + """ConditionalAxisLabelFontWeight schema wrapper.""" _schema = {"$ref": "#/definitions/ConditionalAxisLabelFontWeight"} @@ -3914,7 +3919,7 @@ def __init__(self, *args, **kwds): class ConditionalAxisNumber(VegaLiteSchema): - """ConditionalAxisNumber schema wrapper""" + """ConditionalAxisNumber schema wrapper.""" _schema = {"$ref": "#/definitions/ConditionalAxisNumber"} @@ -3923,7 +3928,7 @@ def __init__(self, *args, **kwds): class ConditionalAxisNumberArray(VegaLiteSchema): - """ConditionalAxisNumberArray schema wrapper""" + """ConditionalAxisNumberArray schema wrapper.""" _schema = {"$ref": "#/definitions/ConditionalAxisNumberArray"} @@ -3932,7 +3937,7 @@ def __init__(self, *args, **kwds): class ConditionalAxisPropertyAlignnull(VegaLiteSchema): - """ConditionalAxisPropertyAlignnull schema wrapper""" + """ConditionalAxisPropertyAlignnull schema wrapper.""" _schema = {"$ref": "#/definitions/ConditionalAxisProperty<(Align|null)>"} @@ -3941,7 +3946,7 @@ def __init__(self, *args, **kwds): class ConditionalAxisPropertyColornull(VegaLiteSchema): - """ConditionalAxisPropertyColornull schema wrapper""" + """ConditionalAxisPropertyColornull schema wrapper.""" _schema = {"$ref": "#/definitions/ConditionalAxisProperty<(Color|null)>"} @@ -3950,7 +3955,7 @@ def __init__(self, *args, **kwds): class ConditionalAxisPropertyFontStylenull(VegaLiteSchema): - """ConditionalAxisPropertyFontStylenull schema wrapper""" + """ConditionalAxisPropertyFontStylenull schema wrapper.""" _schema = {"$ref": "#/definitions/ConditionalAxisProperty<(FontStyle|null)>"} @@ -3959,7 +3964,7 @@ def __init__(self, *args, **kwds): class ConditionalAxisPropertyFontWeightnull(VegaLiteSchema): - """ConditionalAxisPropertyFontWeightnull schema wrapper""" + """ConditionalAxisPropertyFontWeightnull schema wrapper.""" _schema = {"$ref": "#/definitions/ConditionalAxisProperty<(FontWeight|null)>"} @@ -3968,7 +3973,7 @@ def __init__(self, *args, **kwds): class ConditionalAxisPropertyTextBaselinenull(VegaLiteSchema): - """ConditionalAxisPropertyTextBaselinenull schema wrapper""" + """ConditionalAxisPropertyTextBaselinenull schema wrapper.""" _schema = {"$ref": "#/definitions/ConditionalAxisProperty<(TextBaseline|null)>"} @@ -3977,7 +3982,7 @@ def __init__(self, *args, **kwds): class ConditionalAxisPropertynumberArraynull(VegaLiteSchema): - """ConditionalAxisPropertynumberArraynull schema wrapper""" + """ConditionalAxisPropertynumberArraynull schema wrapper.""" _schema = {"$ref": "#/definitions/ConditionalAxisProperty<(number[]|null)>"} @@ -3986,7 +3991,7 @@ def __init__(self, *args, **kwds): class ConditionalAxisPropertynumbernull(VegaLiteSchema): - """ConditionalAxisPropertynumbernull schema wrapper""" + """ConditionalAxisPropertynumbernull schema wrapper.""" _schema = {"$ref": "#/definitions/ConditionalAxisProperty<(number|null)>"} @@ -3995,7 +4000,7 @@ def __init__(self, *args, **kwds): class ConditionalAxisPropertystringnull(VegaLiteSchema): - """ConditionalAxisPropertystringnull schema wrapper""" + """ConditionalAxisPropertystringnull schema wrapper.""" _schema = {"$ref": "#/definitions/ConditionalAxisProperty<(string|null)>"} @@ -4004,7 +4009,7 @@ def __init__(self, *args, **kwds): class ConditionalAxisString(VegaLiteSchema): - """ConditionalAxisString schema wrapper""" + """ConditionalAxisString schema wrapper.""" _schema = {"$ref": "#/definitions/ConditionalAxisString"} @@ -4013,7 +4018,7 @@ def __init__(self, *args, **kwds): class ConditionalMarkPropFieldOrDatumDef(VegaLiteSchema): - """ConditionalMarkPropFieldOrDatumDef schema wrapper""" + """ConditionalMarkPropFieldOrDatumDef schema wrapper.""" _schema = {"$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef"} @@ -4022,7 +4027,7 @@ def __init__(self, *args, **kwds): class ConditionalMarkPropFieldOrDatumDefTypeForShape(VegaLiteSchema): - """ConditionalMarkPropFieldOrDatumDefTypeForShape schema wrapper""" + """ConditionalMarkPropFieldOrDatumDefTypeForShape schema wrapper.""" _schema = {"$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef"} @@ -4031,7 +4036,7 @@ def __init__(self, *args, **kwds): class ConditionalParameterMarkPropFieldOrDatumDef(ConditionalMarkPropFieldOrDatumDef): - """ConditionalParameterMarkPropFieldOrDatumDef schema wrapper""" + """ConditionalParameterMarkPropFieldOrDatumDef schema wrapper.""" _schema = {"$ref": "#/definitions/ConditionalParameter"} @@ -4042,7 +4047,7 @@ def __init__(self, *args, **kwds): class ConditionalParameterMarkPropFieldOrDatumDefTypeForShape( ConditionalMarkPropFieldOrDatumDefTypeForShape ): - """ConditionalParameterMarkPropFieldOrDatumDefTypeForShape schema wrapper""" + """ConditionalParameterMarkPropFieldOrDatumDefTypeForShape schema wrapper.""" _schema = { "$ref": "#/definitions/ConditionalParameter>" @@ -4053,7 +4058,7 @@ def __init__(self, *args, **kwds): class ConditionalPredicateMarkPropFieldOrDatumDef(ConditionalMarkPropFieldOrDatumDef): - """ConditionalPredicateMarkPropFieldOrDatumDef schema wrapper""" + """ConditionalPredicateMarkPropFieldOrDatumDef schema wrapper.""" _schema = {"$ref": "#/definitions/ConditionalPredicate"} @@ -4064,7 +4069,7 @@ def __init__(self, *args, **kwds): class ConditionalPredicateMarkPropFieldOrDatumDefTypeForShape( ConditionalMarkPropFieldOrDatumDefTypeForShape ): - """ConditionalPredicateMarkPropFieldOrDatumDefTypeForShape schema wrapper""" + """ConditionalPredicateMarkPropFieldOrDatumDefTypeForShape schema wrapper.""" _schema = { "$ref": "#/definitions/ConditionalPredicate>" @@ -4075,7 +4080,7 @@ def __init__(self, *args, **kwds): class ConditionalPredicateValueDefAlignnullExprRef(VegaLiteSchema): - """ConditionalPredicateValueDefAlignnullExprRef schema wrapper""" + """ConditionalPredicateValueDefAlignnullExprRef schema wrapper.""" _schema = { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Align|null)>|ExprRef)>" @@ -4086,7 +4091,7 @@ def __init__(self, *args, **kwds): class ConditionalPredicateValueDefColornullExprRef(VegaLiteSchema): - """ConditionalPredicateValueDefColornullExprRef schema wrapper""" + """ConditionalPredicateValueDefColornullExprRef schema wrapper.""" _schema = { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Color|null)>|ExprRef)>" @@ -4097,7 +4102,7 @@ def __init__(self, *args, **kwds): class ConditionalPredicateValueDefFontStylenullExprRef(VegaLiteSchema): - """ConditionalPredicateValueDefFontStylenullExprRef schema wrapper""" + """ConditionalPredicateValueDefFontStylenullExprRef schema wrapper.""" _schema = { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontStyle|null)>|ExprRef)>" @@ -4108,7 +4113,7 @@ def __init__(self, *args, **kwds): class ConditionalPredicateValueDefFontWeightnullExprRef(VegaLiteSchema): - """ConditionalPredicateValueDefFontWeightnullExprRef schema wrapper""" + """ConditionalPredicateValueDefFontWeightnullExprRef schema wrapper.""" _schema = { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontWeight|null)>|ExprRef)>" @@ -4119,7 +4124,7 @@ def __init__(self, *args, **kwds): class ConditionalPredicateValueDefTextBaselinenullExprRef(VegaLiteSchema): - """ConditionalPredicateValueDefTextBaselinenullExprRef schema wrapper""" + """ConditionalPredicateValueDefTextBaselinenullExprRef schema wrapper.""" _schema = { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(TextBaseline|null)>|ExprRef)>" @@ -4130,7 +4135,7 @@ def __init__(self, *args, **kwds): class ConditionalPredicateValueDefnumberArraynullExprRef(VegaLiteSchema): - """ConditionalPredicateValueDefnumberArraynullExprRef schema wrapper""" + """ConditionalPredicateValueDefnumberArraynullExprRef schema wrapper.""" _schema = { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number[]|null)>|ExprRef)>" @@ -4141,7 +4146,7 @@ def __init__(self, *args, **kwds): class ConditionalPredicateValueDefnumbernullExprRef(VegaLiteSchema): - """ConditionalPredicateValueDefnumbernullExprRef schema wrapper""" + """ConditionalPredicateValueDefnumbernullExprRef schema wrapper.""" _schema = { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number|null)>|ExprRef)>" @@ -4152,7 +4157,7 @@ def __init__(self, *args, **kwds): class ConditionalStringFieldDef(VegaLiteSchema): - """ConditionalStringFieldDef schema wrapper""" + """ConditionalStringFieldDef schema wrapper.""" _schema = {"$ref": "#/definitions/ConditionalStringFieldDef"} @@ -4161,11 +4166,11 @@ def __init__(self, *args, **kwds): class ConditionalParameterStringFieldDef(ConditionalStringFieldDef): - """ConditionalParameterStringFieldDef schema wrapper + r""" + ConditionalParameterStringFieldDef schema wrapper. Parameters ---------- - param : str, :class:`ParameterName` Filter using a parameter name. aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -4389,11 +4394,11 @@ def __init__( class ConditionalPredicateStringFieldDef(ConditionalStringFieldDef): - """ConditionalPredicateStringFieldDef schema wrapper + r""" + ConditionalPredicateStringFieldDef schema wrapper. Parameters ---------- - test : str, dict, :class:`Predicate`, :class:`FieldGTPredicate`, :class:`FieldLTPredicate`, :class:`FieldGTEPredicate`, :class:`FieldLTEPredicate`, :class:`LogicalOrPredicate`, :class:`ParameterPredicate`, :class:`FieldEqualPredicate`, :class:`FieldOneOfPredicate`, :class:`FieldRangePredicate`, :class:`FieldValidPredicate`, :class:`LogicalAndPredicate`, :class:`LogicalNotPredicate`, :class:`PredicateComposition` Predicate for triggering the condition aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -4612,7 +4617,7 @@ def __init__( class ConditionalValueDefGradientstringnullExprRef(VegaLiteSchema): - """ConditionalValueDefGradientstringnullExprRef schema wrapper""" + """ConditionalValueDefGradientstringnullExprRef schema wrapper.""" _schema = { "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" @@ -4625,11 +4630,11 @@ def __init__(self, *args, **kwds): class ConditionalParameterValueDefGradientstringnullExprRef( ConditionalValueDefGradientstringnullExprRef ): - """ConditionalParameterValueDefGradientstringnullExprRef schema wrapper + """ + ConditionalParameterValueDefGradientstringnullExprRef schema wrapper. Parameters ---------- - param : str, :class:`ParameterName` Filter using a parameter name. value : str, dict, None, :class:`ExprRef`, :class:`Gradient`, :class:`LinearGradient`, :class:`RadialGradient` @@ -4658,11 +4663,11 @@ def __init__( class ConditionalPredicateValueDefGradientstringnullExprRef( ConditionalValueDefGradientstringnullExprRef ): - """ConditionalPredicateValueDefGradientstringnullExprRef schema wrapper + """ + ConditionalPredicateValueDefGradientstringnullExprRef schema wrapper. Parameters ---------- - test : str, dict, :class:`Predicate`, :class:`FieldGTPredicate`, :class:`FieldLTPredicate`, :class:`FieldGTEPredicate`, :class:`FieldLTEPredicate`, :class:`LogicalOrPredicate`, :class:`ParameterPredicate`, :class:`FieldEqualPredicate`, :class:`FieldOneOfPredicate`, :class:`FieldRangePredicate`, :class:`FieldValidPredicate`, :class:`LogicalAndPredicate`, :class:`LogicalNotPredicate`, :class:`PredicateComposition` Predicate for triggering the condition value : str, dict, None, :class:`ExprRef`, :class:`Gradient`, :class:`LinearGradient`, :class:`RadialGradient` @@ -4685,7 +4690,7 @@ def __init__( class ConditionalValueDefTextExprRef(VegaLiteSchema): - """ConditionalValueDefTextExprRef schema wrapper""" + """ConditionalValueDefTextExprRef schema wrapper.""" _schema = {"$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>"} @@ -4694,11 +4699,11 @@ def __init__(self, *args, **kwds): class ConditionalParameterValueDefTextExprRef(ConditionalValueDefTextExprRef): - """ConditionalParameterValueDefTextExprRef schema wrapper + """ + ConditionalParameterValueDefTextExprRef schema wrapper. Parameters ---------- - param : str, :class:`ParameterName` Filter using a parameter name. value : str, dict, :class:`Text`, Sequence[str], :class:`ExprRef` @@ -4725,11 +4730,11 @@ def __init__( class ConditionalPredicateValueDefTextExprRef(ConditionalValueDefTextExprRef): - """ConditionalPredicateValueDefTextExprRef schema wrapper + """ + ConditionalPredicateValueDefTextExprRef schema wrapper. Parameters ---------- - test : str, dict, :class:`Predicate`, :class:`FieldGTPredicate`, :class:`FieldLTPredicate`, :class:`FieldGTEPredicate`, :class:`FieldLTEPredicate`, :class:`LogicalOrPredicate`, :class:`ParameterPredicate`, :class:`FieldEqualPredicate`, :class:`FieldOneOfPredicate`, :class:`FieldRangePredicate`, :class:`FieldValidPredicate`, :class:`LogicalAndPredicate`, :class:`LogicalNotPredicate`, :class:`PredicateComposition` Predicate for triggering the condition value : str, dict, :class:`Text`, Sequence[str], :class:`ExprRef` @@ -4752,7 +4757,7 @@ def __init__( class ConditionalValueDefnumber(VegaLiteSchema): - """ConditionalValueDefnumber schema wrapper""" + """ConditionalValueDefnumber schema wrapper.""" _schema = {"$ref": "#/definitions/ConditionalValueDef"} @@ -4761,11 +4766,11 @@ def __init__(self, *args, **kwds): class ConditionalParameterValueDefnumber(ConditionalValueDefnumber): - """ConditionalParameterValueDefnumber schema wrapper + """ + ConditionalParameterValueDefnumber schema wrapper. Parameters ---------- - param : str, :class:`ParameterName` Filter using a parameter name. value : float @@ -4790,11 +4795,11 @@ def __init__( class ConditionalPredicateValueDefnumber(ConditionalValueDefnumber): - """ConditionalPredicateValueDefnumber schema wrapper + """ + ConditionalPredicateValueDefnumber schema wrapper. Parameters ---------- - test : str, dict, :class:`Predicate`, :class:`FieldGTPredicate`, :class:`FieldLTPredicate`, :class:`FieldGTEPredicate`, :class:`FieldLTEPredicate`, :class:`LogicalOrPredicate`, :class:`ParameterPredicate`, :class:`FieldEqualPredicate`, :class:`FieldOneOfPredicate`, :class:`FieldRangePredicate`, :class:`FieldValidPredicate`, :class:`LogicalAndPredicate`, :class:`LogicalNotPredicate`, :class:`PredicateComposition` Predicate for triggering the condition value : float @@ -4815,7 +4820,7 @@ def __init__( class ConditionalValueDefnumberArrayExprRef(VegaLiteSchema): - """ConditionalValueDefnumberArrayExprRef schema wrapper""" + """ConditionalValueDefnumberArrayExprRef schema wrapper.""" _schema = {"$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>"} @@ -4826,11 +4831,11 @@ def __init__(self, *args, **kwds): class ConditionalParameterValueDefnumberArrayExprRef( ConditionalValueDefnumberArrayExprRef ): - """ConditionalParameterValueDefnumberArrayExprRef schema wrapper + """ + ConditionalParameterValueDefnumberArrayExprRef schema wrapper. Parameters ---------- - param : str, :class:`ParameterName` Filter using a parameter name. value : dict, Sequence[float], :class:`ExprRef` @@ -4859,11 +4864,11 @@ def __init__( class ConditionalPredicateValueDefnumberArrayExprRef( ConditionalValueDefnumberArrayExprRef ): - """ConditionalPredicateValueDefnumberArrayExprRef schema wrapper + """ + ConditionalPredicateValueDefnumberArrayExprRef schema wrapper. Parameters ---------- - test : str, dict, :class:`Predicate`, :class:`FieldGTPredicate`, :class:`FieldLTPredicate`, :class:`FieldGTEPredicate`, :class:`FieldLTEPredicate`, :class:`LogicalOrPredicate`, :class:`ParameterPredicate`, :class:`FieldEqualPredicate`, :class:`FieldOneOfPredicate`, :class:`FieldRangePredicate`, :class:`FieldValidPredicate`, :class:`LogicalAndPredicate`, :class:`LogicalNotPredicate`, :class:`PredicateComposition` Predicate for triggering the condition value : dict, Sequence[float], :class:`ExprRef` @@ -4886,7 +4891,7 @@ def __init__( class ConditionalValueDefnumberExprRef(VegaLiteSchema): - """ConditionalValueDefnumberExprRef schema wrapper""" + """ConditionalValueDefnumberExprRef schema wrapper.""" _schema = {"$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>"} @@ -4895,11 +4900,11 @@ def __init__(self, *args, **kwds): class ConditionalParameterValueDefnumberExprRef(ConditionalValueDefnumberExprRef): - """ConditionalParameterValueDefnumberExprRef schema wrapper + """ + ConditionalParameterValueDefnumberExprRef schema wrapper. Parameters ---------- - param : str, :class:`ParameterName` Filter using a parameter name. value : dict, float, :class:`ExprRef` @@ -4924,11 +4929,11 @@ def __init__( class ConditionalPredicateValueDefnumberExprRef(ConditionalValueDefnumberExprRef): - """ConditionalPredicateValueDefnumberExprRef schema wrapper + """ + ConditionalPredicateValueDefnumberExprRef schema wrapper. Parameters ---------- - test : str, dict, :class:`Predicate`, :class:`FieldGTPredicate`, :class:`FieldLTPredicate`, :class:`FieldGTEPredicate`, :class:`FieldLTEPredicate`, :class:`LogicalOrPredicate`, :class:`ParameterPredicate`, :class:`FieldEqualPredicate`, :class:`FieldOneOfPredicate`, :class:`FieldRangePredicate`, :class:`FieldValidPredicate`, :class:`LogicalAndPredicate`, :class:`LogicalNotPredicate`, :class:`PredicateComposition` Predicate for triggering the condition value : dict, float, :class:`ExprRef` @@ -4949,7 +4954,7 @@ def __init__( class ConditionalValueDefstringExprRef(VegaLiteSchema): - """ConditionalValueDefstringExprRef schema wrapper""" + """ConditionalValueDefstringExprRef schema wrapper.""" _schema = {"$ref": "#/definitions/ConditionalValueDef<(string|ExprRef)>"} @@ -4958,11 +4963,11 @@ def __init__(self, *args, **kwds): class ConditionalParameterValueDefstringExprRef(ConditionalValueDefstringExprRef): - """ConditionalParameterValueDefstringExprRef schema wrapper + """ + ConditionalParameterValueDefstringExprRef schema wrapper. Parameters ---------- - param : str, :class:`ParameterName` Filter using a parameter name. value : str, dict, :class:`ExprRef` @@ -4987,11 +4992,11 @@ def __init__( class ConditionalPredicateValueDefstringExprRef(ConditionalValueDefstringExprRef): - """ConditionalPredicateValueDefstringExprRef schema wrapper + """ + ConditionalPredicateValueDefstringExprRef schema wrapper. Parameters ---------- - test : str, dict, :class:`Predicate`, :class:`FieldGTPredicate`, :class:`FieldLTPredicate`, :class:`FieldGTEPredicate`, :class:`FieldLTEPredicate`, :class:`LogicalOrPredicate`, :class:`ParameterPredicate`, :class:`FieldEqualPredicate`, :class:`FieldOneOfPredicate`, :class:`FieldRangePredicate`, :class:`FieldValidPredicate`, :class:`LogicalAndPredicate`, :class:`LogicalNotPredicate`, :class:`PredicateComposition` Predicate for triggering the condition value : str, dict, :class:`ExprRef` @@ -5012,7 +5017,7 @@ def __init__( class ConditionalValueDefstringnullExprRef(VegaLiteSchema): - """ConditionalValueDefstringnullExprRef schema wrapper""" + """ConditionalValueDefstringnullExprRef schema wrapper.""" _schema = {"$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>"} @@ -5023,11 +5028,11 @@ def __init__(self, *args, **kwds): class ConditionalParameterValueDefstringnullExprRef( ConditionalValueDefstringnullExprRef ): - """ConditionalParameterValueDefstringnullExprRef schema wrapper + """ + ConditionalParameterValueDefstringnullExprRef schema wrapper. Parameters ---------- - param : str, :class:`ParameterName` Filter using a parameter name. value : str, dict, None, :class:`ExprRef` @@ -5056,11 +5061,11 @@ def __init__( class ConditionalPredicateValueDefstringnullExprRef( ConditionalValueDefstringnullExprRef ): - """ConditionalPredicateValueDefstringnullExprRef schema wrapper + """ + ConditionalPredicateValueDefstringnullExprRef schema wrapper. Parameters ---------- - test : str, dict, :class:`Predicate`, :class:`FieldGTPredicate`, :class:`FieldLTPredicate`, :class:`FieldGTEPredicate`, :class:`FieldLTEPredicate`, :class:`LogicalOrPredicate`, :class:`ParameterPredicate`, :class:`FieldEqualPredicate`, :class:`FieldOneOfPredicate`, :class:`FieldRangePredicate`, :class:`FieldValidPredicate`, :class:`LogicalAndPredicate`, :class:`LogicalNotPredicate`, :class:`PredicateComposition` Predicate for triggering the condition value : str, dict, None, :class:`ExprRef` @@ -5083,11 +5088,11 @@ def __init__( class Config(VegaLiteSchema): - """Config schema wrapper + """ + Config schema wrapper. Parameters ---------- - arc : dict, :class:`RectConfig` Arc-specific Config area : dict, :class:`AreaConfig` @@ -5516,7 +5521,7 @@ def __init__( class Cursor(VegaLiteSchema): - """Cursor schema wrapper""" + """Cursor schema wrapper.""" _schema = {"$ref": "#/definitions/Cursor"} @@ -5525,7 +5530,7 @@ def __init__(self, *args): class Cyclical(ColorScheme): - """Cyclical schema wrapper""" + """Cyclical schema wrapper.""" _schema = {"$ref": "#/definitions/Cyclical"} @@ -5534,7 +5539,7 @@ def __init__(self, *args): class Data(VegaLiteSchema): - """Data schema wrapper""" + """Data schema wrapper.""" _schema = {"$ref": "#/definitions/Data"} @@ -5543,7 +5548,7 @@ def __init__(self, *args, **kwds): class DataFormat(VegaLiteSchema): - """DataFormat schema wrapper""" + """DataFormat schema wrapper.""" _schema = {"$ref": "#/definitions/DataFormat"} @@ -5552,11 +5557,11 @@ def __init__(self, *args, **kwds): class CsvDataFormat(DataFormat): - """CsvDataFormat schema wrapper + """ + CsvDataFormat schema wrapper. Parameters ---------- - parse : dict, None, :class:`Parse` If set to ``null``, disable type inference based on the spec and only use type inference based on the data. Alternatively, a parsing directive object can be @@ -5592,7 +5597,7 @@ def __init__( class DataSource(Data): - """DataSource schema wrapper""" + """DataSource schema wrapper.""" _schema = {"$ref": "#/definitions/DataSource"} @@ -5601,7 +5606,7 @@ def __init__(self, *args, **kwds): class Datasets(VegaLiteSchema): - """Datasets schema wrapper""" + """Datasets schema wrapper.""" _schema = {"$ref": "#/definitions/Datasets"} @@ -5610,7 +5615,7 @@ def __init__(self, **kwds): class Day(VegaLiteSchema): - """Day schema wrapper""" + """Day schema wrapper.""" _schema = {"$ref": "#/definitions/Day"} @@ -5619,7 +5624,7 @@ def __init__(self, *args): class Dict(VegaLiteSchema): - """Dict schema wrapper""" + """Dict schema wrapper.""" _schema = {"$ref": "#/definitions/Dict"} @@ -5628,7 +5633,7 @@ def __init__(self, **kwds): class DictInlineDataset(VegaLiteSchema): - """DictInlineDataset schema wrapper""" + """DictInlineDataset schema wrapper.""" _schema = {"$ref": "#/definitions/Dict"} @@ -5637,7 +5642,7 @@ def __init__(self, **kwds): class DictSelectionInit(VegaLiteSchema): - """DictSelectionInit schema wrapper""" + """DictSelectionInit schema wrapper.""" _schema = {"$ref": "#/definitions/Dict"} @@ -5646,7 +5651,7 @@ def __init__(self, **kwds): class DictSelectionInitInterval(VegaLiteSchema): - """DictSelectionInitInterval schema wrapper""" + """DictSelectionInitInterval schema wrapper.""" _schema = {"$ref": "#/definitions/Dict"} @@ -5655,7 +5660,7 @@ def __init__(self, **kwds): class Diverging(ColorScheme): - """Diverging schema wrapper""" + """Diverging schema wrapper.""" _schema = {"$ref": "#/definitions/Diverging"} @@ -5664,11 +5669,11 @@ def __init__(self, *args): class DomainUnionWith(VegaLiteSchema): - """DomainUnionWith schema wrapper + """ + DomainUnionWith schema wrapper. Parameters ---------- - unionWith : Sequence[str, bool, dict, float, :class:`DateTime`] Customized domain values to be union with the field's values or explicitly defined domain. Should be an array of valid scale domain values. @@ -5687,11 +5692,11 @@ def __init__( class DsvDataFormat(DataFormat): - """DsvDataFormat schema wrapper + """ + DsvDataFormat schema wrapper. Parameters ---------- - delimiter : str The delimiter between records. The delimiter must be a single character (i.e., a single 16-bit code unit); so, ASCII delimiters are fine, but emoji delimiters are @@ -5732,7 +5737,7 @@ def __init__( class Element(VegaLiteSchema): - """Element schema wrapper""" + """Element schema wrapper.""" _schema = {"$ref": "#/definitions/Element"} @@ -5741,11 +5746,11 @@ def __init__(self, *args): class Encoding(VegaLiteSchema): - """Encoding schema wrapper + """ + Encoding schema wrapper. Parameters ---------- - angle : dict, :class:`NumericMarkPropDef`, :class:`FieldOrDatumDefWithConditionDatumDefnumber`, :class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumber`, :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumber` Rotation angle of point and text marks. color : dict, :class:`ColorDef`, :class:`FieldOrDatumDefWithConditionDatumDefGradientstringnull`, :class:`FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull`, :class:`ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull` @@ -6025,7 +6030,7 @@ def __init__( class ErrorBand(CompositeMark): - """ErrorBand schema wrapper""" + """ErrorBand schema wrapper.""" _schema = {"$ref": "#/definitions/ErrorBand"} @@ -6034,11 +6039,11 @@ def __init__(self, *args): class ErrorBandConfig(VegaLiteSchema): - """ErrorBandConfig schema wrapper + """ + ErrorBandConfig schema wrapper. Parameters ---------- - band : bool, dict, :class:`BarConfig`, :class:`AreaConfig`, :class:`LineConfig`, :class:`MarkConfig`, :class:`RectConfig`, :class:`TickConfig`, :class:`AnyMarkConfig` borders : bool, dict, :class:`BarConfig`, :class:`AreaConfig`, :class:`LineConfig`, :class:`MarkConfig`, :class:`RectConfig`, :class:`TickConfig`, :class:`AnyMarkConfig` @@ -6104,11 +6109,11 @@ def __init__( class ErrorBandDef(CompositeMarkDef): - """ErrorBandDef schema wrapper + """ + ErrorBandDef schema wrapper. Parameters ---------- - type : str, :class:`ErrorBand` The mark type. This could a primitive mark type (one of ``"bar"``, ``"circle"``, ``"square"``, ``"tick"``, ``"line"``, ``"area"``, ``"point"``, ``"geoshape"``, @@ -6209,7 +6214,7 @@ def __init__( class ErrorBar(CompositeMark): - """ErrorBar schema wrapper""" + """ErrorBar schema wrapper.""" _schema = {"$ref": "#/definitions/ErrorBar"} @@ -6218,11 +6223,11 @@ def __init__(self, *args): class ErrorBarConfig(VegaLiteSchema): - """ErrorBarConfig schema wrapper + """ + ErrorBarConfig schema wrapper. Parameters ---------- - extent : :class:`ErrorBarExtent`, Literal['ci', 'iqr', 'stderr', 'stdev'] The extent of the rule. Available options include: @@ -6267,11 +6272,11 @@ def __init__( class ErrorBarDef(CompositeMarkDef): - """ErrorBarDef schema wrapper + """ + ErrorBarDef schema wrapper. Parameters ---------- - type : str, :class:`ErrorBar` The mark type. This could a primitive mark type (one of ``"bar"``, ``"circle"``, ``"square"``, ``"tick"``, ``"line"``, ``"area"``, ``"point"``, ``"geoshape"``, @@ -6351,7 +6356,7 @@ def __init__( class ErrorBarExtent(VegaLiteSchema): - """ErrorBarExtent schema wrapper""" + """ErrorBarExtent schema wrapper.""" _schema = {"$ref": "#/definitions/ErrorBarExtent"} @@ -6360,7 +6365,7 @@ def __init__(self, *args): class Expr(VegaLiteSchema): - """Expr schema wrapper""" + """Expr schema wrapper.""" _schema = {"$ref": "#/definitions/Expr"} @@ -6369,11 +6374,11 @@ def __init__(self, *args): class ExprRef(VegaLiteSchema): - """ExprRef schema wrapper + """ + ExprRef schema wrapper. Parameters ---------- - expr : str Vega expression (which can refer to Vega-Lite parameters). """ @@ -6385,11 +6390,11 @@ def __init__(self, expr: Optional[str] = Undefined, **kwds): class FacetEncodingFieldDef(VegaLiteSchema): - """FacetEncodingFieldDef schema wrapper + r""" + FacetEncodingFieldDef schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -6685,11 +6690,11 @@ def __init__( class FacetFieldDef(VegaLiteSchema): - """FacetFieldDef schema wrapper + r""" + FacetFieldDef schema wrapper. Parameters ---------- - aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -6908,11 +6913,11 @@ def __init__( class FacetMapping(VegaLiteSchema): - """FacetMapping schema wrapper + """ + FacetMapping schema wrapper. Parameters ---------- - column : dict, :class:`FacetFieldDef` A field definition for the horizontal facet of trellis plots. row : dict, :class:`FacetFieldDef` @@ -6931,11 +6936,11 @@ def __init__( class FacetedEncoding(VegaLiteSchema): - """FacetedEncoding schema wrapper + """ + FacetedEncoding schema wrapper. Parameters ---------- - angle : dict, :class:`NumericMarkPropDef`, :class:`FieldOrDatumDefWithConditionDatumDefnumber`, :class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumber`, :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumber` Rotation angle of point and text marks. color : dict, :class:`ColorDef`, :class:`FieldOrDatumDefWithConditionDatumDefGradientstringnull`, :class:`FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull`, :class:`ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull` @@ -7229,13 +7234,14 @@ def __init__( class Feature(VegaLiteSchema): - """Feature schema wrapper + """ + Feature schema wrapper. + A feature object which contains a geometry and associated properties. https://tools.ietf.org/html/rfc7946#section-3.2 Parameters ---------- - geometry : dict, :class:`Point`, :class:`Polygon`, :class:`Geometry`, :class:`LineString`, :class:`MultiPoint`, :class:`MultiPolygon`, :class:`MultiLineString`, :class:`GeometryCollection` The feature's geometry properties : dict, None, :class:`GeoJsonProperties` @@ -7272,12 +7278,13 @@ def __init__( class FeatureCollection(VegaLiteSchema): - """FeatureCollection schema wrapper + """ + FeatureCollection schema wrapper. + A collection of feature objects. https://tools.ietf.org/html/rfc7946#section-3.3 Parameters ---------- - features : Sequence[dict, :class:`FeatureGeometryGeoJsonProperties`] type : str @@ -7300,13 +7307,14 @@ def __init__( class FeatureGeometryGeoJsonProperties(VegaLiteSchema): - """FeatureGeometryGeoJsonProperties schema wrapper + """ + FeatureGeometryGeoJsonProperties schema wrapper. + A feature object which contains a geometry and associated properties. https://tools.ietf.org/html/rfc7946#section-3.2 Parameters ---------- - geometry : dict, :class:`Point`, :class:`Polygon`, :class:`Geometry`, :class:`LineString`, :class:`MultiPoint`, :class:`MultiPolygon`, :class:`MultiLineString`, :class:`GeometryCollection` The feature's geometry properties : dict, None, :class:`GeoJsonProperties` @@ -7343,7 +7351,7 @@ def __init__( class Field(VegaLiteSchema): - """Field schema wrapper""" + """Field schema wrapper.""" _schema = {"$ref": "#/definitions/Field"} @@ -7352,12 +7360,13 @@ def __init__(self, *args, **kwds): class FieldDefWithoutScale(VegaLiteSchema): - """FieldDefWithoutScale schema wrapper + r""" + FieldDefWithoutScale schema wrapper. + Definition object for a data field, its type and transformation of an encoding channel. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -7538,7 +7547,7 @@ def __init__( class FieldName(Field): - """FieldName schema wrapper""" + """FieldName schema wrapper.""" _schema = {"$ref": "#/definitions/FieldName"} @@ -7547,11 +7556,11 @@ def __init__(self, *args): class FieldOrDatumDefWithConditionStringFieldDefstring(VegaLiteSchema): - """FieldOrDatumDefWithConditionStringFieldDefstring schema wrapper + r""" + FieldOrDatumDefWithConditionStringFieldDefstring schema wrapper. Parameters ---------- - aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -7779,11 +7788,11 @@ def __init__( class FieldRange(VegaLiteSchema): - """FieldRange schema wrapper + """ + FieldRange schema wrapper. Parameters ---------- - field : str """ @@ -7795,7 +7804,7 @@ def __init__(self, field: Optional[str] = Undefined, **kwds): class Fit(VegaLiteSchema): - """Fit schema wrapper""" + """Fit schema wrapper.""" _schema = {"$ref": "#/definitions/Fit"} @@ -7804,7 +7813,7 @@ def __init__(self, *args, **kwds): class FontStyle(VegaLiteSchema): - """FontStyle schema wrapper""" + """FontStyle schema wrapper.""" _schema = {"$ref": "#/definitions/FontStyle"} @@ -7813,7 +7822,7 @@ def __init__(self, *args): class FontWeight(VegaLiteSchema): - """FontWeight schema wrapper""" + """FontWeight schema wrapper.""" _schema = {"$ref": "#/definitions/FontWeight"} @@ -7822,11 +7831,11 @@ def __init__(self, *args): class FormatConfig(VegaLiteSchema): - """FormatConfig schema wrapper + """ + FormatConfig schema wrapper. Parameters ---------- - normalizedNumberFormat : str If normalizedNumberFormatType is not specified, D3 number format for axis labels, text marks, and tooltips of normalized stacked fields (fields with ``stack: @@ -7906,7 +7915,7 @@ def __init__( class Generator(Data): - """Generator schema wrapper""" + """Generator schema wrapper.""" _schema = {"$ref": "#/definitions/Generator"} @@ -7915,12 +7924,13 @@ def __init__(self, *args, **kwds): class GenericUnitSpecEncodingAnyMark(VegaLiteSchema): - """GenericUnitSpecEncodingAnyMark schema wrapper + """ + GenericUnitSpecEncodingAnyMark schema wrapper. + Base interface for a unit (single-view) specification. Parameters ---------- - mark : str, dict, :class:`Mark`, :class:`AnyMark`, :class:`BoxPlot`, :class:`MarkDef`, :class:`ErrorBar`, :class:`ErrorBand`, :class:`BoxPlotDef`, :class:`ErrorBarDef`, :class:`ErrorBandDef`, :class:`CompositeMark`, :class:`CompositeMarkDef`, Literal['arc', 'area', 'bar', 'image', 'line', 'point', 'rect', 'rule', 'text', 'tick', 'trail', 'circle', 'square', 'geoshape'] A string describing the mark type (one of ``"bar"``, ``"circle"``, ``"square"``, ``"tick"``, ``"line"``, ``"area"``, ``"point"``, ``"rule"``, ``"geoshape"``, and @@ -7978,13 +7988,14 @@ def __init__( class GeoJsonFeature(Fit): - """GeoJsonFeature schema wrapper + """ + GeoJsonFeature schema wrapper. + A feature object which contains a geometry and associated properties. https://tools.ietf.org/html/rfc7946#section-3.2 Parameters ---------- - geometry : dict, :class:`Point`, :class:`Polygon`, :class:`Geometry`, :class:`LineString`, :class:`MultiPoint`, :class:`MultiPolygon`, :class:`MultiLineString`, :class:`GeometryCollection` The feature's geometry properties : dict, None, :class:`GeoJsonProperties` @@ -8021,12 +8032,13 @@ def __init__( class GeoJsonFeatureCollection(Fit): - """GeoJsonFeatureCollection schema wrapper + """ + GeoJsonFeatureCollection schema wrapper. + A collection of feature objects. https://tools.ietf.org/html/rfc7946#section-3.3 Parameters ---------- - features : Sequence[dict, :class:`FeatureGeometryGeoJsonProperties`] type : str @@ -8049,7 +8061,7 @@ def __init__( class GeoJsonProperties(VegaLiteSchema): - """GeoJsonProperties schema wrapper""" + """GeoJsonProperties schema wrapper.""" _schema = {"$ref": "#/definitions/GeoJsonProperties"} @@ -8058,7 +8070,9 @@ def __init__(self, *args, **kwds): class Geometry(VegaLiteSchema): - """Geometry schema wrapper + """ + Geometry schema wrapper. + Union of geometry objects. https://tools.ietf.org/html/rfc7946#section-3 """ @@ -8069,12 +8083,13 @@ def __init__(self, *args, **kwds): class GeometryCollection(Geometry): - """GeometryCollection schema wrapper + """ + GeometryCollection schema wrapper. + Geometry Collection https://tools.ietf.org/html/rfc7946#section-3.1.8 Parameters ---------- - geometries : Sequence[dict, :class:`Point`, :class:`Polygon`, :class:`Geometry`, :class:`LineString`, :class:`MultiPoint`, :class:`MultiPolygon`, :class:`MultiLineString`, :class:`GeometryCollection`] type : str @@ -8097,7 +8112,7 @@ def __init__( class Gradient(VegaLiteSchema): - """Gradient schema wrapper""" + """Gradient schema wrapper.""" _schema = {"$ref": "#/definitions/Gradient"} @@ -8106,11 +8121,11 @@ def __init__(self, *args, **kwds): class GradientStop(VegaLiteSchema): - """GradientStop schema wrapper + """ + GradientStop schema wrapper. Parameters ---------- - color : str, :class:`Color`, :class:`HexColor`, :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'] The color value at this point in the gradient. offset : float @@ -8129,11 +8144,11 @@ def __init__( class GraticuleGenerator(Generator): - """GraticuleGenerator schema wrapper + """ + GraticuleGenerator schema wrapper. Parameters ---------- - graticule : bool, dict, :class:`GraticuleParams` Generate graticule GeoJSON data for geographic reference lines. name : str @@ -8152,11 +8167,11 @@ def __init__( class GraticuleParams(VegaLiteSchema): - """GraticuleParams schema wrapper + """ + GraticuleParams schema wrapper. Parameters ---------- - extent : :class:`Vector2Vector2number`, Sequence[Sequence[float], :class:`Vector2number`] Sets both the major and minor extents to the same values. extentMajor : :class:`Vector2Vector2number`, Sequence[Sequence[float], :class:`Vector2number`] @@ -8211,12 +8226,13 @@ def __init__( class Header(VegaLiteSchema): - """Header schema wrapper + """ + Header schema wrapper. + Headers of row / column channels for faceted plots. Parameters ---------- - format : str, dict, :class:`Dict` When used with the default ``"number"`` and ``"time"`` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks. @@ -8460,11 +8476,11 @@ def __init__( class HeaderConfig(VegaLiteSchema): - """HeaderConfig schema wrapper + """ + HeaderConfig schema wrapper. Parameters ---------- - format : str, dict, :class:`Dict` When used with the default ``"number"`` and ``"time"`` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks. @@ -8690,7 +8706,7 @@ def __init__( class HexColor(Color): - """HexColor schema wrapper""" + """HexColor schema wrapper.""" _schema = {"$ref": "#/definitions/HexColor"} @@ -8699,7 +8715,7 @@ def __init__(self, *args): class ImputeMethod(VegaLiteSchema): - """ImputeMethod schema wrapper""" + """ImputeMethod schema wrapper.""" _schema = {"$ref": "#/definitions/ImputeMethod"} @@ -8708,11 +8724,11 @@ def __init__(self, *args): class ImputeParams(VegaLiteSchema): - """ImputeParams schema wrapper + """ + ImputeParams schema wrapper. Parameters ---------- - frame : Sequence[None, float] A frame specification as a two-element array used to control the window over which the specified method is applied. The array entries should either be a number @@ -8759,11 +8775,11 @@ def __init__( class ImputeSequence(VegaLiteSchema): - """ImputeSequence schema wrapper + """ + ImputeSequence schema wrapper. Parameters ---------- - stop : float The ending value(exclusive) of the sequence. start : float @@ -8786,11 +8802,11 @@ def __init__( class InlineData(DataSource): - """InlineData schema wrapper + """ + InlineData schema wrapper. Parameters ---------- - values : str, dict, Sequence[str], Sequence[bool], Sequence[dict], Sequence[float], :class:`InlineDataset` The full data set, included inline. This can be an array of objects or primitive values, an object, or a string. Arrays of primitive values are ingested as objects @@ -8822,7 +8838,7 @@ def __init__( class InlineDataset(VegaLiteSchema): - """InlineDataset schema wrapper""" + """InlineDataset schema wrapper.""" _schema = {"$ref": "#/definitions/InlineDataset"} @@ -8831,7 +8847,7 @@ def __init__(self, *args, **kwds): class Interpolate(VegaLiteSchema): - """Interpolate schema wrapper""" + """Interpolate schema wrapper.""" _schema = {"$ref": "#/definitions/Interpolate"} @@ -8840,11 +8856,11 @@ def __init__(self, *args): class IntervalSelectionConfig(VegaLiteSchema): - """IntervalSelectionConfig schema wrapper + """ + IntervalSelectionConfig schema wrapper. Parameters ---------- - type : str Determines the default event processing and data query for the selection. Vega-Lite currently supports two selection types: @@ -8970,11 +8986,11 @@ def __init__( class IntervalSelectionConfigWithoutType(VegaLiteSchema): - """IntervalSelectionConfigWithoutType schema wrapper + """ + IntervalSelectionConfigWithoutType schema wrapper. Parameters ---------- - clear : str, bool, dict, :class:`Stream`, :class:`EventStream`, :class:`MergedStream`, :class:`DerivedStream` Clears the selection, emptying it of all values. This property can be a `Event Stream `__ or ``false`` to disable @@ -9090,11 +9106,11 @@ def __init__( class JoinAggregateFieldDef(VegaLiteSchema): - """JoinAggregateFieldDef schema wrapper + """ + JoinAggregateFieldDef schema wrapper. Parameters ---------- - op : :class:`AggregateOp`, Literal['argmax', 'argmin', 'average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] The aggregation operation to apply (e.g., ``"sum"``, ``"average"`` or ``"count"`` ). See the list of all supported operations `here @@ -9118,11 +9134,11 @@ def __init__( class JsonDataFormat(DataFormat): - """JsonDataFormat schema wrapper + """ + JsonDataFormat schema wrapper. Parameters ---------- - parse : dict, None, :class:`Parse` If set to ``null``, disable type inference based on the spec and only use type inference based on the data. Alternatively, a parsing directive object can be @@ -9164,7 +9180,7 @@ def __init__( class LabelOverlap(VegaLiteSchema): - """LabelOverlap schema wrapper""" + """LabelOverlap schema wrapper.""" _schema = {"$ref": "#/definitions/LabelOverlap"} @@ -9173,7 +9189,7 @@ def __init__(self, *args, **kwds): class LatLongDef(VegaLiteSchema): - """LatLongDef schema wrapper""" + """LatLongDef schema wrapper.""" _schema = {"$ref": "#/definitions/LatLongDef"} @@ -9182,11 +9198,11 @@ def __init__(self, *args, **kwds): class LatLongFieldDef(LatLongDef): - """LatLongFieldDef schema wrapper + r""" + LatLongFieldDef schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -9367,11 +9383,11 @@ def __init__( class LayerRepeatMapping(VegaLiteSchema): - """LayerRepeatMapping schema wrapper + """ + LayerRepeatMapping schema wrapper. Parameters ---------- - layer : Sequence[str] An array of fields to be repeated as layers. column : Sequence[str] @@ -9393,7 +9409,7 @@ def __init__( class LayoutAlign(VegaLiteSchema): - """LayoutAlign schema wrapper""" + """LayoutAlign schema wrapper.""" _schema = {"$ref": "#/definitions/LayoutAlign"} @@ -9402,12 +9418,13 @@ def __init__(self, *args): class Legend(VegaLiteSchema): - """Legend schema wrapper + """ + Legend schema wrapper. + Properties of a legend or boolean flag for determining whether to show it. Parameters ---------- - aria : bool, dict, :class:`ExprRef` A boolean flag indicating if `ARIA attributes `__ should be @@ -9880,7 +9897,7 @@ def __init__( class LegendBinding(VegaLiteSchema): - """LegendBinding schema wrapper""" + """LegendBinding schema wrapper.""" _schema = {"$ref": "#/definitions/LegendBinding"} @@ -9889,11 +9906,11 @@ def __init__(self, *args, **kwds): class LegendConfig(VegaLiteSchema): - """LegendConfig schema wrapper + """ + LegendConfig schema wrapper. Parameters ---------- - aria : bool, dict, :class:`ExprRef` A boolean flag indicating if `ARIA attributes `__ should be @@ -10371,7 +10388,7 @@ def __init__( class LegendOrient(VegaLiteSchema): - """LegendOrient schema wrapper""" + """LegendOrient schema wrapper.""" _schema = {"$ref": "#/definitions/LegendOrient"} @@ -10380,11 +10397,11 @@ def __init__(self, *args): class LegendResolveMap(VegaLiteSchema): - """LegendResolveMap schema wrapper + """ + LegendResolveMap schema wrapper. Parameters ---------- - angle : :class:`ResolveMode`, Literal['independent', 'shared'] color : :class:`ResolveMode`, Literal['independent', 'shared'] @@ -10443,11 +10460,11 @@ def __init__( class LegendStreamBinding(LegendBinding): - """LegendStreamBinding schema wrapper + """ + LegendStreamBinding schema wrapper. Parameters ---------- - legend : str, dict, :class:`Stream`, :class:`EventStream`, :class:`MergedStream`, :class:`DerivedStream` """ @@ -10459,11 +10476,11 @@ def __init__(self, legend: Optional[str | dict | SchemaBase] = Undefined, **kwds class LineConfig(AnyMarkConfig): - """LineConfig schema wrapper + """ + LineConfig schema wrapper. Parameters ---------- - align : dict, :class:`Align`, :class:`ExprRef`, Literal['left', 'center', 'right'] The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of ``"left"``, ``"right"``, ``"center"``. @@ -11030,12 +11047,13 @@ def __init__( class LineString(Geometry): - """LineString schema wrapper + """ + LineString schema wrapper. + LineString geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.4 Parameters ---------- - coordinates : Sequence[Sequence[float], :class:`Position`] type : str @@ -11058,11 +11076,11 @@ def __init__( class LinearGradient(Gradient): - """LinearGradient schema wrapper + """ + LinearGradient schema wrapper. Parameters ---------- - gradient : str The type of gradient. Use ``"linear"`` for a linear gradient. stops : Sequence[dict, :class:`GradientStop`] @@ -11106,11 +11124,11 @@ def __init__( class Locale(VegaLiteSchema): - """Locale schema wrapper + """ + Locale schema wrapper. Parameters ---------- - number : dict, :class:`NumberLocale` Locale definition for formatting numbers. time : dict, :class:`TimeLocale` @@ -11129,11 +11147,11 @@ def __init__( class LookupData(VegaLiteSchema): - """LookupData schema wrapper + """ + LookupData schema wrapper. Parameters ---------- - data : dict, :class:`Data`, :class:`UrlData`, :class:`Generator`, :class:`NamedData`, :class:`DataSource`, :class:`InlineData`, :class:`SphereGenerator`, :class:`SequenceGenerator`, :class:`GraticuleGenerator` Secondary data source to lookup in. key : str, :class:`FieldName` @@ -11156,11 +11174,11 @@ def __init__( class LookupSelection(VegaLiteSchema): - """LookupSelection schema wrapper + """ + LookupSelection schema wrapper. Parameters ---------- - key : str, :class:`FieldName` Key in data to lookup. param : str, :class:`ParameterName` @@ -11183,7 +11201,9 @@ def __init__( class Mark(AnyMark): - """Mark schema wrapper + """ + Mark schema wrapper. + All types of primitive marks. """ @@ -11194,11 +11214,11 @@ def __init__(self, *args): class MarkConfig(AnyMarkConfig): - """MarkConfig schema wrapper + """ + MarkConfig schema wrapper. Parameters ---------- - align : dict, :class:`Align`, :class:`ExprRef`, Literal['left', 'center', 'right'] The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of ``"left"``, ``"right"``, ``"center"``. @@ -11748,11 +11768,11 @@ def __init__( class MarkDef(AnyMark): - """MarkDef schema wrapper + """ + MarkDef schema wrapper. Parameters ---------- - type : :class:`Mark`, Literal['arc', 'area', 'bar', 'image', 'line', 'point', 'rect', 'rule', 'text', 'tick', 'trail', 'circle', 'square', 'geoshape'] The mark type. This could a primitive mark type (one of ``"bar"``, ``"circle"``, ``"square"``, ``"tick"``, ``"line"``, ``"area"``, ``"point"``, ``"geoshape"``, @@ -12434,7 +12454,7 @@ def __init__( class MarkInvalidDataMode(VegaLiteSchema): - """MarkInvalidDataMode schema wrapper""" + """MarkInvalidDataMode schema wrapper.""" _schema = {"$ref": "#/definitions/MarkInvalidDataMode"} @@ -12443,7 +12463,7 @@ def __init__(self, *args): class MarkPropDefGradientstringnull(VegaLiteSchema): - """MarkPropDefGradientstringnull schema wrapper""" + """MarkPropDefGradientstringnull schema wrapper.""" _schema = {"$ref": "#/definitions/MarkPropDef<(Gradient|string|null)>"} @@ -12454,11 +12474,11 @@ def __init__(self, *args, **kwds): class FieldOrDatumDefWithConditionDatumDefGradientstringnull( ColorDef, MarkPropDefGradientstringnull ): - """FieldOrDatumDefWithConditionDatumDefGradientstringnull schema wrapper + """ + FieldOrDatumDefWithConditionDatumDefGradientstringnull schema wrapper. Parameters ---------- - bandPosition : float Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, @@ -12593,11 +12613,11 @@ def __init__( class FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull( ColorDef, MarkPropDefGradientstringnull ): - """FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull schema wrapper + r""" + FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -12867,7 +12887,7 @@ def __init__( class MarkPropDefnumber(VegaLiteSchema): - """MarkPropDefnumber schema wrapper""" + """MarkPropDefnumber schema wrapper.""" _schema = {"$ref": "#/definitions/MarkPropDef"} @@ -12876,7 +12896,7 @@ def __init__(self, *args, **kwds): class MarkPropDefnumberArray(VegaLiteSchema): - """MarkPropDefnumberArray schema wrapper""" + """MarkPropDefnumberArray schema wrapper.""" _schema = {"$ref": "#/definitions/MarkPropDef"} @@ -12885,7 +12905,7 @@ def __init__(self, *args, **kwds): class MarkPropDefstringnullTypeForShape(VegaLiteSchema): - """MarkPropDefstringnullTypeForShape schema wrapper""" + """MarkPropDefstringnullTypeForShape schema wrapper.""" _schema = {"$ref": "#/definitions/MarkPropDef<(string|null),TypeForShape>"} @@ -12894,7 +12914,7 @@ def __init__(self, *args, **kwds): class MarkType(VegaLiteSchema): - """MarkType schema wrapper""" + """MarkType schema wrapper.""" _schema = {"$ref": "#/definitions/MarkType"} @@ -12903,7 +12923,7 @@ def __init__(self, *args): class Month(VegaLiteSchema): - """Month schema wrapper""" + """Month schema wrapper.""" _schema = {"$ref": "#/definitions/Month"} @@ -12912,12 +12932,13 @@ def __init__(self, *args): class MultiLineString(Geometry): - """MultiLineString schema wrapper + """ + MultiLineString schema wrapper. + MultiLineString geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.5 Parameters ---------- - coordinates : Sequence[Sequence[Sequence[float], :class:`Position`]] type : str @@ -12942,12 +12963,13 @@ def __init__( class MultiPoint(Geometry): - """MultiPoint schema wrapper + """ + MultiPoint schema wrapper. + MultiPoint geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.3 Parameters ---------- - coordinates : Sequence[Sequence[float], :class:`Position`] type : str @@ -12970,12 +12992,13 @@ def __init__( class MultiPolygon(Geometry): - """MultiPolygon schema wrapper + """ + MultiPolygon schema wrapper. + MultiPolygon geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.7 Parameters ---------- - coordinates : Sequence[Sequence[Sequence[Sequence[float], :class:`Position`]]] type : str @@ -13000,11 +13023,11 @@ def __init__( class NamedData(DataSource): - """NamedData schema wrapper + """ + NamedData schema wrapper. Parameters ---------- - name : str Provide a placeholder name and bind data at runtime. @@ -13028,7 +13051,7 @@ def __init__( class NonArgAggregateOp(Aggregate): - """NonArgAggregateOp schema wrapper""" + """NonArgAggregateOp schema wrapper.""" _schema = {"$ref": "#/definitions/NonArgAggregateOp"} @@ -13037,7 +13060,9 @@ def __init__(self, *args): class NonNormalizedSpec(VegaLiteSchema): - """NonNormalizedSpec schema wrapper + """ + NonNormalizedSpec schema wrapper. + Any specification in Vega-Lite. """ @@ -13048,12 +13073,13 @@ def __init__(self, *args, **kwds): class NumberLocale(VegaLiteSchema): - """NumberLocale schema wrapper + """ + NumberLocale schema wrapper. + Locale definition for formatting numbers. Parameters ---------- - currency : Sequence[str], :class:`Vector2string` The currency prefix and suffix (e.g., ["$", ""]). decimal : str @@ -13100,7 +13126,7 @@ def __init__( class NumericArrayMarkPropDef(VegaLiteSchema): - """NumericArrayMarkPropDef schema wrapper""" + """NumericArrayMarkPropDef schema wrapper.""" _schema = {"$ref": "#/definitions/NumericArrayMarkPropDef"} @@ -13111,11 +13137,11 @@ def __init__(self, *args, **kwds): class FieldOrDatumDefWithConditionDatumDefnumberArray( MarkPropDefnumberArray, NumericArrayMarkPropDef ): - """FieldOrDatumDefWithConditionDatumDefnumberArray schema wrapper + """ + FieldOrDatumDefWithConditionDatumDefnumberArray schema wrapper. Parameters ---------- - bandPosition : float Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, @@ -13248,11 +13274,11 @@ def __init__( class FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray( MarkPropDefnumberArray, NumericArrayMarkPropDef ): - """FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray schema wrapper + r""" + FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -13522,7 +13548,7 @@ def __init__( class NumericMarkPropDef(VegaLiteSchema): - """NumericMarkPropDef schema wrapper""" + """NumericMarkPropDef schema wrapper.""" _schema = {"$ref": "#/definitions/NumericMarkPropDef"} @@ -13531,11 +13557,11 @@ def __init__(self, *args, **kwds): class FieldOrDatumDefWithConditionDatumDefnumber(MarkPropDefnumber, NumericMarkPropDef): - """FieldOrDatumDefWithConditionDatumDefnumber schema wrapper + """ + FieldOrDatumDefWithConditionDatumDefnumber schema wrapper. Parameters ---------- - bandPosition : float Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, @@ -13668,11 +13694,11 @@ def __init__( class FieldOrDatumDefWithConditionMarkPropFieldDefnumber( MarkPropDefnumber, NumericMarkPropDef ): - """FieldOrDatumDefWithConditionMarkPropFieldDefnumber schema wrapper + r""" + FieldOrDatumDefWithConditionMarkPropFieldDefnumber schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -13942,7 +13968,7 @@ def __init__( class OffsetDef(VegaLiteSchema): - """OffsetDef schema wrapper""" + """OffsetDef schema wrapper.""" _schema = {"$ref": "#/definitions/OffsetDef"} @@ -13951,11 +13977,11 @@ def __init__(self, *args, **kwds): class OrderFieldDef(VegaLiteSchema): - """OrderFieldDef schema wrapper + r""" + OrderFieldDef schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -14140,11 +14166,11 @@ def __init__( class OrderOnlyDef(VegaLiteSchema): - """OrderOnlyDef schema wrapper + """ + OrderOnlyDef schema wrapper. Parameters ---------- - sort : :class:`SortOrder`, Literal['ascending', 'descending'] The sort order. One of ``"ascending"`` (default) or ``"descending"``. """ @@ -14156,11 +14182,11 @@ def __init__(self, sort: Optional[SchemaBase | SortOrder_T] = Undefined, **kwds) class OrderValueDef(VegaLiteSchema): - """OrderValueDef schema wrapper + """ + OrderValueDef schema wrapper. Parameters ---------- - value : dict, float, :class:`ExprRef` A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition `__ for color, @@ -14188,7 +14214,7 @@ def __init__( class Orient(VegaLiteSchema): - """Orient schema wrapper""" + """Orient schema wrapper.""" _schema = {"$ref": "#/definitions/Orient"} @@ -14197,7 +14223,7 @@ def __init__(self, *args): class Orientation(VegaLiteSchema): - """Orientation schema wrapper""" + """Orientation schema wrapper.""" _schema = {"$ref": "#/definitions/Orientation"} @@ -14206,11 +14232,11 @@ def __init__(self, *args): class OverlayMarkDef(VegaLiteSchema): - """OverlayMarkDef schema wrapper + """ + OverlayMarkDef schema wrapper. Parameters ---------- - align : dict, :class:`Align`, :class:`ExprRef`, Literal['left', 'center', 'right'] The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of ``"left"``, ``"right"``, ``"center"``. @@ -14812,7 +14838,7 @@ def __init__( class Padding(VegaLiteSchema): - """Padding schema wrapper""" + """Padding schema wrapper.""" _schema = {"$ref": "#/definitions/Padding"} @@ -14821,7 +14847,7 @@ def __init__(self, *args, **kwds): class ParameterExtent(BinExtent): - """ParameterExtent schema wrapper""" + """ParameterExtent schema wrapper.""" _schema = {"$ref": "#/definitions/ParameterExtent"} @@ -14830,7 +14856,7 @@ def __init__(self, *args, **kwds): class ParameterName(VegaLiteSchema): - """ParameterName schema wrapper""" + """ParameterName schema wrapper.""" _schema = {"$ref": "#/definitions/ParameterName"} @@ -14839,7 +14865,7 @@ def __init__(self, *args): class Parse(VegaLiteSchema): - """Parse schema wrapper""" + """Parse schema wrapper.""" _schema = {"$ref": "#/definitions/Parse"} @@ -14848,7 +14874,7 @@ def __init__(self, **kwds): class ParseValue(VegaLiteSchema): - """ParseValue schema wrapper""" + """ParseValue schema wrapper.""" _schema = {"$ref": "#/definitions/ParseValue"} @@ -14857,12 +14883,13 @@ def __init__(self, *args, **kwds): class Point(Geometry): - """Point schema wrapper + """ + Point schema wrapper. + Point geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.2 Parameters ---------- - coordinates : Sequence[float], :class:`Position` A Position is an array of coordinates. https://tools.ietf.org/html/rfc7946#section-3.1.1 Array should contain between two @@ -14889,11 +14916,11 @@ def __init__( class PointSelectionConfig(VegaLiteSchema): - """PointSelectionConfig schema wrapper + """ + PointSelectionConfig schema wrapper. Parameters ---------- - type : str Determines the default event processing and data query for the selection. Vega-Lite currently supports two selection types: @@ -15017,11 +15044,11 @@ def __init__( class PointSelectionConfigWithoutType(VegaLiteSchema): - """PointSelectionConfigWithoutType schema wrapper + """ + PointSelectionConfigWithoutType schema wrapper. Parameters ---------- - clear : str, bool, dict, :class:`Stream`, :class:`EventStream`, :class:`MergedStream`, :class:`DerivedStream` Clears the selection, emptying it of all values. This property can be a `Event Stream `__ or ``false`` to disable @@ -15135,7 +15162,7 @@ def __init__( class PolarDef(VegaLiteSchema): - """PolarDef schema wrapper""" + """PolarDef schema wrapper.""" _schema = {"$ref": "#/definitions/PolarDef"} @@ -15144,12 +15171,13 @@ def __init__(self, *args, **kwds): class Polygon(Geometry): - """Polygon schema wrapper + """ + Polygon schema wrapper. + Polygon geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.6 Parameters ---------- - coordinates : Sequence[Sequence[Sequence[float], :class:`Position`]] type : str @@ -15174,7 +15202,9 @@ def __init__( class Position(VegaLiteSchema): - """Position schema wrapper + """ + Position schema wrapper. + A Position is an array of coordinates. https://tools.ietf.org/html/rfc7946#section-3.1.1 Array should contain between two and three elements. The previous GeoJSON specification allowed more elements (e.g., which could be used to represent M values), but the current @@ -15188,7 +15218,7 @@ def __init__(self, *args): class Position2Def(VegaLiteSchema): - """Position2Def schema wrapper""" + """Position2Def schema wrapper.""" _schema = {"$ref": "#/definitions/Position2Def"} @@ -15197,11 +15227,11 @@ def __init__(self, *args, **kwds): class DatumDef(LatLongDef, Position2Def): - """DatumDef schema wrapper + """ + DatumDef schema wrapper. Parameters ---------- - bandPosition : float Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, @@ -15317,11 +15347,11 @@ def __init__( class PositionDatumDefBase(PolarDef): - """PositionDatumDefBase schema wrapper + """ + PositionDatumDefBase schema wrapper. Parameters ---------- - bandPosition : float Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, @@ -15489,7 +15519,7 @@ def __init__( class PositionDef(VegaLiteSchema): - """PositionDef schema wrapper""" + """PositionDef schema wrapper.""" _schema = {"$ref": "#/definitions/PositionDef"} @@ -15498,11 +15528,11 @@ def __init__(self, *args, **kwds): class PositionDatumDef(PositionDef): - """PositionDatumDef schema wrapper + """ + PositionDatumDef schema wrapper. Parameters ---------- - axis : dict, None, :class:`Axis` An object defining properties of axis's gridlines, ticks and labels. If ``null``, the axis for the encoding channel will be removed. @@ -15691,11 +15721,11 @@ def __init__( class PositionFieldDef(PositionDef): - """PositionFieldDef schema wrapper + r""" + PositionFieldDef schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -15995,11 +16025,11 @@ def __init__( class PositionFieldDefBase(PolarDef): - """PositionFieldDefBase schema wrapper + r""" + PositionFieldDefBase schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -16278,13 +16308,14 @@ def __init__( class PositionValueDef(PolarDef, Position2Def, PositionDef): - """PositionValueDef schema wrapper + """ + PositionValueDef schema wrapper. + Definition object for a constant value (primitive value or gradient definition) of an encoding channel. Parameters ---------- - value : str, dict, float, :class:`ExprRef` A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition `__ for color, @@ -16302,7 +16333,7 @@ def __init__( class PredicateComposition(VegaLiteSchema): - """PredicateComposition schema wrapper""" + """PredicateComposition schema wrapper.""" _schema = {"$ref": "#/definitions/PredicateComposition"} @@ -16311,11 +16342,11 @@ def __init__(self, *args, **kwds): class LogicalAndPredicate(PredicateComposition): - """LogicalAndPredicate schema wrapper + """ + LogicalAndPredicate schema wrapper. Parameters ---------- - and : Sequence[str, dict, :class:`Predicate`, :class:`FieldGTPredicate`, :class:`FieldLTPredicate`, :class:`FieldGTEPredicate`, :class:`FieldLTEPredicate`, :class:`LogicalOrPredicate`, :class:`ParameterPredicate`, :class:`FieldEqualPredicate`, :class:`FieldOneOfPredicate`, :class:`FieldRangePredicate`, :class:`FieldValidPredicate`, :class:`LogicalAndPredicate`, :class:`LogicalNotPredicate`, :class:`PredicateComposition`] """ @@ -16327,11 +16358,11 @@ def __init__(self, **kwds): class LogicalNotPredicate(PredicateComposition): - """LogicalNotPredicate schema wrapper + """ + LogicalNotPredicate schema wrapper. Parameters ---------- - not : str, dict, :class:`Predicate`, :class:`FieldGTPredicate`, :class:`FieldLTPredicate`, :class:`FieldGTEPredicate`, :class:`FieldLTEPredicate`, :class:`LogicalOrPredicate`, :class:`ParameterPredicate`, :class:`FieldEqualPredicate`, :class:`FieldOneOfPredicate`, :class:`FieldRangePredicate`, :class:`FieldValidPredicate`, :class:`LogicalAndPredicate`, :class:`LogicalNotPredicate`, :class:`PredicateComposition` """ @@ -16343,11 +16374,11 @@ def __init__(self, **kwds): class LogicalOrPredicate(PredicateComposition): - """LogicalOrPredicate schema wrapper + """ + LogicalOrPredicate schema wrapper. Parameters ---------- - or : Sequence[str, dict, :class:`Predicate`, :class:`FieldGTPredicate`, :class:`FieldLTPredicate`, :class:`FieldGTEPredicate`, :class:`FieldLTEPredicate`, :class:`LogicalOrPredicate`, :class:`ParameterPredicate`, :class:`FieldEqualPredicate`, :class:`FieldOneOfPredicate`, :class:`FieldRangePredicate`, :class:`FieldValidPredicate`, :class:`LogicalAndPredicate`, :class:`LogicalNotPredicate`, :class:`PredicateComposition`] """ @@ -16359,7 +16390,7 @@ def __init__(self, **kwds): class Predicate(PredicateComposition): - """Predicate schema wrapper""" + """Predicate schema wrapper.""" _schema = {"$ref": "#/definitions/Predicate"} @@ -16368,11 +16399,11 @@ def __init__(self, *args, **kwds): class FieldEqualPredicate(Predicate): - """FieldEqualPredicate schema wrapper + """ + FieldEqualPredicate schema wrapper. Parameters ---------- - equal : str, bool, dict, float, :class:`ExprRef`, :class:`DateTime` The value that the field should be equal to. field : str, :class:`FieldName` @@ -16396,11 +16427,11 @@ def __init__( class FieldGTEPredicate(Predicate): - """FieldGTEPredicate schema wrapper + """ + FieldGTEPredicate schema wrapper. Parameters ---------- - field : str, :class:`FieldName` Field to be tested. gte : str, dict, float, :class:`ExprRef`, :class:`DateTime` @@ -16424,11 +16455,11 @@ def __init__( class FieldGTPredicate(Predicate): - """FieldGTPredicate schema wrapper + """ + FieldGTPredicate schema wrapper. Parameters ---------- - field : str, :class:`FieldName` Field to be tested. gt : str, dict, float, :class:`ExprRef`, :class:`DateTime` @@ -16452,11 +16483,11 @@ def __init__( class FieldLTEPredicate(Predicate): - """FieldLTEPredicate schema wrapper + """ + FieldLTEPredicate schema wrapper. Parameters ---------- - field : str, :class:`FieldName` Field to be tested. lte : str, dict, float, :class:`ExprRef`, :class:`DateTime` @@ -16480,11 +16511,11 @@ def __init__( class FieldLTPredicate(Predicate): - """FieldLTPredicate schema wrapper + """ + FieldLTPredicate schema wrapper. Parameters ---------- - field : str, :class:`FieldName` Field to be tested. lt : str, dict, float, :class:`ExprRef`, :class:`DateTime` @@ -16508,11 +16539,11 @@ def __init__( class FieldOneOfPredicate(Predicate): - """FieldOneOfPredicate schema wrapper + """ + FieldOneOfPredicate schema wrapper. Parameters ---------- - field : str, :class:`FieldName` Field to be tested. oneOf : Sequence[str], Sequence[bool], Sequence[float], Sequence[dict, :class:`DateTime`] @@ -16542,11 +16573,11 @@ def __init__( class FieldRangePredicate(Predicate): - """FieldRangePredicate schema wrapper + """ + FieldRangePredicate schema wrapper. Parameters ---------- - field : str, :class:`FieldName` Field to be tested. range : dict, :class:`ExprRef`, Sequence[dict, None, float, :class:`ExprRef`, :class:`DateTime`] @@ -16576,11 +16607,11 @@ def __init__( class FieldValidPredicate(Predicate): - """FieldValidPredicate schema wrapper + """ + FieldValidPredicate schema wrapper. Parameters ---------- - field : str, :class:`FieldName` Field to be tested. valid : bool @@ -16606,11 +16637,11 @@ def __init__( class ParameterPredicate(Predicate): - """ParameterPredicate schema wrapper + """ + ParameterPredicate schema wrapper. Parameters ---------- - param : str, :class:`ParameterName` Filter using a parameter name. empty : bool @@ -16630,11 +16661,11 @@ def __init__( class Projection(VegaLiteSchema): - """Projection schema wrapper + """ + Projection schema wrapper. Parameters ---------- - center : dict, Sequence[float], :class:`ExprRef`, :class:`Vector2number` The projection's center, a two-element array of longitude and latitude in degrees. @@ -16811,11 +16842,11 @@ def __init__( class ProjectionConfig(VegaLiteSchema): - """ProjectionConfig schema wrapper + """ + ProjectionConfig schema wrapper. Parameters ---------- - center : dict, Sequence[float], :class:`ExprRef`, :class:`Vector2number` The projection's center, a two-element array of longitude and latitude in degrees. @@ -16992,7 +17023,7 @@ def __init__( class ProjectionType(VegaLiteSchema): - """ProjectionType schema wrapper""" + """ProjectionType schema wrapper.""" _schema = {"$ref": "#/definitions/ProjectionType"} @@ -17001,11 +17032,11 @@ def __init__(self, *args): class RadialGradient(Gradient): - """RadialGradient schema wrapper + """ + RadialGradient schema wrapper. Parameters ---------- - gradient : str The type of gradient. Use ``"radial"`` for a radial gradient. stops : Sequence[dict, :class:`GradientStop`] @@ -17074,11 +17105,11 @@ def __init__( class RangeConfig(VegaLiteSchema): - """RangeConfig schema wrapper + """ + RangeConfig schema wrapper. Parameters ---------- - category : dict, :class:`RangeRaw`, :class:`RangeEnum`, :class:`RangeScheme`, Sequence[str, bool, None, float, Sequence[float], :class:`RangeRawArray`], Literal['width', 'height', 'symbol', 'category', 'ordinal', 'ramp', 'diverging', 'heatmap'], Sequence[str, :class:`Color`, :class:`HexColor`, :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple']] Default `color scheme `__ for categorical data. @@ -17153,7 +17184,7 @@ def __init__( class RangeRawArray(VegaLiteSchema): - """RangeRawArray schema wrapper""" + """RangeRawArray schema wrapper.""" _schema = {"$ref": "#/definitions/RangeRawArray"} @@ -17162,7 +17193,7 @@ def __init__(self, *args): class RangeScheme(VegaLiteSchema): - """RangeScheme schema wrapper""" + """RangeScheme schema wrapper.""" _schema = {"$ref": "#/definitions/RangeScheme"} @@ -17171,7 +17202,7 @@ def __init__(self, *args, **kwds): class RangeEnum(RangeScheme): - """RangeEnum schema wrapper""" + """RangeEnum schema wrapper.""" _schema = {"$ref": "#/definitions/RangeEnum"} @@ -17180,7 +17211,7 @@ def __init__(self, *args): class RangeRaw(RangeScheme): - """RangeRaw schema wrapper""" + """RangeRaw schema wrapper.""" _schema = {"$ref": "#/definitions/RangeRaw"} @@ -17189,11 +17220,11 @@ def __init__(self, *args): class RectConfig(AnyMarkConfig): - """RectConfig schema wrapper + """ + RectConfig schema wrapper. Parameters ---------- - align : dict, :class:`Align`, :class:`ExprRef`, Literal['left', 'center', 'right'] The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of ``"left"``, ``"right"``, ``"center"``. @@ -17765,11 +17796,11 @@ def __init__( class RelativeBandSize(VegaLiteSchema): - """RelativeBandSize schema wrapper + """ + RelativeBandSize schema wrapper. Parameters ---------- - band : float The relative band size. For example ``0.5`` means half of the band scale's band width. @@ -17782,11 +17813,11 @@ def __init__(self, band: Optional[float] = Undefined, **kwds): class RepeatMapping(VegaLiteSchema): - """RepeatMapping schema wrapper + """ + RepeatMapping schema wrapper. Parameters ---------- - column : Sequence[str] An array of fields to be repeated horizontally. row : Sequence[str] @@ -17805,12 +17836,13 @@ def __init__( class RepeatRef(Field): - """RepeatRef schema wrapper + """ + RepeatRef schema wrapper. + Reference to a repeated value. Parameters ---------- - repeat : Literal['row', 'column', 'repeat', 'layer'] """ @@ -17826,14 +17858,15 @@ def __init__( class Resolve(VegaLiteSchema): - """Resolve schema wrapper + """ + Resolve schema wrapper. + Defines how scales, axes, and legends from different specs should be combined. Resolve is a mapping from ``scale``, ``axis``, and ``legend`` to a mapping from channels to resolutions. Scales and guides can be resolved to be ``"independent"`` or ``"shared"``. Parameters ---------- - axis : dict, :class:`AxisResolveMap` legend : dict, :class:`LegendResolveMap` @@ -17855,7 +17888,7 @@ def __init__( class ResolveMode(VegaLiteSchema): - """ResolveMode schema wrapper""" + """ResolveMode schema wrapper.""" _schema = {"$ref": "#/definitions/ResolveMode"} @@ -17864,11 +17897,11 @@ def __init__(self, *args): class RowColLayoutAlign(VegaLiteSchema): - """RowColLayoutAlign schema wrapper + """ + RowColLayoutAlign schema wrapper. Parameters ---------- - column : :class:`LayoutAlign`, Literal['all', 'each', 'none'] row : :class:`LayoutAlign`, Literal['all', 'each', 'none'] @@ -17887,11 +17920,11 @@ def __init__( class RowColboolean(VegaLiteSchema): - """RowColboolean schema wrapper + """ + RowColboolean schema wrapper. Parameters ---------- - column : bool row : bool @@ -17910,11 +17943,11 @@ def __init__( class RowColnumber(VegaLiteSchema): - """RowColnumber schema wrapper + """ + RowColnumber schema wrapper. Parameters ---------- - column : float row : float @@ -17933,11 +17966,11 @@ def __init__( class RowColumnEncodingFieldDef(VegaLiteSchema): - """RowColumnEncodingFieldDef schema wrapper + r""" + RowColumnEncodingFieldDef schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -18191,11 +18224,11 @@ def __init__( class Scale(VegaLiteSchema): - """Scale schema wrapper + """ + Scale schema wrapper. Parameters ---------- - align : dict, float, :class:`ExprRef` The alignment of the steps within the scale range. @@ -18530,7 +18563,7 @@ def __init__( class ScaleBins(VegaLiteSchema): - """ScaleBins schema wrapper""" + """ScaleBins schema wrapper.""" _schema = {"$ref": "#/definitions/ScaleBins"} @@ -18539,11 +18572,11 @@ def __init__(self, *args, **kwds): class ScaleBinParams(ScaleBins): - """ScaleBinParams schema wrapper + """ + ScaleBinParams schema wrapper. Parameters ---------- - step : float The step size defining the bin interval width. start : float @@ -18569,11 +18602,11 @@ def __init__( class ScaleConfig(VegaLiteSchema): - """ScaleConfig schema wrapper + """ + ScaleConfig schema wrapper. Parameters ---------- - bandPaddingInner : dict, float, :class:`ExprRef` Default inner padding for ``x`` and ``y`` band scales. @@ -18798,11 +18831,11 @@ def __init__( class ScaleDatumDef(OffsetDef): - """ScaleDatumDef schema wrapper + """ + ScaleDatumDef schema wrapper. Parameters ---------- - bandPosition : float Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, @@ -18937,11 +18970,11 @@ def __init__( class ScaleFieldDef(OffsetDef): - """ScaleFieldDef schema wrapper + r""" + ScaleFieldDef schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -19187,7 +19220,7 @@ def __init__( class ScaleInterpolateEnum(VegaLiteSchema): - """ScaleInterpolateEnum schema wrapper""" + """ScaleInterpolateEnum schema wrapper.""" _schema = {"$ref": "#/definitions/ScaleInterpolateEnum"} @@ -19196,11 +19229,11 @@ def __init__(self, *args): class ScaleInterpolateParams(VegaLiteSchema): - """ScaleInterpolateParams schema wrapper + """ + ScaleInterpolateParams schema wrapper. Parameters ---------- - type : Literal['rgb', 'cubehelix', 'cubehelix-long'] gamma : float @@ -19219,11 +19252,11 @@ def __init__( class ScaleInvalidDataConfig(VegaLiteSchema): - """ScaleInvalidDataConfig schema wrapper + """ + ScaleInvalidDataConfig schema wrapper. Parameters ---------- - angle : str, dict, :class:`ScaleInvalidDataShowAsangle`, :class:`ScaleInvalidDataShowAsValueangle` color : str, dict, :class:`ScaleInvalidDataShowAscolor`, :class:`ScaleInvalidDataShowAsValuecolor` @@ -19306,7 +19339,7 @@ def __init__( class ScaleInvalidDataShowAsangle(VegaLiteSchema): - """ScaleInvalidDataShowAsangle schema wrapper""" + """ScaleInvalidDataShowAsangle schema wrapper.""" _schema = {"$ref": '#/definitions/ScaleInvalidDataShowAs<"angle">'} @@ -19315,11 +19348,11 @@ def __init__(self, *args, **kwds): class ScaleInvalidDataShowAsValueangle(ScaleInvalidDataShowAsangle): - """ScaleInvalidDataShowAsValueangle schema wrapper + """ + ScaleInvalidDataShowAsValueangle schema wrapper. Parameters ---------- - value : float The rotation angle of the text, in degrees. """ @@ -19331,7 +19364,7 @@ def __init__(self, value: Optional[float] = Undefined, **kwds): class ScaleInvalidDataShowAscolor(VegaLiteSchema): - """ScaleInvalidDataShowAscolor schema wrapper""" + """ScaleInvalidDataShowAscolor schema wrapper.""" _schema = {"$ref": '#/definitions/ScaleInvalidDataShowAs<"color">'} @@ -19340,11 +19373,11 @@ def __init__(self, *args, **kwds): class ScaleInvalidDataShowAsValuecolor(ScaleInvalidDataShowAscolor): - """ScaleInvalidDataShowAsValuecolor schema wrapper + """ + ScaleInvalidDataShowAsValuecolor schema wrapper. Parameters ---------- - value : str, dict, :class:`Color`, :class:`Gradient`, :class:`HexColor`, :class:`ColorName`, :class:`LinearGradient`, :class:`RadialGradient`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'] Default color. @@ -19369,7 +19402,7 @@ def __init__( class ScaleInvalidDataShowAsfill(VegaLiteSchema): - """ScaleInvalidDataShowAsfill schema wrapper""" + """ScaleInvalidDataShowAsfill schema wrapper.""" _schema = {"$ref": '#/definitions/ScaleInvalidDataShowAs<"fill">'} @@ -19378,11 +19411,11 @@ def __init__(self, *args, **kwds): class ScaleInvalidDataShowAsValuefill(ScaleInvalidDataShowAsfill): - """ScaleInvalidDataShowAsValuefill schema wrapper + """ + ScaleInvalidDataShowAsValuefill schema wrapper. Parameters ---------- - value : str, dict, None, :class:`Color`, :class:`Gradient`, :class:`HexColor`, :class:`ColorName`, :class:`LinearGradient`, :class:`RadialGradient`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'] Default fill color. This property has higher precedence than ``config.color``. Set to ``null`` to remove fill. @@ -19401,7 +19434,7 @@ def __init__( class ScaleInvalidDataShowAsfillOpacity(VegaLiteSchema): - """ScaleInvalidDataShowAsfillOpacity schema wrapper""" + """ScaleInvalidDataShowAsfillOpacity schema wrapper.""" _schema = {"$ref": '#/definitions/ScaleInvalidDataShowAs<"fillOpacity">'} @@ -19410,11 +19443,11 @@ def __init__(self, *args, **kwds): class ScaleInvalidDataShowAsValuefillOpacity(ScaleInvalidDataShowAsfillOpacity): - """ScaleInvalidDataShowAsValuefillOpacity schema wrapper + """ + ScaleInvalidDataShowAsValuefillOpacity schema wrapper. Parameters ---------- - value : float The fill opacity (value between [0,1]). @@ -19428,7 +19461,7 @@ def __init__(self, value: Optional[float] = Undefined, **kwds): class ScaleInvalidDataShowAsopacity(VegaLiteSchema): - """ScaleInvalidDataShowAsopacity schema wrapper""" + """ScaleInvalidDataShowAsopacity schema wrapper.""" _schema = {"$ref": '#/definitions/ScaleInvalidDataShowAs<"opacity">'} @@ -19437,11 +19470,11 @@ def __init__(self, *args, **kwds): class ScaleInvalidDataShowAsValueopacity(ScaleInvalidDataShowAsopacity): - """ScaleInvalidDataShowAsValueopacity schema wrapper + """ + ScaleInvalidDataShowAsValueopacity schema wrapper. Parameters ---------- - value : float The overall opacity (value between [0,1]). @@ -19456,7 +19489,7 @@ def __init__(self, value: Optional[float] = Undefined, **kwds): class ScaleInvalidDataShowAsradius(VegaLiteSchema): - """ScaleInvalidDataShowAsradius schema wrapper""" + """ScaleInvalidDataShowAsradius schema wrapper.""" _schema = {"$ref": '#/definitions/ScaleInvalidDataShowAs<"radius">'} @@ -19465,11 +19498,11 @@ def __init__(self, *args, **kwds): class ScaleInvalidDataShowAsValueradius(ScaleInvalidDataShowAsradius): - """ScaleInvalidDataShowAsValueradius schema wrapper + """ + ScaleInvalidDataShowAsValueradius schema wrapper. Parameters ---------- - value : float For arc mark, the primary (outer) radius in pixels. @@ -19486,7 +19519,7 @@ def __init__(self, value: Optional[float] = Undefined, **kwds): class ScaleInvalidDataShowAsshape(VegaLiteSchema): - """ScaleInvalidDataShowAsshape schema wrapper""" + """ScaleInvalidDataShowAsshape schema wrapper.""" _schema = {"$ref": '#/definitions/ScaleInvalidDataShowAs<"shape">'} @@ -19495,11 +19528,11 @@ def __init__(self, *args, **kwds): class ScaleInvalidDataShowAsValueshape(ScaleInvalidDataShowAsshape): - """ScaleInvalidDataShowAsValueshape schema wrapper + """ + ScaleInvalidDataShowAsValueshape schema wrapper. Parameters ---------- - value : str, :class:`SymbolShape` Shape of the point marks. Supported values include: @@ -19524,7 +19557,7 @@ def __init__(self, value: Optional[str | SchemaBase] = Undefined, **kwds): class ScaleInvalidDataShowAssize(VegaLiteSchema): - """ScaleInvalidDataShowAssize schema wrapper""" + """ScaleInvalidDataShowAssize schema wrapper.""" _schema = {"$ref": '#/definitions/ScaleInvalidDataShowAs<"size">'} @@ -19533,11 +19566,11 @@ def __init__(self, *args, **kwds): class ScaleInvalidDataShowAsValuesize(ScaleInvalidDataShowAssize): - """ScaleInvalidDataShowAsValuesize schema wrapper + """ + ScaleInvalidDataShowAsValuesize schema wrapper. Parameters ---------- - value : float Default size for marks. @@ -19564,7 +19597,7 @@ def __init__(self, value: Optional[float] = Undefined, **kwds): class ScaleInvalidDataShowAsstroke(VegaLiteSchema): - """ScaleInvalidDataShowAsstroke schema wrapper""" + """ScaleInvalidDataShowAsstroke schema wrapper.""" _schema = {"$ref": '#/definitions/ScaleInvalidDataShowAs<"stroke">'} @@ -19573,11 +19606,11 @@ def __init__(self, *args, **kwds): class ScaleInvalidDataShowAsValuestroke(ScaleInvalidDataShowAsstroke): - """ScaleInvalidDataShowAsValuestroke schema wrapper + """ + ScaleInvalidDataShowAsValuestroke schema wrapper. Parameters ---------- - value : str, dict, None, :class:`Color`, :class:`Gradient`, :class:`HexColor`, :class:`ColorName`, :class:`LinearGradient`, :class:`RadialGradient`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'] Default stroke color. This property has higher precedence than ``config.color``. Set to ``null`` to remove stroke. @@ -19596,7 +19629,7 @@ def __init__( class ScaleInvalidDataShowAsstrokeDash(VegaLiteSchema): - """ScaleInvalidDataShowAsstrokeDash schema wrapper""" + """ScaleInvalidDataShowAsstrokeDash schema wrapper.""" _schema = {"$ref": '#/definitions/ScaleInvalidDataShowAs<"strokeDash">'} @@ -19605,11 +19638,11 @@ def __init__(self, *args, **kwds): class ScaleInvalidDataShowAsValuestrokeDash(ScaleInvalidDataShowAsstrokeDash): - """ScaleInvalidDataShowAsValuestrokeDash schema wrapper + """ + ScaleInvalidDataShowAsValuestrokeDash schema wrapper. Parameters ---------- - value : Sequence[float] An array of alternating stroke, space lengths for creating dashed or dotted lines. """ @@ -19621,7 +19654,7 @@ def __init__(self, value: Optional[Sequence[float]] = Undefined, **kwds): class ScaleInvalidDataShowAsstrokeOpacity(VegaLiteSchema): - """ScaleInvalidDataShowAsstrokeOpacity schema wrapper""" + """ScaleInvalidDataShowAsstrokeOpacity schema wrapper.""" _schema = {"$ref": '#/definitions/ScaleInvalidDataShowAs<"strokeOpacity">'} @@ -19630,11 +19663,11 @@ def __init__(self, *args, **kwds): class ScaleInvalidDataShowAsValuestrokeOpacity(ScaleInvalidDataShowAsstrokeOpacity): - """ScaleInvalidDataShowAsValuestrokeOpacity schema wrapper + """ + ScaleInvalidDataShowAsValuestrokeOpacity schema wrapper. Parameters ---------- - value : float The stroke opacity (value between [0,1]). @@ -19648,7 +19681,7 @@ def __init__(self, value: Optional[float] = Undefined, **kwds): class ScaleInvalidDataShowAsstrokeWidth(VegaLiteSchema): - """ScaleInvalidDataShowAsstrokeWidth schema wrapper""" + """ScaleInvalidDataShowAsstrokeWidth schema wrapper.""" _schema = {"$ref": '#/definitions/ScaleInvalidDataShowAs<"strokeWidth">'} @@ -19657,11 +19690,11 @@ def __init__(self, *args, **kwds): class ScaleInvalidDataShowAsValuestrokeWidth(ScaleInvalidDataShowAsstrokeWidth): - """ScaleInvalidDataShowAsValuestrokeWidth schema wrapper + """ + ScaleInvalidDataShowAsValuestrokeWidth schema wrapper. Parameters ---------- - value : float The stroke width, in pixels. """ @@ -19673,7 +19706,7 @@ def __init__(self, value: Optional[float] = Undefined, **kwds): class ScaleInvalidDataShowAstheta(VegaLiteSchema): - """ScaleInvalidDataShowAstheta schema wrapper""" + """ScaleInvalidDataShowAstheta schema wrapper.""" _schema = {"$ref": '#/definitions/ScaleInvalidDataShowAs<"theta">'} @@ -19682,11 +19715,11 @@ def __init__(self, *args, **kwds): class ScaleInvalidDataShowAsValuetheta(ScaleInvalidDataShowAstheta): - """ScaleInvalidDataShowAsValuetheta schema wrapper + """ + ScaleInvalidDataShowAsValuetheta schema wrapper. Parameters ---------- - value : float For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed @@ -19702,7 +19735,7 @@ def __init__(self, value: Optional[float] = Undefined, **kwds): class ScaleInvalidDataShowAsx(VegaLiteSchema): - """ScaleInvalidDataShowAsx schema wrapper""" + """ScaleInvalidDataShowAsx schema wrapper.""" _schema = {"$ref": '#/definitions/ScaleInvalidDataShowAs<"x">'} @@ -19711,11 +19744,11 @@ def __init__(self, *args, **kwds): class ScaleInvalidDataShowAsValuex(ScaleInvalidDataShowAsx): - """ScaleInvalidDataShowAsValuex schema wrapper + """ + ScaleInvalidDataShowAsValuex schema wrapper. Parameters ---------- - value : str, float X coordinates of the marks, or width of horizontal ``"bar"`` and ``"area"`` without specified ``x2`` or ``width``. @@ -19731,7 +19764,7 @@ def __init__(self, value: Optional[str | float] = Undefined, **kwds): class ScaleInvalidDataShowAsxOffset(VegaLiteSchema): - """ScaleInvalidDataShowAsxOffset schema wrapper""" + """ScaleInvalidDataShowAsxOffset schema wrapper.""" _schema = {"$ref": '#/definitions/ScaleInvalidDataShowAs<"xOffset">'} @@ -19740,11 +19773,11 @@ def __init__(self, *args, **kwds): class ScaleInvalidDataShowAsValuexOffset(ScaleInvalidDataShowAsxOffset): - """ScaleInvalidDataShowAsValuexOffset schema wrapper + """ + ScaleInvalidDataShowAsValuexOffset schema wrapper. Parameters ---------- - value : float Offset for x-position. """ @@ -19756,7 +19789,7 @@ def __init__(self, value: Optional[float] = Undefined, **kwds): class ScaleInvalidDataShowAsy(VegaLiteSchema): - """ScaleInvalidDataShowAsy schema wrapper""" + """ScaleInvalidDataShowAsy schema wrapper.""" _schema = {"$ref": '#/definitions/ScaleInvalidDataShowAs<"y">'} @@ -19765,11 +19798,11 @@ def __init__(self, *args, **kwds): class ScaleInvalidDataShowAsValuey(ScaleInvalidDataShowAsy): - """ScaleInvalidDataShowAsValuey schema wrapper + """ + ScaleInvalidDataShowAsValuey schema wrapper. Parameters ---------- - value : str, float Y coordinates of the marks, or height of vertical ``"bar"`` and ``"area"`` without specified ``y2`` or ``height``. @@ -19785,7 +19818,7 @@ def __init__(self, value: Optional[str | float] = Undefined, **kwds): class ScaleInvalidDataShowAsyOffset(VegaLiteSchema): - """ScaleInvalidDataShowAsyOffset schema wrapper""" + """ScaleInvalidDataShowAsyOffset schema wrapper.""" _schema = {"$ref": '#/definitions/ScaleInvalidDataShowAs<"yOffset">'} @@ -19794,11 +19827,11 @@ def __init__(self, *args, **kwds): class ScaleInvalidDataShowAsValueyOffset(ScaleInvalidDataShowAsyOffset): - """ScaleInvalidDataShowAsValueyOffset schema wrapper + """ + ScaleInvalidDataShowAsValueyOffset schema wrapper. Parameters ---------- - value : float Offset for y-position. """ @@ -19810,11 +19843,11 @@ def __init__(self, value: Optional[float] = Undefined, **kwds): class ScaleResolveMap(VegaLiteSchema): - """ScaleResolveMap schema wrapper + """ + ScaleResolveMap schema wrapper. Parameters ---------- - angle : :class:`ResolveMode`, Literal['independent', 'shared'] color : :class:`ResolveMode`, Literal['independent', 'shared'] @@ -19897,7 +19930,7 @@ def __init__( class ScaleType(VegaLiteSchema): - """ScaleType schema wrapper""" + """ScaleType schema wrapper.""" _schema = {"$ref": "#/definitions/ScaleType"} @@ -19906,11 +19939,11 @@ def __init__(self, *args): class SchemeParams(VegaLiteSchema): - """SchemeParams schema wrapper + """ + SchemeParams schema wrapper. Parameters ---------- - name : :class:`Cyclical`, :class:`Diverging`, :class:`Categorical`, :class:`ColorScheme`, :class:`SequentialMultiHue`, :class:`SequentialSingleHue`, Literal['rainbow', 'sinebow'], Literal['blues', 'tealblues', 'teals', 'greens', 'browns', 'greys', 'purples', 'warmgreys', 'reds', 'oranges'], Literal['accent', 'category10', 'category20', 'category20b', 'category20c', 'dark2', 'paired', 'pastel1', 'pastel2', 'set1', 'set2', 'set3', 'tableau10', 'tableau20'], Literal['blueorange', 'blueorange-3', 'blueorange-4', 'blueorange-5', 'blueorange-6', 'blueorange-7', 'blueorange-8', 'blueorange-9', 'blueorange-10', 'blueorange-11', 'brownbluegreen', 'brownbluegreen-3', 'brownbluegreen-4', 'brownbluegreen-5', 'brownbluegreen-6', 'brownbluegreen-7', 'brownbluegreen-8', 'brownbluegreen-9', 'brownbluegreen-10', 'brownbluegreen-11', 'purplegreen', 'purplegreen-3', 'purplegreen-4', 'purplegreen-5', 'purplegreen-6', 'purplegreen-7', 'purplegreen-8', 'purplegreen-9', 'purplegreen-10', 'purplegreen-11', 'pinkyellowgreen', 'pinkyellowgreen-3', 'pinkyellowgreen-4', 'pinkyellowgreen-5', 'pinkyellowgreen-6', 'pinkyellowgreen-7', 'pinkyellowgreen-8', 'pinkyellowgreen-9', 'pinkyellowgreen-10', 'pinkyellowgreen-11', 'purpleorange', 'purpleorange-3', 'purpleorange-4', 'purpleorange-5', 'purpleorange-6', 'purpleorange-7', 'purpleorange-8', 'purpleorange-9', 'purpleorange-10', 'purpleorange-11', 'redblue', 'redblue-3', 'redblue-4', 'redblue-5', 'redblue-6', 'redblue-7', 'redblue-8', 'redblue-9', 'redblue-10', 'redblue-11', 'redgrey', 'redgrey-3', 'redgrey-4', 'redgrey-5', 'redgrey-6', 'redgrey-7', 'redgrey-8', 'redgrey-9', 'redgrey-10', 'redgrey-11', 'redyellowblue', 'redyellowblue-3', 'redyellowblue-4', 'redyellowblue-5', 'redyellowblue-6', 'redyellowblue-7', 'redyellowblue-8', 'redyellowblue-9', 'redyellowblue-10', 'redyellowblue-11', 'redyellowgreen', 'redyellowgreen-3', 'redyellowgreen-4', 'redyellowgreen-5', 'redyellowgreen-6', 'redyellowgreen-7', 'redyellowgreen-8', 'redyellowgreen-9', 'redyellowgreen-10', 'redyellowgreen-11', 'spectral', 'spectral-3', 'spectral-4', 'spectral-5', 'spectral-6', 'spectral-7', 'spectral-8', 'spectral-9', 'spectral-10', 'spectral-11'], Literal['turbo', 'viridis', 'inferno', 'magma', 'plasma', 'cividis', 'bluegreen', 'bluegreen-3', 'bluegreen-4', 'bluegreen-5', 'bluegreen-6', 'bluegreen-7', 'bluegreen-8', 'bluegreen-9', 'bluepurple', 'bluepurple-3', 'bluepurple-4', 'bluepurple-5', 'bluepurple-6', 'bluepurple-7', 'bluepurple-8', 'bluepurple-9', 'goldgreen', 'goldgreen-3', 'goldgreen-4', 'goldgreen-5', 'goldgreen-6', 'goldgreen-7', 'goldgreen-8', 'goldgreen-9', 'goldorange', 'goldorange-3', 'goldorange-4', 'goldorange-5', 'goldorange-6', 'goldorange-7', 'goldorange-8', 'goldorange-9', 'goldred', 'goldred-3', 'goldred-4', 'goldred-5', 'goldred-6', 'goldred-7', 'goldred-8', 'goldred-9', 'greenblue', 'greenblue-3', 'greenblue-4', 'greenblue-5', 'greenblue-6', 'greenblue-7', 'greenblue-8', 'greenblue-9', 'orangered', 'orangered-3', 'orangered-4', 'orangered-5', 'orangered-6', 'orangered-7', 'orangered-8', 'orangered-9', 'purplebluegreen', 'purplebluegreen-3', 'purplebluegreen-4', 'purplebluegreen-5', 'purplebluegreen-6', 'purplebluegreen-7', 'purplebluegreen-8', 'purplebluegreen-9', 'purpleblue', 'purpleblue-3', 'purpleblue-4', 'purpleblue-5', 'purpleblue-6', 'purpleblue-7', 'purpleblue-8', 'purpleblue-9', 'purplered', 'purplered-3', 'purplered-4', 'purplered-5', 'purplered-6', 'purplered-7', 'purplered-8', 'purplered-9', 'redpurple', 'redpurple-3', 'redpurple-4', 'redpurple-5', 'redpurple-6', 'redpurple-7', 'redpurple-8', 'redpurple-9', 'yellowgreenblue', 'yellowgreenblue-3', 'yellowgreenblue-4', 'yellowgreenblue-5', 'yellowgreenblue-6', 'yellowgreenblue-7', 'yellowgreenblue-8', 'yellowgreenblue-9', 'yellowgreen', 'yellowgreen-3', 'yellowgreen-4', 'yellowgreen-5', 'yellowgreen-6', 'yellowgreen-7', 'yellowgreen-8', 'yellowgreen-9', 'yelloworangebrown', 'yelloworangebrown-3', 'yelloworangebrown-4', 'yelloworangebrown-5', 'yelloworangebrown-6', 'yelloworangebrown-7', 'yelloworangebrown-8', 'yelloworangebrown-9', 'yelloworangered', 'yelloworangered-3', 'yelloworangered-4', 'yelloworangered-5', 'yelloworangered-6', 'yelloworangered-7', 'yelloworangered-8', 'yelloworangered-9', 'darkblue', 'darkblue-3', 'darkblue-4', 'darkblue-5', 'darkblue-6', 'darkblue-7', 'darkblue-8', 'darkblue-9', 'darkgold', 'darkgold-3', 'darkgold-4', 'darkgold-5', 'darkgold-6', 'darkgold-7', 'darkgold-8', 'darkgold-9', 'darkgreen', 'darkgreen-3', 'darkgreen-4', 'darkgreen-5', 'darkgreen-6', 'darkgreen-7', 'darkgreen-8', 'darkgreen-9', 'darkmulti', 'darkmulti-3', 'darkmulti-4', 'darkmulti-5', 'darkmulti-6', 'darkmulti-7', 'darkmulti-8', 'darkmulti-9', 'darkred', 'darkred-3', 'darkred-4', 'darkred-5', 'darkred-6', 'darkred-7', 'darkred-8', 'darkred-9', 'lightgreyred', 'lightgreyred-3', 'lightgreyred-4', 'lightgreyred-5', 'lightgreyred-6', 'lightgreyred-7', 'lightgreyred-8', 'lightgreyred-9', 'lightgreyteal', 'lightgreyteal-3', 'lightgreyteal-4', 'lightgreyteal-5', 'lightgreyteal-6', 'lightgreyteal-7', 'lightgreyteal-8', 'lightgreyteal-9', 'lightmulti', 'lightmulti-3', 'lightmulti-4', 'lightmulti-5', 'lightmulti-6', 'lightmulti-7', 'lightmulti-8', 'lightmulti-9', 'lightorange', 'lightorange-3', 'lightorange-4', 'lightorange-5', 'lightorange-6', 'lightorange-7', 'lightorange-8', 'lightorange-9', 'lighttealblue', 'lighttealblue-3', 'lighttealblue-4', 'lighttealblue-5', 'lighttealblue-6', 'lighttealblue-7', 'lighttealblue-8', 'lighttealblue-9'] A color scheme name for ordinal scales (e.g., ``"category10"`` or ``"blues"`` ). @@ -19939,13 +19972,14 @@ def __init__( class SecondaryFieldDef(Position2Def): - """SecondaryFieldDef schema wrapper + r""" + SecondaryFieldDef schema wrapper. + A field definition of a secondary channel that shares a scale with another primary channel. For example, ``x2``, ``xError`` and ``xError2`` share the same scale with ``x``. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -20055,11 +20089,11 @@ def __init__( class SelectionConfig(VegaLiteSchema): - """SelectionConfig schema wrapper + """ + SelectionConfig schema wrapper. Parameters ---------- - interval : dict, :class:`IntervalSelectionConfigWithoutType` The default definition for an `interval `__ selection. All @@ -20090,7 +20124,7 @@ def __init__( class SelectionInit(VegaLiteSchema): - """SelectionInit schema wrapper""" + """SelectionInit schema wrapper.""" _schema = {"$ref": "#/definitions/SelectionInit"} @@ -20099,14 +20133,15 @@ def __init__(self, *args, **kwds): class DateTime(SelectionInit): - """DateTime schema wrapper + """ + DateTime schema wrapper. + Object for defining datetime in Vega-Lite Filter. If both month and quarter are provided, month has higher precedence. ``day`` cannot be combined with other date. We accept string for month and day names. Parameters ---------- - date : float Integer value representing the date (day of the month) from 1-31. day : str, float, :class:`Day` @@ -20169,7 +20204,7 @@ def __init__( class PrimitiveValue(SelectionInit): - """PrimitiveValue schema wrapper""" + """PrimitiveValue schema wrapper.""" _schema = {"$ref": "#/definitions/PrimitiveValue"} @@ -20178,7 +20213,7 @@ def __init__(self, *args): class SelectionInitInterval(VegaLiteSchema): - """SelectionInitInterval schema wrapper""" + """SelectionInitInterval schema wrapper.""" _schema = {"$ref": "#/definitions/SelectionInitInterval"} @@ -20187,7 +20222,7 @@ def __init__(self, *args, **kwds): class SelectionInitIntervalMapping(VegaLiteSchema): - """SelectionInitIntervalMapping schema wrapper""" + """SelectionInitIntervalMapping schema wrapper.""" _schema = {"$ref": "#/definitions/SelectionInitIntervalMapping"} @@ -20196,7 +20231,7 @@ def __init__(self, **kwds): class SelectionInitMapping(VegaLiteSchema): - """SelectionInitMapping schema wrapper""" + """SelectionInitMapping schema wrapper.""" _schema = {"$ref": "#/definitions/SelectionInitMapping"} @@ -20205,11 +20240,11 @@ def __init__(self, **kwds): class SelectionParameter(VegaLiteSchema): - """SelectionParameter schema wrapper + """ + SelectionParameter schema wrapper. Parameters ---------- - name : str, :class:`ParameterName` Required. A unique name for the selection parameter. Selection names should be valid JavaScript identifiers: they should contain only alphanumeric characters (or "$", or @@ -20264,7 +20299,7 @@ def __init__( class SelectionResolution(VegaLiteSchema): - """SelectionResolution schema wrapper""" + """SelectionResolution schema wrapper.""" _schema = {"$ref": "#/definitions/SelectionResolution"} @@ -20273,7 +20308,7 @@ def __init__(self, *args): class SelectionType(VegaLiteSchema): - """SelectionType schema wrapper""" + """SelectionType schema wrapper.""" _schema = {"$ref": "#/definitions/SelectionType"} @@ -20282,11 +20317,11 @@ def __init__(self, *args): class SequenceGenerator(Generator): - """SequenceGenerator schema wrapper + """ + SequenceGenerator schema wrapper. Parameters ---------- - sequence : dict, :class:`SequenceParams` Generate a sequence of numbers. name : str @@ -20305,11 +20340,11 @@ def __init__( class SequenceParams(VegaLiteSchema): - """SequenceParams schema wrapper + """ + SequenceParams schema wrapper. Parameters ---------- - start : float The starting value of the sequence (inclusive). stop : float @@ -20337,7 +20372,7 @@ def __init__( class SequentialMultiHue(ColorScheme): - """SequentialMultiHue schema wrapper""" + """SequentialMultiHue schema wrapper.""" _schema = {"$ref": "#/definitions/SequentialMultiHue"} @@ -20346,7 +20381,7 @@ def __init__(self, *args): class SequentialSingleHue(ColorScheme): - """SequentialSingleHue schema wrapper""" + """SequentialSingleHue schema wrapper.""" _schema = {"$ref": "#/definitions/SequentialSingleHue"} @@ -20355,7 +20390,7 @@ def __init__(self, *args): class ShapeDef(VegaLiteSchema): - """ShapeDef schema wrapper""" + """ShapeDef schema wrapper.""" _schema = {"$ref": "#/definitions/ShapeDef"} @@ -20366,11 +20401,11 @@ def __init__(self, *args, **kwds): class FieldOrDatumDefWithConditionDatumDefstringnull( MarkPropDefstringnullTypeForShape, ShapeDef ): - """FieldOrDatumDefWithConditionDatumDefstringnull schema wrapper + """ + FieldOrDatumDefWithConditionDatumDefstringnull schema wrapper. Parameters ---------- - bandPosition : float Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, @@ -20505,11 +20540,11 @@ def __init__( class FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull( MarkPropDefstringnullTypeForShape, ShapeDef ): - """FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull schema wrapper + r""" + FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -20779,11 +20814,11 @@ def __init__( class SharedEncoding(VegaLiteSchema): - """SharedEncoding schema wrapper + """ + SharedEncoding schema wrapper. Parameters ---------- - angle : dict color : dict @@ -20967,7 +21002,7 @@ def __init__( class SingleDefUnitChannel(VegaLiteSchema): - """SingleDefUnitChannel schema wrapper""" + """SingleDefUnitChannel schema wrapper.""" _schema = {"$ref": "#/definitions/SingleDefUnitChannel"} @@ -20976,7 +21011,7 @@ def __init__(self, *args): class Sort(VegaLiteSchema): - """Sort schema wrapper""" + """Sort schema wrapper.""" _schema = {"$ref": "#/definitions/Sort"} @@ -20985,7 +21020,7 @@ def __init__(self, *args, **kwds): class AllSortString(Sort): - """AllSortString schema wrapper""" + """AllSortString schema wrapper.""" _schema = {"$ref": "#/definitions/AllSortString"} @@ -20994,12 +21029,13 @@ def __init__(self, *args, **kwds): class EncodingSortField(Sort): - """EncodingSortField schema wrapper + """ + EncodingSortField schema wrapper. + A sort definition for sorting a discrete scale in an encoding field definition. Parameters ---------- - field : str, dict, :class:`Field`, :class:`FieldName`, :class:`RepeatRef` The data `field `__ to sort by. @@ -21035,7 +21071,7 @@ def __init__( class SortArray(Sort): - """SortArray schema wrapper""" + """SortArray schema wrapper.""" _schema = {"$ref": "#/definitions/SortArray"} @@ -21044,7 +21080,7 @@ def __init__(self, *args, **kwds): class SortByChannel(AllSortString): - """SortByChannel schema wrapper""" + """SortByChannel schema wrapper.""" _schema = {"$ref": "#/definitions/SortByChannel"} @@ -21053,7 +21089,7 @@ def __init__(self, *args): class SortByChannelDesc(AllSortString): - """SortByChannelDesc schema wrapper""" + """SortByChannelDesc schema wrapper.""" _schema = {"$ref": "#/definitions/SortByChannelDesc"} @@ -21062,11 +21098,11 @@ def __init__(self, *args): class SortByEncoding(Sort): - """SortByEncoding schema wrapper + """ + SortByEncoding schema wrapper. Parameters ---------- - encoding : :class:`SortByChannel`, Literal['x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', 'shape', 'fillOpacity', 'strokeOpacity', 'opacity', 'text'] The `encoding channel `__ to sort by (e.g., @@ -21088,12 +21124,13 @@ def __init__( class SortField(VegaLiteSchema): - """SortField schema wrapper + """ + SortField schema wrapper. + A sort definition for transform Parameters ---------- - field : str, :class:`FieldName` The name of the field to sort. order : None, :class:`SortOrder`, Literal['ascending', 'descending'] @@ -21113,7 +21150,7 @@ def __init__( class SortOrder(AllSortString): - """SortOrder schema wrapper""" + """SortOrder schema wrapper.""" _schema = {"$ref": "#/definitions/SortOrder"} @@ -21122,7 +21159,9 @@ def __init__(self, *args): class Spec(VegaLiteSchema): - """Spec schema wrapper + """ + Spec schema wrapper. + Any specification in Vega-Lite. """ @@ -21133,12 +21172,13 @@ def __init__(self, *args, **kwds): class ConcatSpecGenericSpec(Spec, NonNormalizedSpec): - """ConcatSpecGenericSpec schema wrapper + """ + ConcatSpecGenericSpec schema wrapper. + Base interface for a generalized concatenation specification. Parameters ---------- - concat : Sequence[dict, :class:`Spec`, :class:`FacetSpec`, :class:`LayerSpec`, :class:`RepeatSpec`, :class:`FacetedUnitSpec`, :class:`LayerRepeatSpec`, :class:`NonLayerRepeatSpec`, :class:`ConcatSpecGenericSpec`, :class:`HConcatSpecGenericSpec`, :class:`VConcatSpecGenericSpec`] A list of views to be concatenated. align : dict, :class:`LayoutAlign`, :class:`RowColLayoutAlign`, Literal['all', 'each', 'none'] @@ -21255,12 +21295,13 @@ def __init__( class FacetSpec(Spec, NonNormalizedSpec): - """FacetSpec schema wrapper + """ + FacetSpec schema wrapper. + Base interface for a facet specification. Parameters ---------- - facet : dict, :class:`FacetMapping`, :class:`FacetFieldDef` Definition for how to facet the data. One of: 1) `a field definition for faceting the plot by one field @@ -21385,13 +21426,14 @@ def __init__( class FacetedUnitSpec(Spec, NonNormalizedSpec): - """FacetedUnitSpec schema wrapper + """ + FacetedUnitSpec schema wrapper. + Unit spec that can have a composite mark and row or column channels (shorthand for a facet spec). Parameters ---------- - mark : str, dict, :class:`Mark`, :class:`AnyMark`, :class:`BoxPlot`, :class:`MarkDef`, :class:`ErrorBar`, :class:`ErrorBand`, :class:`BoxPlotDef`, :class:`ErrorBarDef`, :class:`ErrorBandDef`, :class:`CompositeMark`, :class:`CompositeMarkDef`, Literal['arc', 'area', 'bar', 'image', 'line', 'point', 'rect', 'rule', 'text', 'tick', 'trail', 'circle', 'square', 'geoshape'] A string describing the mark type (one of ``"bar"``, ``"circle"``, ``"square"``, ``"tick"``, ``"line"``, ``"area"``, ``"point"``, ``"rule"``, ``"geoshape"``, and @@ -21556,12 +21598,13 @@ def __init__( class HConcatSpecGenericSpec(Spec, NonNormalizedSpec): - """HConcatSpecGenericSpec schema wrapper + """ + HConcatSpecGenericSpec schema wrapper. + Base interface for a horizontal concatenation specification. Parameters ---------- - hconcat : Sequence[dict, :class:`Spec`, :class:`FacetSpec`, :class:`LayerSpec`, :class:`RepeatSpec`, :class:`FacetedUnitSpec`, :class:`LayerRepeatSpec`, :class:`NonLayerRepeatSpec`, :class:`ConcatSpecGenericSpec`, :class:`HConcatSpecGenericSpec`, :class:`VConcatSpecGenericSpec`] A list of views to be concatenated and put into a row. bounds : Literal['full', 'flush'] @@ -21632,13 +21675,14 @@ def __init__( class LayerSpec(Spec, NonNormalizedSpec): - """LayerSpec schema wrapper + """ + LayerSpec schema wrapper. + A full layered plot specification, which may contains ``encoding`` and ``projection`` properties that will be applied to underlying unit (single-view) specifications. Parameters ---------- - layer : Sequence[dict, :class:`UnitSpec`, :class:`LayerSpec`] Layer or single view specifications to be layered. @@ -21747,7 +21791,7 @@ def __init__( class RepeatSpec(Spec, NonNormalizedSpec): - """RepeatSpec schema wrapper""" + """RepeatSpec schema wrapper.""" _schema = {"$ref": "#/definitions/RepeatSpec"} @@ -21756,11 +21800,11 @@ def __init__(self, *args, **kwds): class LayerRepeatSpec(RepeatSpec): - """LayerRepeatSpec schema wrapper + """ + LayerRepeatSpec schema wrapper. Parameters ---------- - repeat : dict, :class:`LayerRepeatMapping` Definition for fields to be repeated. One of: 1) An array of fields to be repeated. If ``"repeat"`` is an array, the field can be referred to as ``{"repeat": @@ -21887,12 +21931,13 @@ def __init__( class NonLayerRepeatSpec(RepeatSpec): - """NonLayerRepeatSpec schema wrapper + """ + NonLayerRepeatSpec schema wrapper. + Base interface for a repeat specification. Parameters ---------- - repeat : dict, Sequence[str], :class:`RepeatMapping` Definition for fields to be repeated. One of: 1) An array of fields to be repeated. If ``"repeat"`` is an array, the field can be referred to as ``{"repeat": @@ -22019,11 +22064,11 @@ def __init__( class SphereGenerator(Generator): - """SphereGenerator schema wrapper + """ + SphereGenerator schema wrapper. Parameters ---------- - sphere : bool, dict Generate sphere GeoJSON data for the full globe. name : str @@ -22042,7 +22087,7 @@ def __init__( class StackOffset(VegaLiteSchema): - """StackOffset schema wrapper""" + """StackOffset schema wrapper.""" _schema = {"$ref": "#/definitions/StackOffset"} @@ -22051,7 +22096,7 @@ def __init__(self, *args): class StandardType(VegaLiteSchema): - """StandardType schema wrapper""" + """StandardType schema wrapper.""" _schema = {"$ref": "#/definitions/StandardType"} @@ -22060,11 +22105,11 @@ def __init__(self, *args): class Step(VegaLiteSchema): - """Step schema wrapper + """ + Step schema wrapper. Parameters ---------- - step : float The size (width/height) per discrete step. for : :class:`StepFor`, Literal['position', 'offset'] @@ -22079,7 +22124,7 @@ def __init__(self, step: Optional[float] = Undefined, **kwds): class StepFor(VegaLiteSchema): - """StepFor schema wrapper""" + """StepFor schema wrapper.""" _schema = {"$ref": "#/definitions/StepFor"} @@ -22088,7 +22133,7 @@ def __init__(self, *args): class Stream(VegaLiteSchema): - """Stream schema wrapper""" + """Stream schema wrapper.""" _schema = {"$ref": "#/definitions/Stream"} @@ -22097,11 +22142,11 @@ def __init__(self, *args, **kwds): class DerivedStream(Stream): - """DerivedStream schema wrapper + """ + DerivedStream schema wrapper. Parameters ---------- - stream : dict, :class:`Stream`, :class:`EventStream`, :class:`MergedStream`, :class:`DerivedStream` between : Sequence[dict, :class:`Stream`, :class:`EventStream`, :class:`MergedStream`, :class:`DerivedStream`] @@ -22148,7 +22193,7 @@ def __init__( class EventStream(Stream): - """EventStream schema wrapper""" + """EventStream schema wrapper.""" _schema = {"$ref": "#/definitions/EventStream"} @@ -22157,11 +22202,11 @@ def __init__(self, *args, **kwds): class MergedStream(Stream): - """MergedStream schema wrapper + """ + MergedStream schema wrapper. Parameters ---------- - merge : Sequence[dict, :class:`Stream`, :class:`EventStream`, :class:`MergedStream`, :class:`DerivedStream`] between : Sequence[dict, :class:`Stream`, :class:`EventStream`, :class:`MergedStream`, :class:`DerivedStream`] @@ -22208,11 +22253,11 @@ def __init__( class StringFieldDef(VegaLiteSchema): - """StringFieldDef schema wrapper + r""" + StringFieldDef schema wrapper. Parameters ---------- - aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -22427,11 +22472,11 @@ def __init__( class StringFieldDefWithCondition(VegaLiteSchema): - """StringFieldDefWithCondition schema wrapper + r""" + StringFieldDefWithCondition schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -22661,11 +22706,11 @@ def __init__( class StringValueDefWithCondition(VegaLiteSchema): - """StringValueDefWithCondition schema wrapper + """ + StringValueDefWithCondition schema wrapper. Parameters ---------- - condition : dict, :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalValueDefstringnullExprRef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, :class:`ConditionalParameterValueDefstringnullExprRef`, :class:`ConditionalPredicateValueDefstringnullExprRef`, Sequence[dict, :class:`ConditionalValueDefstringnullExprRef`, :class:`ConditionalParameterValueDefstringnullExprRef`, :class:`ConditionalPredicateValueDefstringnullExprRef`] A field definition or one or more value definition(s) with a parameter predicate. value : str, dict, None, :class:`ExprRef` @@ -22688,7 +22733,7 @@ def __init__( class StrokeCap(VegaLiteSchema): - """StrokeCap schema wrapper""" + """StrokeCap schema wrapper.""" _schema = {"$ref": "#/definitions/StrokeCap"} @@ -22697,7 +22742,7 @@ def __init__(self, *args): class StrokeJoin(VegaLiteSchema): - """StrokeJoin schema wrapper""" + """StrokeJoin schema wrapper.""" _schema = {"$ref": "#/definitions/StrokeJoin"} @@ -22706,11 +22751,11 @@ def __init__(self, *args): class StyleConfigIndex(VegaLiteSchema): - """StyleConfigIndex schema wrapper + """ + StyleConfigIndex schema wrapper. Parameters ---------- - arc : dict, :class:`RectConfig` Arc-specific Config area : dict, :class:`AreaConfig` @@ -22793,7 +22838,7 @@ def __init__( class SymbolShape(VegaLiteSchema): - """SymbolShape schema wrapper""" + """SymbolShape schema wrapper.""" _schema = {"$ref": "#/definitions/SymbolShape"} @@ -22802,7 +22847,7 @@ def __init__(self, *args): class Text(VegaLiteSchema): - """Text schema wrapper""" + """Text schema wrapper.""" _schema = {"$ref": "#/definitions/Text"} @@ -22811,7 +22856,7 @@ def __init__(self, *args, **kwds): class TextBaseline(VegaLiteSchema): - """TextBaseline schema wrapper""" + """TextBaseline schema wrapper.""" _schema = {"$ref": "#/definitions/TextBaseline"} @@ -22820,7 +22865,7 @@ def __init__(self, *args, **kwds): class Baseline(TextBaseline): - """Baseline schema wrapper""" + """Baseline schema wrapper.""" _schema = {"$ref": "#/definitions/Baseline"} @@ -22829,7 +22874,7 @@ def __init__(self, *args): class TextDef(VegaLiteSchema): - """TextDef schema wrapper""" + """TextDef schema wrapper.""" _schema = {"$ref": "#/definitions/TextDef"} @@ -22838,11 +22883,11 @@ def __init__(self, *args, **kwds): class FieldOrDatumDefWithConditionStringDatumDefText(TextDef): - """FieldOrDatumDefWithConditionStringDatumDefText schema wrapper + """ + FieldOrDatumDefWithConditionStringDatumDefText schema wrapper. Parameters ---------- - bandPosition : float Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, @@ -23013,11 +23058,11 @@ def __init__( class FieldOrDatumDefWithConditionStringFieldDefText(TextDef): - """FieldOrDatumDefWithConditionStringFieldDefText schema wrapper + r""" + FieldOrDatumDefWithConditionStringFieldDefText schema wrapper. Parameters ---------- - shorthand : str, dict, Sequence[str], :class:`RepeatRef` shorthand for field, aggregate, and type aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] @@ -23249,7 +23294,7 @@ def __init__( class TextDirection(VegaLiteSchema): - """TextDirection schema wrapper""" + """TextDirection schema wrapper.""" _schema = {"$ref": "#/definitions/TextDirection"} @@ -23258,11 +23303,11 @@ def __init__(self, *args): class TickConfig(AnyMarkConfig): - """TickConfig schema wrapper + """ + TickConfig schema wrapper. Parameters ---------- - align : dict, :class:`Align`, :class:`ExprRef`, Literal['left', 'center', 'right'] The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of ``"left"``, ``"right"``, ``"center"``. @@ -23825,7 +23870,7 @@ def __init__( class TickCount(VegaLiteSchema): - """TickCount schema wrapper""" + """TickCount schema wrapper.""" _schema = {"$ref": "#/definitions/TickCount"} @@ -23834,7 +23879,7 @@ def __init__(self, *args, **kwds): class TimeInterval(TickCount): - """TimeInterval schema wrapper""" + """TimeInterval schema wrapper.""" _schema = {"$ref": "#/definitions/TimeInterval"} @@ -23843,11 +23888,11 @@ def __init__(self, *args): class TimeIntervalStep(TickCount): - """TimeIntervalStep schema wrapper + """ + TimeIntervalStep schema wrapper. Parameters ---------- - interval : :class:`TimeInterval`, Literal['millisecond', 'second', 'minute', 'hour', 'day', 'week', 'month', 'year'] step : float @@ -23866,12 +23911,13 @@ def __init__( class TimeLocale(VegaLiteSchema): - """TimeLocale schema wrapper + """ + TimeLocale schema wrapper. + Locale definition for formatting dates and times. Parameters ---------- - date : str The date (%x) format specifier (e.g., "%m/%d/%Y"). dateTime : str @@ -23918,7 +23964,7 @@ def __init__( class TimeUnit(VegaLiteSchema): - """TimeUnit schema wrapper""" + """TimeUnit schema wrapper.""" _schema = {"$ref": "#/definitions/TimeUnit"} @@ -23927,7 +23973,7 @@ def __init__(self, *args, **kwds): class MultiTimeUnit(TimeUnit): - """MultiTimeUnit schema wrapper""" + """MultiTimeUnit schema wrapper.""" _schema = {"$ref": "#/definitions/MultiTimeUnit"} @@ -23936,7 +23982,7 @@ def __init__(self, *args, **kwds): class LocalMultiTimeUnit(MultiTimeUnit): - """LocalMultiTimeUnit schema wrapper""" + """LocalMultiTimeUnit schema wrapper.""" _schema = {"$ref": "#/definitions/LocalMultiTimeUnit"} @@ -23945,7 +23991,7 @@ def __init__(self, *args): class SingleTimeUnit(TimeUnit): - """SingleTimeUnit schema wrapper""" + """SingleTimeUnit schema wrapper.""" _schema = {"$ref": "#/definitions/SingleTimeUnit"} @@ -23954,7 +24000,7 @@ def __init__(self, *args, **kwds): class LocalSingleTimeUnit(SingleTimeUnit): - """LocalSingleTimeUnit schema wrapper""" + """LocalSingleTimeUnit schema wrapper.""" _schema = {"$ref": "#/definitions/LocalSingleTimeUnit"} @@ -23963,13 +24009,14 @@ def __init__(self, *args): class TimeUnitParams(VegaLiteSchema): - """TimeUnitParams schema wrapper + """ + TimeUnitParams schema wrapper. + Time Unit Params for encoding predicate, which can specified if the data is already "binned". Parameters ---------- - binned : bool Whether the data has already been binned to this time unit. If true, Vega-Lite will only format the data, marks, and guides, without applying the timeUnit transform to @@ -24001,11 +24048,11 @@ def __init__( class TimeUnitTransformParams(VegaLiteSchema): - """TimeUnitTransformParams schema wrapper + """ + TimeUnitTransformParams schema wrapper. Parameters ---------- - maxbins : float If no ``unit`` is specified, maxbins is used to infer time units. step : float @@ -24030,7 +24077,7 @@ def __init__( class TitleAnchor(VegaLiteSchema): - """TitleAnchor schema wrapper""" + """TitleAnchor schema wrapper.""" _schema = {"$ref": "#/definitions/TitleAnchor"} @@ -24039,11 +24086,11 @@ def __init__(self, *args): class TitleConfig(VegaLiteSchema): - """TitleConfig schema wrapper + """ + TitleConfig schema wrapper. Parameters ---------- - align : :class:`Align`, Literal['left', 'center', 'right'] Horizontal text alignment for title text. One of ``"left"``, ``"center"``, or ``"right"``. @@ -24187,7 +24234,7 @@ def __init__( class TitleFrame(VegaLiteSchema): - """TitleFrame schema wrapper""" + """TitleFrame schema wrapper.""" _schema = {"$ref": "#/definitions/TitleFrame"} @@ -24196,7 +24243,7 @@ def __init__(self, *args): class TitleOrient(VegaLiteSchema): - """TitleOrient schema wrapper""" + """TitleOrient schema wrapper.""" _schema = {"$ref": "#/definitions/TitleOrient"} @@ -24205,11 +24252,11 @@ def __init__(self, *args): class TitleParams(VegaLiteSchema): - """TitleParams schema wrapper + """ + TitleParams schema wrapper. Parameters ---------- - text : str, dict, :class:`Text`, Sequence[str], :class:`ExprRef` The title text. align : :class:`Align`, Literal['left', 'center', 'right'] @@ -24379,11 +24426,11 @@ def __init__( class TooltipContent(VegaLiteSchema): - """TooltipContent schema wrapper + """ + TooltipContent schema wrapper. Parameters ---------- - content : Literal['encoding', 'data'] """ @@ -24397,7 +24444,7 @@ def __init__( class TopLevelParameter(VegaLiteSchema): - """TopLevelParameter schema wrapper""" + """TopLevelParameter schema wrapper.""" _schema = {"$ref": "#/definitions/TopLevelParameter"} @@ -24406,11 +24453,11 @@ def __init__(self, *args, **kwds): class TopLevelSelectionParameter(TopLevelParameter): - """TopLevelSelectionParameter schema wrapper + """ + TopLevelSelectionParameter schema wrapper. Parameters ---------- - name : str, :class:`ParameterName` Required. A unique name for the selection parameter. Selection names should be valid JavaScript identifiers: they should contain only alphanumeric characters (or "$", or @@ -24472,7 +24519,9 @@ def __init__( class TopLevelSpec(VegaLiteSchema): - """TopLevelSpec schema wrapper + """ + TopLevelSpec schema wrapper. + A Vega-Lite top-level specification. This is the root class for all Vega-Lite specifications. (The json schema is generated from this type.) """ @@ -24484,11 +24533,11 @@ def __init__(self, *args, **kwds): class TopLevelConcatSpec(TopLevelSpec): - """TopLevelConcatSpec schema wrapper + """ + TopLevelConcatSpec schema wrapper. Parameters ---------- - concat : Sequence[dict, :class:`FacetSpec`, :class:`LayerSpec`, :class:`RepeatSpec`, :class:`FacetedUnitSpec`, :class:`LayerRepeatSpec`, :class:`NonNormalizedSpec`, :class:`NonLayerRepeatSpec`, :class:`ConcatSpecGenericSpec`, :class:`HConcatSpecGenericSpec`, :class:`VConcatSpecGenericSpec`] A list of views to be concatenated. align : dict, :class:`LayoutAlign`, :class:`RowColLayoutAlign`, Literal['all', 'each', 'none'] @@ -24656,11 +24705,11 @@ def __init__( class TopLevelFacetSpec(TopLevelSpec): - """TopLevelFacetSpec schema wrapper + """ + TopLevelFacetSpec schema wrapper. Parameters ---------- - data : dict, None, :class:`Data`, :class:`UrlData`, :class:`Generator`, :class:`NamedData`, :class:`DataSource`, :class:`InlineData`, :class:`SphereGenerator`, :class:`SequenceGenerator`, :class:`GraticuleGenerator` An object describing the data source. Set to ``null`` to ignore the parent's data source. If no data is set, it is derived from the parent. @@ -24836,11 +24885,11 @@ def __init__( class TopLevelHConcatSpec(TopLevelSpec): - """TopLevelHConcatSpec schema wrapper + """ + TopLevelHConcatSpec schema wrapper. Parameters ---------- - hconcat : Sequence[dict, :class:`FacetSpec`, :class:`LayerSpec`, :class:`RepeatSpec`, :class:`FacetedUnitSpec`, :class:`LayerRepeatSpec`, :class:`NonNormalizedSpec`, :class:`NonLayerRepeatSpec`, :class:`ConcatSpecGenericSpec`, :class:`HConcatSpecGenericSpec`, :class:`VConcatSpecGenericSpec`] A list of views to be concatenated and put into a row. autosize : dict, :class:`AutosizeType`, :class:`AutoSizeParams`, Literal['pad', 'none', 'fit', 'fit-x', 'fit-y'] @@ -24962,11 +25011,11 @@ def __init__( class TopLevelLayerSpec(TopLevelSpec): - """TopLevelLayerSpec schema wrapper + """ + TopLevelLayerSpec schema wrapper. Parameters ---------- - layer : Sequence[dict, :class:`UnitSpec`, :class:`LayerSpec`] Layer or single view specifications to be layered. @@ -25126,7 +25175,7 @@ def __init__( class TopLevelRepeatSpec(TopLevelSpec): - """TopLevelRepeatSpec schema wrapper""" + """TopLevelRepeatSpec schema wrapper.""" _schema = {"$ref": "#/definitions/TopLevelRepeatSpec"} @@ -25135,11 +25184,11 @@ def __init__(self, *args, **kwds): class TopLevelUnitSpec(TopLevelSpec): - """TopLevelUnitSpec schema wrapper + """ + TopLevelUnitSpec schema wrapper. Parameters ---------- - data : dict, None, :class:`Data`, :class:`UrlData`, :class:`Generator`, :class:`NamedData`, :class:`DataSource`, :class:`InlineData`, :class:`SphereGenerator`, :class:`SequenceGenerator`, :class:`GraticuleGenerator` An object describing the data source. Set to ``null`` to ignore the parent's data source. If no data is set, it is derived from the parent. @@ -25351,11 +25400,11 @@ def __init__( class TopLevelVConcatSpec(TopLevelSpec): - """TopLevelVConcatSpec schema wrapper + """ + TopLevelVConcatSpec schema wrapper. Parameters ---------- - vconcat : Sequence[dict, :class:`FacetSpec`, :class:`LayerSpec`, :class:`RepeatSpec`, :class:`FacetedUnitSpec`, :class:`LayerRepeatSpec`, :class:`NonNormalizedSpec`, :class:`NonLayerRepeatSpec`, :class:`ConcatSpecGenericSpec`, :class:`HConcatSpecGenericSpec`, :class:`VConcatSpecGenericSpec`] A list of views to be concatenated and put into a column. autosize : dict, :class:`AutosizeType`, :class:`AutoSizeParams`, Literal['pad', 'none', 'fit', 'fit-x', 'fit-y'] @@ -25477,11 +25526,11 @@ def __init__( class TopoDataFormat(DataFormat): - """TopoDataFormat schema wrapper + """ + TopoDataFormat schema wrapper. Parameters ---------- - feature : str The name of the TopoJSON object set to convert to a GeoJSON feature collection. For example, in a map of the world, there may be an object set named ``"countries"``. @@ -25531,7 +25580,7 @@ def __init__( class Transform(VegaLiteSchema): - """Transform schema wrapper""" + """Transform schema wrapper.""" _schema = {"$ref": "#/definitions/Transform"} @@ -25540,11 +25589,11 @@ def __init__(self, *args, **kwds): class AggregateTransform(Transform): - """AggregateTransform schema wrapper + """ + AggregateTransform schema wrapper. Parameters ---------- - aggregate : Sequence[dict, :class:`AggregatedFieldDef`] Array of objects that define fields to aggregate. groupby : Sequence[str, :class:`FieldName`] @@ -25564,11 +25613,11 @@ def __init__( class BinTransform(Transform): - """BinTransform schema wrapper + """ + BinTransform schema wrapper. Parameters ---------- - bin : bool, dict, :class:`BinParams` An object indicating bin properties, or simply ``true`` for using default bin parameters. @@ -25593,11 +25642,11 @@ def __init__( class CalculateTransform(Transform): - """CalculateTransform schema wrapper + """ + CalculateTransform schema wrapper. Parameters ---------- - calculate : str A `expression `__ string. Use the variable ``datum`` to refer to the current data object. @@ -25612,11 +25661,11 @@ def __init__(self, calculate: Optional[str] = Undefined, **kwds): class DensityTransform(Transform): - """DensityTransform schema wrapper + """ + DensityTransform schema wrapper. Parameters ---------- - density : str, :class:`FieldName` The data field for which to perform density estimation. bandwidth : float @@ -25700,11 +25749,11 @@ def __init__( class ExtentTransform(Transform): - """ExtentTransform schema wrapper + """ + ExtentTransform schema wrapper. Parameters ---------- - extent : str, :class:`FieldName` The field of which to get the extent. param : str, :class:`ParameterName` @@ -25723,11 +25772,11 @@ def __init__( class FilterTransform(Transform): - """FilterTransform schema wrapper + """ + FilterTransform schema wrapper. Parameters ---------- - filter : str, dict, :class:`Predicate`, :class:`FieldGTPredicate`, :class:`FieldLTPredicate`, :class:`FieldGTEPredicate`, :class:`FieldLTEPredicate`, :class:`LogicalOrPredicate`, :class:`ParameterPredicate`, :class:`FieldEqualPredicate`, :class:`FieldOneOfPredicate`, :class:`FieldRangePredicate`, :class:`FieldValidPredicate`, :class:`LogicalAndPredicate`, :class:`LogicalNotPredicate`, :class:`PredicateComposition` The ``filter`` property must be a predication definition, which can take one of the following forms: @@ -25765,11 +25814,11 @@ def __init__(self, filter: Optional[str | dict | SchemaBase] = Undefined, **kwds class FlattenTransform(Transform): - """FlattenTransform schema wrapper + """ + FlattenTransform schema wrapper. Parameters ---------- - flatten : Sequence[str, :class:`FieldName`] An array of one or more data fields containing arrays to flatten. If multiple fields are specified, their array values should have a parallel structure, ideally with the @@ -25790,11 +25839,11 @@ def __init__( class FoldTransform(Transform): - """FoldTransform schema wrapper + """ + FoldTransform schema wrapper. Parameters ---------- - fold : Sequence[str, :class:`FieldName`] An array of data fields indicating the properties to fold. as : Sequence[str, :class:`FieldName`] @@ -25809,11 +25858,11 @@ def __init__(self, fold: Optional[Sequence[str | SchemaBase]] = Undefined, **kwd class ImputeTransform(Transform): - """ImputeTransform schema wrapper + """ + ImputeTransform schema wrapper. Parameters ---------- - impute : str, :class:`FieldName` The data field for which the missing values should be imputed. key : str, :class:`FieldName` @@ -25878,11 +25927,11 @@ def __init__( class JoinAggregateTransform(Transform): - """JoinAggregateTransform schema wrapper + """ + JoinAggregateTransform schema wrapper. Parameters ---------- - joinaggregate : Sequence[dict, :class:`JoinAggregateFieldDef`] The definition of the fields in the join aggregate, and what calculations to use. groupby : Sequence[str, :class:`FieldName`] @@ -25902,11 +25951,11 @@ def __init__( class LoessTransform(Transform): - """LoessTransform schema wrapper + """ + LoessTransform schema wrapper. Parameters ---------- - loess : str, :class:`FieldName` The data field of the dependent variable to smooth. on : str, :class:`FieldName` @@ -25941,11 +25990,11 @@ def __init__( class LookupTransform(Transform): - """LookupTransform schema wrapper + """ + LookupTransform schema wrapper. Parameters ---------- - lookup : str Key in primary data source. default : Any @@ -25978,11 +26027,11 @@ def __init__( class PivotTransform(Transform): - """PivotTransform schema wrapper + """ + PivotTransform schema wrapper. Parameters ---------- - pivot : str, :class:`FieldName` The data field to pivot on. The unique values of this field become new field names in the output stream. @@ -26018,11 +26067,11 @@ def __init__( class QuantileTransform(Transform): - """QuantileTransform schema wrapper + """ + QuantileTransform schema wrapper. Parameters ---------- - quantile : str, :class:`FieldName` The data field for which to perform quantile estimation. groupby : Sequence[str, :class:`FieldName`] @@ -26057,11 +26106,11 @@ def __init__( class RegressionTransform(Transform): - """RegressionTransform schema wrapper + """ + RegressionTransform schema wrapper. Parameters ---------- - on : str, :class:`FieldName` The data field of the independent variable to use a predictor. regression : str, :class:`FieldName` @@ -26124,11 +26173,11 @@ def __init__( class SampleTransform(Transform): - """SampleTransform schema wrapper + """ + SampleTransform schema wrapper. Parameters ---------- - sample : float The maximum number of data objects to include in the sample. @@ -26142,11 +26191,11 @@ def __init__(self, sample: Optional[float] = Undefined, **kwds): class StackTransform(Transform): - """StackTransform schema wrapper + """ + StackTransform schema wrapper. Parameters ---------- - groupby : Sequence[str, :class:`FieldName`] The data fields to group by. stack : str, :class:`FieldName` @@ -26181,11 +26230,11 @@ def __init__( class TimeUnitTransform(Transform): - """TimeUnitTransform schema wrapper + """ + TimeUnitTransform schema wrapper. Parameters ---------- - field : str, :class:`FieldName` The data field to apply time unit. timeUnit : dict, :class:`TimeUnit`, :class:`MultiTimeUnit`, :class:`SingleTimeUnit`, :class:`UtcMultiTimeUnit`, :class:`UtcSingleTimeUnit`, :class:`LocalMultiTimeUnit`, :class:`LocalSingleTimeUnit`, :class:`TimeUnitTransformParams`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weekdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweekdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'] @@ -26208,7 +26257,9 @@ def __init__( class Type(VegaLiteSchema): - """Type schema wrapper + """ + Type schema wrapper. + Data type based on level of measurement """ @@ -26219,7 +26270,7 @@ def __init__(self, *args): class TypeForShape(VegaLiteSchema): - """TypeForShape schema wrapper""" + """TypeForShape schema wrapper.""" _schema = {"$ref": "#/definitions/TypeForShape"} @@ -26228,12 +26279,13 @@ def __init__(self, *args): class TypedFieldDef(VegaLiteSchema): - """TypedFieldDef schema wrapper + r""" + TypedFieldDef schema wrapper. + Definition object for a data field, its type and transformation of an encoding channel. Parameters ---------- - aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -26410,7 +26462,7 @@ def __init__( class URI(VegaLiteSchema): - """URI schema wrapper""" + """URI schema wrapper.""" _schema = {"$ref": "#/definitions/URI"} @@ -26419,12 +26471,13 @@ def __init__(self, *args): class UnitSpec(VegaLiteSchema): - """UnitSpec schema wrapper + """ + UnitSpec schema wrapper. + Base interface for a unit (single-view) specification. Parameters ---------- - mark : str, dict, :class:`Mark`, :class:`AnyMark`, :class:`BoxPlot`, :class:`MarkDef`, :class:`ErrorBar`, :class:`ErrorBand`, :class:`BoxPlotDef`, :class:`ErrorBarDef`, :class:`ErrorBandDef`, :class:`CompositeMark`, :class:`CompositeMarkDef`, Literal['arc', 'area', 'bar', 'image', 'line', 'point', 'rect', 'rule', 'text', 'tick', 'trail', 'circle', 'square', 'geoshape'] A string describing the mark type (one of ``"bar"``, ``"circle"``, ``"square"``, ``"tick"``, ``"line"``, ``"area"``, ``"point"``, ``"rule"``, ``"geoshape"``, and @@ -26482,11 +26535,11 @@ def __init__( class UnitSpecWithFrame(VegaLiteSchema): - """UnitSpecWithFrame schema wrapper + """ + UnitSpecWithFrame schema wrapper. Parameters ---------- - mark : str, dict, :class:`Mark`, :class:`AnyMark`, :class:`BoxPlot`, :class:`MarkDef`, :class:`ErrorBar`, :class:`ErrorBand`, :class:`BoxPlotDef`, :class:`ErrorBarDef`, :class:`ErrorBandDef`, :class:`CompositeMark`, :class:`CompositeMarkDef`, Literal['arc', 'area', 'bar', 'image', 'line', 'point', 'rect', 'rule', 'text', 'tick', 'trail', 'circle', 'square', 'geoshape'] A string describing the mark type (one of ``"bar"``, ``"circle"``, ``"square"``, ``"tick"``, ``"line"``, ``"area"``, ``"point"``, ``"rule"``, ``"geoshape"``, and @@ -26594,11 +26647,11 @@ def __init__( class UrlData(DataSource): - """UrlData schema wrapper + """ + UrlData schema wrapper. Parameters ---------- - url : str An URL from which to load the data set. Use the ``format.type`` property to ensure the loaded data is correctly parsed. @@ -26621,7 +26674,7 @@ def __init__( class UtcMultiTimeUnit(MultiTimeUnit): - """UtcMultiTimeUnit schema wrapper""" + """UtcMultiTimeUnit schema wrapper.""" _schema = {"$ref": "#/definitions/UtcMultiTimeUnit"} @@ -26630,7 +26683,7 @@ def __init__(self, *args): class UtcSingleTimeUnit(SingleTimeUnit): - """UtcSingleTimeUnit schema wrapper""" + """UtcSingleTimeUnit schema wrapper.""" _schema = {"$ref": "#/definitions/UtcSingleTimeUnit"} @@ -26639,12 +26692,13 @@ def __init__(self, *args): class VConcatSpecGenericSpec(Spec, NonNormalizedSpec): - """VConcatSpecGenericSpec schema wrapper + """ + VConcatSpecGenericSpec schema wrapper. + Base interface for a vertical concatenation specification. Parameters ---------- - vconcat : Sequence[dict, :class:`Spec`, :class:`FacetSpec`, :class:`LayerSpec`, :class:`RepeatSpec`, :class:`FacetedUnitSpec`, :class:`LayerRepeatSpec`, :class:`NonLayerRepeatSpec`, :class:`ConcatSpecGenericSpec`, :class:`HConcatSpecGenericSpec`, :class:`VConcatSpecGenericSpec`] A list of views to be concatenated and put into a column. bounds : Literal['full', 'flush'] @@ -26717,11 +26771,11 @@ def __init__( class ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull( ColorDef, MarkPropDefGradientstringnull ): - """ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull schema wrapper + """ + ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull schema wrapper. Parameters ---------- - condition : dict, :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, :class:`ConditionalValueDefGradientstringnullExprRef`, :class:`ConditionalParameterValueDefGradientstringnullExprRef`, :class:`ConditionalPredicateValueDefGradientstringnullExprRef`, Sequence[dict, :class:`ConditionalValueDefGradientstringnullExprRef`, :class:`ConditionalParameterValueDefGradientstringnullExprRef`, :class:`ConditionalPredicateValueDefGradientstringnullExprRef`] A field definition or one or more value definition(s) with a parameter predicate. value : str, dict, None, :class:`ExprRef`, :class:`Gradient`, :class:`LinearGradient`, :class:`RadialGradient` @@ -26748,11 +26802,11 @@ def __init__( class ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull( MarkPropDefstringnullTypeForShape, ShapeDef ): - """ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull schema wrapper + """ + ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull schema wrapper. Parameters ---------- - condition : dict, :class:`ConditionalValueDefstringnullExprRef`, :class:`ConditionalParameterValueDefstringnullExprRef`, :class:`ConditionalPredicateValueDefstringnullExprRef`, :class:`ConditionalMarkPropFieldOrDatumDefTypeForShape`, :class:`ConditionalParameterMarkPropFieldOrDatumDefTypeForShape`, :class:`ConditionalPredicateMarkPropFieldOrDatumDefTypeForShape`, Sequence[dict, :class:`ConditionalValueDefstringnullExprRef`, :class:`ConditionalParameterValueDefstringnullExprRef`, :class:`ConditionalPredicateValueDefstringnullExprRef`] A field definition or one or more value definition(s) with a parameter predicate. value : str, dict, None, :class:`ExprRef` @@ -26779,11 +26833,11 @@ def __init__( class ValueDefWithConditionMarkPropFieldOrDatumDefnumber( MarkPropDefnumber, NumericMarkPropDef ): - """ValueDefWithConditionMarkPropFieldOrDatumDefnumber schema wrapper + """ + ValueDefWithConditionMarkPropFieldOrDatumDefnumber schema wrapper. Parameters ---------- - condition : dict, :class:`ConditionalValueDefnumberExprRef`, :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalParameterValueDefnumberExprRef`, :class:`ConditionalPredicateValueDefnumberExprRef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, Sequence[dict, :class:`ConditionalValueDefnumberExprRef`, :class:`ConditionalParameterValueDefnumberExprRef`, :class:`ConditionalPredicateValueDefnumberExprRef`] A field definition or one or more value definition(s) with a parameter predicate. value : dict, float, :class:`ExprRef` @@ -26810,11 +26864,11 @@ def __init__( class ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray( MarkPropDefnumberArray, NumericArrayMarkPropDef ): - """ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray schema wrapper + """ + ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray schema wrapper. Parameters ---------- - condition : dict, :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalValueDefnumberArrayExprRef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, :class:`ConditionalParameterValueDefnumberArrayExprRef`, :class:`ConditionalPredicateValueDefnumberArrayExprRef`, Sequence[dict, :class:`ConditionalValueDefnumberArrayExprRef`, :class:`ConditionalParameterValueDefnumberArrayExprRef`, :class:`ConditionalPredicateValueDefnumberArrayExprRef`] A field definition or one or more value definition(s) with a parameter predicate. value : dict, Sequence[float], :class:`ExprRef` @@ -26839,11 +26893,11 @@ def __init__( class ValueDefWithConditionMarkPropFieldOrDatumDefstringnull(VegaLiteSchema): - """ValueDefWithConditionMarkPropFieldOrDatumDefstringnull schema wrapper + """ + ValueDefWithConditionMarkPropFieldOrDatumDefstringnull schema wrapper. Parameters ---------- - condition : dict, :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalValueDefstringnullExprRef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, :class:`ConditionalParameterValueDefstringnullExprRef`, :class:`ConditionalPredicateValueDefstringnullExprRef`, Sequence[dict, :class:`ConditionalValueDefstringnullExprRef`, :class:`ConditionalParameterValueDefstringnullExprRef`, :class:`ConditionalPredicateValueDefstringnullExprRef`] A field definition or one or more value definition(s) with a parameter predicate. value : str, dict, None, :class:`ExprRef` @@ -26868,11 +26922,11 @@ def __init__( class ValueDefWithConditionStringFieldDefText(TextDef): - """ValueDefWithConditionStringFieldDefText schema wrapper + """ + ValueDefWithConditionStringFieldDefText schema wrapper. Parameters ---------- - condition : dict, :class:`ConditionalStringFieldDef`, :class:`ConditionalValueDefTextExprRef`, :class:`ConditionalParameterStringFieldDef`, :class:`ConditionalPredicateStringFieldDef`, :class:`ConditionalParameterValueDefTextExprRef`, :class:`ConditionalPredicateValueDefTextExprRef`, Sequence[dict, :class:`ConditionalValueDefTextExprRef`, :class:`ConditionalParameterValueDefTextExprRef`, :class:`ConditionalPredicateValueDefTextExprRef`] A field definition or one or more value definition(s) with a parameter predicate. value : str, dict, :class:`Text`, Sequence[str], :class:`ExprRef` @@ -26897,13 +26951,14 @@ def __init__( class ValueDefnumber(OffsetDef): - """ValueDefnumber schema wrapper + """ + ValueDefnumber schema wrapper. + Definition object for a constant value (primitive value or gradient definition) of an encoding channel. Parameters ---------- - value : float A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition `__ for color, @@ -26917,13 +26972,14 @@ def __init__(self, value: Optional[float] = Undefined, **kwds): class ValueDefnumberwidthheightExprRef(VegaLiteSchema): - """ValueDefnumberwidthheightExprRef schema wrapper + """ + ValueDefnumberwidthheightExprRef schema wrapper. + Definition object for a constant value (primitive value or gradient definition) of an encoding channel. Parameters ---------- - value : str, dict, float, :class:`ExprRef` A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition `__ for color, @@ -26941,11 +26997,11 @@ def __init__( class VariableParameter(TopLevelParameter): - """VariableParameter schema wrapper + """ + VariableParameter schema wrapper. Parameters ---------- - name : str, :class:`ParameterName` A unique name for the variable parameter. Parameter names should be valid JavaScript identifiers: they should contain only alphanumeric characters (or "$", or "_") and @@ -26979,7 +27035,7 @@ def __init__( class Vector10string(VegaLiteSchema): - """Vector10string schema wrapper""" + """Vector10string schema wrapper.""" _schema = {"$ref": "#/definitions/Vector10"} @@ -26988,7 +27044,7 @@ def __init__(self, *args): class Vector12string(VegaLiteSchema): - """Vector12string schema wrapper""" + """Vector12string schema wrapper.""" _schema = {"$ref": "#/definitions/Vector12"} @@ -26997,7 +27053,7 @@ def __init__(self, *args): class Vector2DateTime(SelectionInitInterval): - """Vector2DateTime schema wrapper""" + """Vector2DateTime schema wrapper.""" _schema = {"$ref": "#/definitions/Vector2"} @@ -27006,7 +27062,7 @@ def __init__(self, *args): class Vector2Vector2number(VegaLiteSchema): - """Vector2Vector2number schema wrapper""" + """Vector2Vector2number schema wrapper.""" _schema = {"$ref": "#/definitions/Vector2>"} @@ -27015,7 +27071,7 @@ def __init__(self, *args): class Vector2boolean(SelectionInitInterval): - """Vector2boolean schema wrapper""" + """Vector2boolean schema wrapper.""" _schema = {"$ref": "#/definitions/Vector2"} @@ -27024,7 +27080,7 @@ def __init__(self, *args): class Vector2number(SelectionInitInterval): - """Vector2number schema wrapper""" + """Vector2number schema wrapper.""" _schema = {"$ref": "#/definitions/Vector2"} @@ -27033,7 +27089,7 @@ def __init__(self, *args): class Vector2string(SelectionInitInterval): - """Vector2string schema wrapper""" + """Vector2string schema wrapper.""" _schema = {"$ref": "#/definitions/Vector2"} @@ -27042,7 +27098,7 @@ def __init__(self, *args): class Vector3number(VegaLiteSchema): - """Vector3number schema wrapper""" + """Vector3number schema wrapper.""" _schema = {"$ref": "#/definitions/Vector3"} @@ -27051,7 +27107,7 @@ def __init__(self, *args): class Vector7string(VegaLiteSchema): - """Vector7string schema wrapper""" + """Vector7string schema wrapper.""" _schema = {"$ref": "#/definitions/Vector7"} @@ -27060,11 +27116,11 @@ def __init__(self, *args): class ViewBackground(VegaLiteSchema): - """ViewBackground schema wrapper + """ + ViewBackground schema wrapper. Parameters ---------- - cornerRadius : dict, float, :class:`ExprRef` The radius in pixels of rounded rectangles or arcs' corners. @@ -27167,11 +27223,11 @@ def __init__( class ViewConfig(VegaLiteSchema): - """ViewConfig schema wrapper + """ + ViewConfig schema wrapper. Parameters ---------- - clip : bool Whether the view should be clipped. continuousHeight : float @@ -27301,7 +27357,7 @@ def __init__( class WindowEventType(VegaLiteSchema): - """WindowEventType schema wrapper""" + """WindowEventType schema wrapper.""" _schema = {"$ref": "#/definitions/WindowEventType"} @@ -27310,7 +27366,7 @@ def __init__(self, *args, **kwds): class EventType(WindowEventType): - """EventType schema wrapper""" + """EventType schema wrapper.""" _schema = {"$ref": "#/definitions/EventType"} @@ -27319,11 +27375,11 @@ def __init__(self, *args): class WindowFieldDef(VegaLiteSchema): - """WindowFieldDef schema wrapper + """ + WindowFieldDef schema wrapper. Parameters ---------- - op : :class:`AggregateOp`, :class:`WindowOnlyOp`, Literal['row_number', 'rank', 'dense_rank', 'percent_rank', 'cume_dist', 'ntile', 'lag', 'lead', 'first_value', 'last_value', 'nth_value'], Literal['argmax', 'argmin', 'average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] The window or aggregation operation to apply within a window (e.g., ``"rank"``, ``"lead"``, ``"sum"``, ``"average"`` or ``"count"`` ). See the list of all supported @@ -27355,7 +27411,7 @@ def __init__( class WindowOnlyOp(VegaLiteSchema): - """WindowOnlyOp schema wrapper""" + """WindowOnlyOp schema wrapper.""" _schema = {"$ref": "#/definitions/WindowOnlyOp"} @@ -27364,11 +27420,11 @@ def __init__(self, *args): class WindowTransform(Transform): - """WindowTransform schema wrapper + """ + WindowTransform schema wrapper. Parameters ---------- - window : Sequence[dict, :class:`WindowFieldDef`] The definition of the fields in the window, and what calculations to use. frame : Sequence[None, float] diff --git a/altair/vegalite/v5/schema/mixins.py b/altair/vegalite/v5/schema/mixins.py index 17e0a1bcd..6e11e590c 100644 --- a/altair/vegalite/v5/schema/mixins.py +++ b/altair/vegalite/v5/schema/mixins.py @@ -29,7 +29,7 @@ class MarkMethodMixin: - """A mixin class that defines mark methods""" + """A mixin class that defines mark methods.""" def mark_arc( self, @@ -141,7 +141,7 @@ def mark_arc( yOffset: Optional[dict | float | Parameter | SchemaBase] = Undefined, **kwds, ) -> Self: - """Set the chart's mark to 'arc' (see :class:`MarkDef`)""" + """Set the chart's mark to 'arc' (see :class:`MarkDef`).""" kwds = dict( align=align, angle=angle, @@ -348,7 +348,7 @@ def mark_area( yOffset: Optional[dict | float | Parameter | SchemaBase] = Undefined, **kwds, ) -> Self: - """Set the chart's mark to 'area' (see :class:`MarkDef`)""" + """Set the chart's mark to 'area' (see :class:`MarkDef`).""" kwds = dict( align=align, angle=angle, @@ -555,7 +555,7 @@ def mark_bar( yOffset: Optional[dict | float | Parameter | SchemaBase] = Undefined, **kwds, ) -> Self: - """Set the chart's mark to 'bar' (see :class:`MarkDef`)""" + """Set the chart's mark to 'bar' (see :class:`MarkDef`).""" kwds = dict( align=align, angle=angle, @@ -762,7 +762,7 @@ def mark_image( yOffset: Optional[dict | float | Parameter | SchemaBase] = Undefined, **kwds, ) -> Self: - """Set the chart's mark to 'image' (see :class:`MarkDef`)""" + """Set the chart's mark to 'image' (see :class:`MarkDef`).""" kwds = dict( align=align, angle=angle, @@ -969,7 +969,7 @@ def mark_line( yOffset: Optional[dict | float | Parameter | SchemaBase] = Undefined, **kwds, ) -> Self: - """Set the chart's mark to 'line' (see :class:`MarkDef`)""" + """Set the chart's mark to 'line' (see :class:`MarkDef`).""" kwds = dict( align=align, angle=angle, @@ -1176,7 +1176,7 @@ def mark_point( yOffset: Optional[dict | float | Parameter | SchemaBase] = Undefined, **kwds, ) -> Self: - """Set the chart's mark to 'point' (see :class:`MarkDef`)""" + """Set the chart's mark to 'point' (see :class:`MarkDef`).""" kwds = dict( align=align, angle=angle, @@ -1383,7 +1383,7 @@ def mark_rect( yOffset: Optional[dict | float | Parameter | SchemaBase] = Undefined, **kwds, ) -> Self: - """Set the chart's mark to 'rect' (see :class:`MarkDef`)""" + """Set the chart's mark to 'rect' (see :class:`MarkDef`).""" kwds = dict( align=align, angle=angle, @@ -1590,7 +1590,7 @@ def mark_rule( yOffset: Optional[dict | float | Parameter | SchemaBase] = Undefined, **kwds, ) -> Self: - """Set the chart's mark to 'rule' (see :class:`MarkDef`)""" + """Set the chart's mark to 'rule' (see :class:`MarkDef`).""" kwds = dict( align=align, angle=angle, @@ -1797,7 +1797,7 @@ def mark_text( yOffset: Optional[dict | float | Parameter | SchemaBase] = Undefined, **kwds, ) -> Self: - """Set the chart's mark to 'text' (see :class:`MarkDef`)""" + """Set the chart's mark to 'text' (see :class:`MarkDef`).""" kwds = dict( align=align, angle=angle, @@ -2004,7 +2004,7 @@ def mark_tick( yOffset: Optional[dict | float | Parameter | SchemaBase] = Undefined, **kwds, ) -> Self: - """Set the chart's mark to 'tick' (see :class:`MarkDef`)""" + """Set the chart's mark to 'tick' (see :class:`MarkDef`).""" kwds = dict( align=align, angle=angle, @@ -2211,7 +2211,7 @@ def mark_trail( yOffset: Optional[dict | float | Parameter | SchemaBase] = Undefined, **kwds, ) -> Self: - """Set the chart's mark to 'trail' (see :class:`MarkDef`)""" + """Set the chart's mark to 'trail' (see :class:`MarkDef`).""" kwds = dict( align=align, angle=angle, @@ -2418,7 +2418,7 @@ def mark_circle( yOffset: Optional[dict | float | Parameter | SchemaBase] = Undefined, **kwds, ) -> Self: - """Set the chart's mark to 'circle' (see :class:`MarkDef`)""" + """Set the chart's mark to 'circle' (see :class:`MarkDef`).""" kwds = dict( align=align, angle=angle, @@ -2625,7 +2625,7 @@ def mark_square( yOffset: Optional[dict | float | Parameter | SchemaBase] = Undefined, **kwds, ) -> Self: - """Set the chart's mark to 'square' (see :class:`MarkDef`)""" + """Set the chart's mark to 'square' (see :class:`MarkDef`).""" kwds = dict( align=align, angle=angle, @@ -2832,7 +2832,7 @@ def mark_geoshape( yOffset: Optional[dict | float | Parameter | SchemaBase] = Undefined, **kwds, ) -> Self: - """Set the chart's mark to 'geoshape' (see :class:`MarkDef`)""" + """Set the chart's mark to 'geoshape' (see :class:`MarkDef`).""" kwds = dict( align=align, angle=angle, @@ -2945,7 +2945,7 @@ def mark_boxplot( ticks: Optional[bool | dict | SchemaBase] = Undefined, **kwds, ) -> Self: - """Set the chart's mark to 'boxplot' (see :class:`BoxPlotDef`)""" + """Set the chart's mark to 'boxplot' (see :class:`BoxPlotDef`).""" kwds = dict( box=box, clip=clip, @@ -2981,7 +2981,7 @@ def mark_errorbar( ticks: Optional[bool | dict | SchemaBase] = Undefined, **kwds, ) -> Self: - """Set the chart's mark to 'errorbar' (see :class:`ErrorBarDef`)""" + """Set the chart's mark to 'errorbar' (see :class:`ErrorBarDef`).""" kwds = dict( clip=clip, color=color, @@ -3014,7 +3014,7 @@ def mark_errorband( tension: Optional[float] = Undefined, **kwds, ) -> Self: - """Set the chart's mark to 'errorband' (see :class:`ErrorBandDef`)""" + """Set the chart's mark to 'errorband' (see :class:`ErrorBandDef`).""" kwds = dict( band=band, borders=borders, @@ -3036,7 +3036,7 @@ def mark_errorband( class ConfigMethodMixin: - """A mixin class that defines config methods""" + """A mixin class that defines config methods.""" @use_signature(core.Config) def configure(self, *args, **kwargs) -> Self: From 93df21a45ea48de792cb96c16720ece44c9db99d Mon Sep 17 00:00:00 2001 From: dangotbanned <125183946+dangotbanned@users.noreply.github.com> Date: Mon, 22 Jul 2024 17:46:43 +0100 Subject: [PATCH 05/11] docs(ruff): Apply autofixes for `pydocstyle` everywhere --- altair/_magics.py | 9 +- altair/expr/core.py | 9 +- altair/jupyter/jupyter_chart.py | 18 +- altair/utils/_dfi_types.py | 11 +- altair/utils/_transformed_data.py | 24 ++- altair/utils/_vegafusion_data.py | 16 +- altair/utils/core.py | 35 ++-- altair/utils/data.py | 13 +- altair/utils/deprecation.py | 6 +- altair/utils/display.py | 14 +- altair/utils/execeval.py | 4 +- altair/utils/html.py | 3 +- altair/utils/mimebundle.py | 15 +- altair/utils/plugin_registry.py | 34 ++-- altair/utils/save.py | 13 +- altair/utils/schemapi.py | 92 ++++++---- altair/utils/server.py | 5 +- altair/utils/theme.py | 2 +- altair/vegalite/v5/api.py | 226 ++++++++++++++++--------- altair/vegalite/v5/compiler.py | 4 +- altair/vegalite/v5/display.py | 7 +- altair/vegalite/v5/theme.py | 2 +- pyproject.toml | 4 +- sphinxext/altairgallery.py | 5 +- sphinxext/schematable.py | 16 +- sphinxext/utils.py | 14 +- tests/expr/test_expr.py | 7 +- tests/test_examples.py | 9 +- tests/utils/test_data.py | 20 ++- tests/utils/test_server.py | 4 +- tests/utils/test_to_values_narwhals.py | 4 +- tests/vegalite/test_common.py | 2 +- tests/vegalite/v5/test_api.py | 12 +- tests/vegalite/v5/test_display.py | 2 +- tests/vegalite/v5/test_params.py | 2 +- tests/vegalite/v5/test_renderers.py | 8 +- tools/generate_schema_wrapper.py | 9 +- tools/schemapi/__init__.py | 4 +- tools/schemapi/codegen.py | 15 +- tools/schemapi/schemapi.py | 92 ++++++---- tools/schemapi/utils.py | 39 +++-- tools/update_init_file.py | 6 +- 42 files changed, 489 insertions(+), 347 deletions(-) diff --git a/altair/_magics.py b/altair/_magics.py index 638400c78..05186367e 100644 --- a/altair/_magics.py +++ b/altair/_magics.py @@ -1,6 +1,4 @@ -""" -Magic functions for rendering vega-lite specifications -""" +"""Magic functions for rendering vega-lite specifications.""" __all__ = ["vegalite"] @@ -36,7 +34,7 @@ def _prepare_data(data, data_transformers): - """Convert input data to data for use within schema""" + """Convert input data to data for use within schema.""" if data is None or isinstance(data, dict): return data elif _is_pandas_dataframe(data): @@ -74,7 +72,8 @@ def _get_variable(name): @magic_arguments.argument("-v", "--version", dest="version", default="v5") @magic_arguments.argument("-j", "--json", dest="json", action="store_true") def vegalite(line, cell): - """Cell magic for displaying vega-lite visualizations in CoLab. + """ + Cell magic for displaying vega-lite visualizations in CoLab. %%vegalite [dataframe] [--json] [--version='v5'] diff --git a/altair/expr/core.py b/altair/expr/core.py index 5815598fe..cfaa9984c 100644 --- a/altair/expr/core.py +++ b/altair/expr/core.py @@ -4,7 +4,7 @@ class DatumType: - """An object to assist in building Vega-Lite Expressions""" + """An object to assist in building Vega-Lite Expressions.""" def __repr__(self) -> str: return "datum" @@ -18,7 +18,7 @@ def __getitem__(self, attr) -> GetItemExpression: return GetItemExpression("datum", attr) def __call__(self, datum, **kwargs) -> dict[str, Any]: - """Specify a datum for use in an encoding""" + """Specify a datum for use in an encoding.""" return dict(datum=datum, **kwargs) @@ -26,7 +26,7 @@ def __call__(self, datum, **kwargs) -> dict[str, Any]: def _js_repr(val) -> str: - """Return a javascript-safe string representation of val""" + """Return a javascript-safe string representation of val.""" if val is True: return "true" elif val is False: @@ -163,7 +163,8 @@ def __invert__(self): class Expression(OperatorMixin, SchemaBase): - """Expression + """ + Expression. Base object for enabling build-up of Javascript expressions using a Python syntax. Calling ``repr(obj)`` will return a Javascript diff --git a/altair/jupyter/jupyter_chart.py b/altair/jupyter/jupyter_chart.py index 0d0a94885..6386848c2 100644 --- a/altair/jupyter/jupyter_chart.py +++ b/altair/jupyter/jupyter_chart.py @@ -17,9 +17,7 @@ class Params(traitlets.HasTraits): - """ - Traitlet class storing a JupyterChart's params - """ + """Traitlet class storing a JupyterChart's params.""" def __init__(self, trait_values): super().__init__() @@ -47,9 +45,7 @@ def __repr__(self): class Selections(traitlets.HasTraits): - """ - Traitlet class storing a JupyterChart's selections - """ + """Traitlet class storing a JupyterChart's selections.""" def __init__(self, trait_values): super().__init__() @@ -80,7 +76,7 @@ def __repr__(self): def _make_read_only(self, change): """ Work around to make traits read-only, but still allow us to change - them internally + them internally. """ if change["name"] in self.traits() and change["old"] != change["new"]: self._set_value(change["name"], change["old"]) @@ -137,7 +133,7 @@ class JupyterChart(anywidget.AnyWidget): @classmethod def enable_offline(cls, offline: bool = True): """ - Configure JupyterChart's offline behavior + Configure JupyterChart's offline behavior. Parameters ---------- @@ -193,7 +189,7 @@ def __init__( ): """ Jupyter Widget for displaying and updating Altair Charts, and - retrieving selection and parameter values + retrieving selection and parameter values. Parameters ---------- @@ -227,7 +223,7 @@ def __init__( def _on_change_chart(self, change): """ Internal callback function that updates the JupyterChart's internal - state when the wrapped Chart instance changes + state when the wrapped Chart instance changes. """ new_chart = change.new selection_watches = [] @@ -390,7 +386,7 @@ def _on_change_selections(self, change): def collect_transform_params(chart: TopLevelSpec) -> set[str]: """ - Collect the names of params that are defined by transforms + Collect the names of params that are defined by transforms. Parameters ---------- diff --git a/altair/utils/_dfi_types.py b/altair/utils/_dfi_types.py index 0d6f38b04..baad12dc7 100644 --- a/altair/utils/_dfi_types.py +++ b/altair/utils/_dfi_types.py @@ -55,7 +55,8 @@ def dtype(self) -> tuple[Any, int, str, str]: Data Interface format. Endianness : current only native endianness (``=``) is supported - Notes: + Notes + ----- - Kind specifiers are aligned with DLPack where possible (hence the jump to 20, leave enough room for future extension) - Masks must be specified as boolean with either bit width 1 (for bit @@ -134,14 +135,10 @@ def __dataframe__( """ def column_names(self) -> Iterable[str]: - """ - Return an iterator yielding the column names. - """ + """Return an iterator yielding the column names.""" def get_column_by_name(self, name: str) -> Column: - """ - Return the column whose name is the indicated name. - """ + """Return the column whose name is the indicated name.""" def get_chunks(self, n_chunks: int | None = None) -> Iterable[DataFrame]: """ diff --git a/altair/utils/_transformed_data.py b/altair/utils/_transformed_data.py index 798b60d63..0a622a2a8 100644 --- a/altair/utils/_transformed_data.py +++ b/altair/utils/_transformed_data.py @@ -71,7 +71,8 @@ def transformed_data( def transformed_data(chart, row_limit=None, exclude=None): - """Evaluate a Chart's transforms + """ + Evaluate a Chart's transforms. Evaluate the data transforms associated with a Chart and return the transformed data as one or more DataFrames @@ -157,7 +158,8 @@ def name_views( i: int = 0, exclude: Iterable[str] | None = None, ) -> list[str]: - """Name unnamed chart views + """ + Name unnamed chart views. Name unnamed charts views so that we can look them up later in the compiled Vega spec. @@ -217,7 +219,8 @@ def name_views( def get_group_mark_for_scope( vega_spec: dict[str, Any], scope: Scope ) -> dict[str, Any] | None: - """Get the group mark at a particular scope + """ + Get the group mark at a particular scope. Parameters ---------- @@ -270,7 +273,8 @@ def get_group_mark_for_scope( def get_datasets_for_scope(vega_spec: dict[str, Any], scope: Scope) -> list[str]: - """Get the names of the datasets that are defined at a given scope + """ + Get the names of the datasets that are defined at a given scope. Parameters ---------- @@ -341,7 +345,8 @@ def get_datasets_for_scope(vega_spec: dict[str, Any], scope: Scope) -> list[str] def get_definition_scope_for_data_reference( vega_spec: dict[str, Any], data_name: str, usage_scope: Scope ) -> Scope | None: - """Return the scope that a dataset is defined at, for a given usage scope + """ + Return the scope that a dataset is defined at, for a given usage scope. Parameters ---------- @@ -405,7 +410,8 @@ def get_definition_scope_for_data_reference( def get_facet_mapping(group: dict[str, Any], scope: Scope = ()) -> FacetMapping: - """Create mapping from facet definitions to source datasets + """ + Create mapping from facet definitions to source datasets. Parameters ---------- @@ -473,7 +479,8 @@ def get_facet_mapping(group: dict[str, Any], scope: Scope = ()) -> FacetMapping: def get_from_facet_mapping( scoped_dataset: tuple[str, Scope], facet_mapping: FacetMapping ) -> tuple[str, Scope]: - """Apply facet mapping to a scoped dataset + """ + Apply facet mapping to a scoped dataset. Parameters ---------- @@ -505,7 +512,8 @@ def get_datasets_for_view_names( facet_mapping: FacetMapping, scope: Scope = (), ) -> dict[str, tuple[str, Scope]]: - """Get the Vega datasets that correspond to the provided Altair view names + """ + Get the Vega datasets that correspond to the provided Altair view names. Parameters ---------- diff --git a/altair/utils/_vegafusion_data.py b/altair/utils/_vegafusion_data.py index c9f127378..d7c318865 100644 --- a/altair/utils/_vegafusion_data.py +++ b/altair/utils/_vegafusion_data.py @@ -68,7 +68,7 @@ def vegafusion_data_transformer( def vegafusion_data_transformer( data: DataType | None = None, max_rows: int = 100000 ) -> Callable[..., Any] | _VegaFusionReturnType: - """VegaFusion Data Transformer""" + """VegaFusion Data Transformer.""" # Vegafusion does not support Narwhals, so if `data` is a Narwhals # object, we make sure to extract the native object and let Vegafusion handle it. # `strict=False` passes `data` through as-is if it is not a Narwhals object. @@ -87,7 +87,8 @@ def vegafusion_data_transformer( def get_inline_table_names(vega_spec: dict[str, Any]) -> set[str]: - """Get a set of the inline datasets names in the provided Vega spec + """ + Get a set of the inline datasets names in the provided Vega spec. Inline datasets are encoded as URLs that start with the table:// prefix. @@ -137,7 +138,8 @@ def get_inline_table_names(vega_spec: dict[str, Any]) -> set[str]: def get_inline_tables(vega_spec: dict[str, Any]) -> dict[str, DataFrameLike]: - """Get the inline tables referenced by a Vega specification + """ + Get the inline tables referenced by a Vega specification. Note: This function should only be called on a Vega spec that corresponds to a chart that was processed by the vegafusion_data_transformer. @@ -164,7 +166,8 @@ def get_inline_tables(vega_spec: dict[str, Any]) -> dict[str, DataFrameLike]: def compile_to_vegafusion_chart_state( vegalite_spec: dict[str, Any], local_tz: str ) -> ChartState: - """Compile a Vega-Lite spec to a VegaFusion ChartState + """ + Compile a Vega-Lite spec to a VegaFusion ChartState. Note: This function should only be called on a Vega-Lite spec that was generated with the "vegafusion" data transformer enabled. @@ -217,7 +220,8 @@ def compile_to_vegafusion_chart_state( def compile_with_vegafusion(vegalite_spec: dict[str, Any]) -> dict: - """Compile a Vega-Lite spec to Vega and pre-transform with VegaFusion + """ + Compile a Vega-Lite spec to Vega and pre-transform with VegaFusion. Note: This function should only be called on a Vega-Lite spec that was generated with the "vegafusion" data transformer enabled. @@ -280,7 +284,7 @@ def handle_row_limit_exceeded(row_limit: int, warnings: list): def using_vegafusion() -> bool: - """Check whether the vegafusion data transformer is enabled""" + """Check whether the vegafusion data transformer is enabled.""" # Local import to avoid circular ImportError from altair import data_transformers diff --git a/altair/utils/core.py b/altair/utils/core.py index 739b839cb..012e9552f 100644 --- a/altair/utils/core.py +++ b/altair/utils/core.py @@ -1,6 +1,4 @@ -""" -Utility routines -""" +"""Utility routines.""" from __future__ import annotations @@ -215,7 +213,7 @@ def infer_vegalite_type_for_pandas( ) -> InferredVegaLiteType | tuple[InferredVegaLiteType, list[Any]]: """ From an array-like input, infer the correct vega typecode - ('ordinal', 'nominal', 'quantitative', or 'temporal') + ('ordinal', 'nominal', 'quantitative', or 'temporal'). Parameters ---------- @@ -260,9 +258,8 @@ def infer_vegalite_type_for_pandas( def merge_props_geom(feat: dict[str, Any]) -> dict[str, Any]: """ Merge properties with geometry - * Overwrites 'type' and 'geometry' entries if existing + * Overwrites 'type' and 'geometry' entries if existing. """ - geom = {k: feat[k] for k in ("type", "geometry")} try: feat["properties"].update(geom) @@ -276,14 +273,14 @@ def merge_props_geom(feat: dict[str, Any]) -> dict[str, Any]: def sanitize_geo_interface(geo: t.MutableMapping[Any, Any]) -> dict[str, Any]: - """Santize a geo_interface to prepare it for serialization. + """ + Santize a geo_interface to prepare it for serialization. * Make a copy * Convert type array or _Array to list * Convert tuples to lists (using json.loads/dumps) * Merge properties with geometry """ - geo = deepcopy(geo) # convert type _Array or array to list @@ -319,7 +316,8 @@ def numpy_is_subtype(dtype: Any, subtype: Any) -> bool: def sanitize_pandas_dataframe(df: pd.DataFrame) -> pd.DataFrame: - """Sanitize a DataFrame to prepare it for serialization. + """ + Sanitize a DataFrame to prepare it for serialization. * Make a copy * Convert RangeIndex columns to strings @@ -452,7 +450,7 @@ def to_list_if_array(val): def sanitize_narwhals_dataframe( data: nw.DataFrame[TIntoDataFrame], ) -> nw.DataFrame[TIntoDataFrame]: - """Sanitize narwhals.DataFrame for JSON serialization""" + """Sanitize narwhals.DataFrame for JSON serialization.""" schema = data.schema columns: list[IntoExpr] = [] # See https://github.com/vega/altair/issues/1027 for why this is necessary. @@ -482,7 +480,8 @@ def sanitize_narwhals_dataframe( def to_eager_narwhals_dataframe(data: IntoDataFrame) -> nw.DataFrame[Any]: - """Wrap `data` in `narwhals.DataFrame`. + """ + Wrap `data` in `narwhals.DataFrame`. If `data` is not supported by Narwhals, but it is convertible to a PyArrow table, then first convert to a PyArrow Table, @@ -507,7 +506,8 @@ def parse_shorthand( parse_timeunits: bool = True, parse_types: bool = True, ) -> dict[str, Any]: - """General tool to parse shorthand values + """ + General tool to parse shorthand values. These are of the form: @@ -688,7 +688,7 @@ def infer_vegalite_type_for_narwhals( def use_signature(obj: Callable[P, Any]): # -> Callable[..., Callable[P, V]]: - """Apply call signature and documentation of `obj` to the decorated method""" + """Apply call signature and documentation of `obj` to the decorated method.""" def decorate(func: Callable[..., V]) -> Callable[P, V]: # call-signature of func is exposed via __wrapped__. @@ -722,7 +722,8 @@ def update_nested( update: t.Mapping[Any, Any], copy: bool = False, ) -> t.MutableMapping[Any, Any]: - """Update nested dictionaries + """ + Update nested dictionaries. Parameters ---------- @@ -881,7 +882,8 @@ def _invert_group_channels( """Grouped inverted index for `_ChannelCache.channel_to_name`.""" def _reduce(it: Iterator[tuple[type[Any], str]]) -> Any: - """Returns a 1-2 item dict, per channel. + """ + Returns a 1-2 item dict, per channel. Never includes `datum`, as it is never utilized in `wrap_in_channel`. """ @@ -904,7 +906,8 @@ def _reduce(it: Iterator[tuple[type[Any], str]]) -> Any: def infer_encoding_types( args: tuple[Any, ...], kwargs: dict[str, Any], channels: ModuleType | None = None ): - """Infer typed keyword arguments for args and kwargs + """ + Infer typed keyword arguments for args and kwargs. Parameters ---------- diff --git a/altair/utils/data.py b/altair/utils/data.py index 920b8bd83..dc263fa1d 100644 --- a/altair/utils/data.py +++ b/altair/utils/data.py @@ -114,7 +114,8 @@ def limit_rows(data: DataType, max_rows: int | None = ...) -> DataType: ... def limit_rows( data: DataType | None = None, max_rows: int | None = 5000 ) -> partial | DataType: - """Raise MaxRowsError if the data model has more than max_rows. + """ + Raise MaxRowsError if the data model has more than max_rows. If max_rows is None, then do not perform any check. """ @@ -242,9 +243,7 @@ def to_json( filename: str = "{prefix}-{hash}.{extension}", urlpath: str = "", ) -> partial | _ToFormatReturnUrlDict: - """ - Write the data model to a .json file and return a url based data model. - """ + """Write the data model to a .json file and return a url based data model.""" kwds = _to_text_kwds(prefix, extension, filename, urlpath) if data is None: return partial(to_json, **kwds) @@ -351,7 +350,7 @@ def _compute_data_hash(data_str: str) -> str: def _data_to_json_string(data: DataType) -> str: - """Return a JSON string representation of the input data""" + """Return a JSON string representation of the input data.""" check_data_type(data) # `strict=False` passes `data` through as-is if it is not a Narwhals object. data_native = nw.to_native(data, strict=False) @@ -376,7 +375,7 @@ def _data_to_json_string(data: DataType) -> str: def _data_to_csv_string(data: dict | pd.DataFrame | DataFrameLike) -> str: - """return a CSV string representation of the input data""" + """Return a CSV string representation of the input data.""" check_data_type(data) if isinstance(data, SupportsGeoInterface): msg = ( @@ -413,7 +412,7 @@ def _data_to_csv_string(data: dict | pd.DataFrame | DataFrameLike) -> str: def arrow_table_from_dfi_dataframe(dfi_df: DataFrameLike) -> pa.Table: - """Convert a DataFrame Interchange Protocol compatible object to an Arrow Table""" + """Convert a DataFrame Interchange Protocol compatible object to an Arrow Table.""" import pyarrow as pa # First check if the dataframe object has a method to convert to arrow. diff --git a/altair/utils/deprecation.py b/altair/utils/deprecation.py index 88c12516c..f11dd1a41 100644 --- a/altair/utils/deprecation.py +++ b/altair/utils/deprecation.py @@ -42,7 +42,8 @@ def deprecated( category: type[AltairDeprecationWarning] | None = AltairDeprecationWarning, stacklevel: int = 1, ): # te.deprecated - """Indicate that a class, function or overload is deprecated. + """ + Indicate that a class, function or overload is deprecated. When this decorator is applied to an object, the type checker will generate a diagnostic on usage of the deprecated object. @@ -81,7 +82,8 @@ def deprecated_warn( category: type[AltairDeprecationWarning] = AltairDeprecationWarning, stacklevel: int = 2, ) -> None: - """Indicate that the current code path is deprecated. + """ + Indicate that the current code path is deprecated. This should be used for non-trivial cases *only*. ``@deprecated`` should always be preferred as it is recognized by static type checkers. diff --git a/altair/utils/display.py b/altair/utils/display.py index 2eee30564..3c54c8abd 100644 --- a/altair/utils/display.py +++ b/altair/utils/display.py @@ -56,7 +56,8 @@ def set_embed_options( time_format_locale: str | dict | None = None, **kwargs, ) -> PluginEnabler: - """Set options for embeddings of Vega & Vega-Lite charts. + """ + Set options for embeddings of Vega & Vega-Lite charts. Options are fully documented at https://github.com/vega/vega-embed. Similar to the `enable()` method, this can be used as either @@ -118,7 +119,8 @@ def set_embed_options( class Displayable: - """A base display class for VegaLite v1/v2. + """ + A base display class for VegaLite v1/v2. This class takes a VegaLite v1/v2 spec and does the following: @@ -165,7 +167,8 @@ def _repr_mimebundle_( def default_renderer_base( spec: dict[str, Any], mime_type: str, str_repr: str, **options ) -> DefaultRendererReturnType: - """A default renderer for Vega or VegaLite that works for modern frontends. + """ + A default renderer for Vega or VegaLite that works for modern frontends. This renderer works with modern frontends (JupyterLab, nteract) that know how to render the custom VegaLite MIME type listed above. @@ -195,7 +198,8 @@ def default_renderer_base( def json_renderer_base( spec: dict[str, Any], str_repr: str, **options ) -> DefaultRendererReturnType: - """A renderer that returns a MIME type of application/json. + """ + A renderer that returns a MIME type of application/json. In JupyterLab/nteract this is rendered as a nice JSON tree. """ @@ -205,7 +209,7 @@ def json_renderer_base( class HTMLRenderer: - """Object to render charts as HTML, with a unique output div each time""" + """Object to render charts as HTML, with a unique output div each time.""" def __init__(self, output_div: str = "altair-viz-{}", **kwargs) -> None: self._output_div = output_div diff --git a/altair/utils/execeval.py b/altair/utils/execeval.py index 7e98fd378..5d3da928b 100644 --- a/altair/utils/execeval.py +++ b/altair/utils/execeval.py @@ -3,7 +3,7 @@ class _CatchDisplay: - """Class to temporarily catch sys.displayhook""" + """Class to temporarily catch sys.displayhook.""" def __init__(self): self.output = None @@ -24,7 +24,7 @@ def __call__(self, output): def eval_block(code, namespace=None, filename=""): """ - Execute a multi-line block of code in the given namespace + Execute a multi-line block of code in the given namespace. If the final statement in the code is an expression, return the result of the expression. diff --git a/altair/utils/html.py b/altair/utils/html.py index 5780eca8f..7b5f4dcf5 100644 --- a/altair/utils/html.py +++ b/altair/utils/html.py @@ -226,7 +226,8 @@ def spec_to_html( requirejs: bool = False, template: jinja2.Template | TemplateName = "standard", ) -> str: - """Embed a Vega/Vega-Lite spec into an HTML page + """ + Embed a Vega/Vega-Lite spec into an HTML page. Parameters ---------- diff --git a/altair/utils/mimebundle.py b/altair/utils/mimebundle.py index 33af5ae30..687355f64 100644 --- a/altair/utils/mimebundle.py +++ b/altair/utils/mimebundle.py @@ -69,7 +69,8 @@ def spec_to_mimebundle( engine: Literal["vl-convert"] | None = None, **kwargs, ) -> dict[str, Any] | tuple[dict[str, Any], dict[str, Any]]: - """Convert a vega-lite specification to a mimebundle + """ + Convert a vega-lite specification to a mimebundle. The mimebundle type is controlled by the ``format`` argument, which can be one of the following ['html', 'json', 'png', 'svg', 'pdf', 'vega', 'vega-lite'] @@ -174,7 +175,8 @@ def _spec_to_mimebundle_with_engine( time_format_locale: str | dict | None = None, **kwargs, ) -> Any: - """Helper for Vega-Lite to mimebundle conversions that require an engine + """ + Helper for Vega-Lite to mimebundle conversions that require an engine. Parameters ---------- @@ -287,7 +289,8 @@ def _validate_normalize_engine( engine: Literal["vl-convert"] | None, format: Literal["png", "svg", "pdf", "vega"], ) -> str: - """Helper to validate and normalize the user-provided engine + """ + Helper to validate and normalize the user-provided engine. engine : {None, 'vl-convert'} the user-provided engine string @@ -326,7 +329,8 @@ def _validate_normalize_engine( def _pngxy(data): - """read the (width, height) from a PNG header + """ + read the (width, height) from a PNG header. Taken from IPython.display """ @@ -336,7 +340,8 @@ def _pngxy(data): def preprocess_embed_options(embed_options: dict) -> dict: - """Preprocess embed options to a form compatible with Vega Embed + """ + Preprocess embed options to a form compatible with Vega Embed. Parameters ---------- diff --git a/altair/utils/plugin_registry.py b/altair/utils/plugin_registry.py index e81d79649..d2ae15cc1 100644 --- a/altair/utils/plugin_registry.py +++ b/altair/utils/plugin_registry.py @@ -19,7 +19,8 @@ def _is_type(tp: type[T], /) -> Callable[[object], TypeIs[type[T]]]: - """Converts a type to guard function. + """ + Converts a type to guard function. Added for compatibility with original `PluginRegistry` default. """ @@ -40,7 +41,8 @@ def __str__(self): class PluginEnabler: - """Context manager for enabling plugins + """ + Context manager for enabling plugins. This object lets you use enable() as a context manager to temporarily enable a given plugin:: @@ -68,7 +70,8 @@ def __repr__(self) -> str: class PluginRegistry(Generic[PluginT, R]): - """A registry for plugins. + """ + A registry for plugins. This is a plugin registry that allows plugins to be loaded/registered in two ways: @@ -95,10 +98,11 @@ class PluginRegistry(Generic[PluginT, R]): def __init__( self, entry_point_group: str = "", plugin_type: IsPlugin = callable ) -> None: - """Create a PluginRegistry for a named entry point group. + """ + Create a PluginRegistry for a named entry point group. Parameters - ========== + ---------- entry_point_group: str The name of the entry point group. plugin_type @@ -106,7 +110,7 @@ def __init__( type checking loaded plugins. References - ========== + ---------- https://typing.readthedocs.io/en/latest/spec/narrowing.html """ self.entry_point_group: str = entry_point_group @@ -130,20 +134,21 @@ def __init__( self._global_settings: dict[str, Any] = self.__class__._global_settings.copy() def register(self, name: str, value: PluginT | None) -> PluginT | None: - """Register a plugin by name and value. + """ + Register a plugin by name and value. This method is used for explicit registration of a plugin and shouldn't be used to manage entry point managed plugins, which are auto-loaded. Parameters - ========== + ---------- name: str The name of the plugin. value: PluginType or None The actual plugin object to register or None to unregister that plugin. Returns - ======= + ------- plugin: PluginType or None The plugin that was registered or unregistered. """ @@ -165,7 +170,7 @@ def names(self) -> list[str]: return sorted(set(exts)) def _get_state(self) -> dict[str, Any]: - """Return a dictionary representing the current state of the registry""" + """Return a dictionary representing the current state of the registry.""" return { "_active": self._active, "_active_name": self._active_name, @@ -175,7 +180,7 @@ def _get_state(self) -> dict[str, Any]: } def _set_state(self, state: dict[str, Any]) -> None: - """Reset the state of the registry""" + """Reset the state of the registry.""" assert set(state.keys()) == { "_active", "_active_name", @@ -208,7 +213,8 @@ def _enable(self, name: str, **options) -> None: self._options = options def enable(self, name: str | None = None, **options) -> PluginEnabler: - """Enable a plugin by name. + """ + Enable a plugin by name. This can be either called directly, or used as a context manager. @@ -232,12 +238,12 @@ def enable(self, name: str | None = None, **options) -> PluginEnabler: @property def active(self) -> str: - """Return the name of the currently active plugin""" + """Return the name of the currently active plugin.""" return self._active_name @property def options(self) -> dict[str, Any]: - """Return the current options dictionary""" + """Return the current options dictionary.""" return self._options def get(self) -> partial[R] | Plugin[R] | None: diff --git a/altair/utils/save.py b/altair/utils/save.py index 61d13d8d1..2c5a9d807 100644 --- a/altair/utils/save.py +++ b/altair/utils/save.py @@ -19,8 +19,10 @@ def write_file_or_filename( mode: str = "w", encoding: str | None = None, ) -> None: - """Write content to fp, whether fp is a string, a pathlib Path or a - file-like object""" + """ + Write content to fp, whether fp is a string, a pathlib Path or a + file-like object. + """ if isinstance(fp, (str, pathlib.Path)): with pathlib.Path(fp).open(mode=mode, encoding=encoding) as f: f.write(content) @@ -31,7 +33,7 @@ def write_file_or_filename( def set_inspect_format_argument( format: str | None, fp: str | Path | IO, inline: bool ) -> str: - """Inspect the format argument in the save function""" + """Inspect the format argument in the save function.""" if format is None: if isinstance(fp, (str, pathlib.Path)): format = pathlib.Path(fp).suffix.lstrip(".") @@ -54,7 +56,7 @@ def set_inspect_mode_argument( spec: dict[str, Any], vegalite_version: str | None, ) -> Literal["vega-lite"]: - """Inspect the mode argument in the save function""" + """Inspect the mode argument in the save function.""" if mode is None: if "mode" in embed_options: mode = embed_options["mode"] @@ -90,7 +92,8 @@ def save( inline: bool = False, **kwargs, ) -> None: - """Save a chart to file in a variety of formats + """ + Save a chart to file in a variety of formats. Supported formats are [json, html, png, svg, pdf] diff --git a/altair/utils/schemapi.py b/altair/utils/schemapi.py index c24090aa0..aa8eeb054 100644 --- a/altair/utils/schemapi.py +++ b/altair/utils/schemapi.py @@ -130,7 +130,8 @@ def validate_jsonschema( *, raise_error=True, ): - """Validates the passed in spec against the schema in the context of the + """ + Validates the passed in spec against the schema in the context of the rootschema. If any errors are found, they are deduplicated and prioritized and only the most relevant errors are kept. Errors are then either raised or returned, depending on the value of `raise_error`. @@ -164,7 +165,8 @@ def _get_errors_from_spec( schema: dict[str, Any], rootschema: dict[str, Any] | None = None, ) -> ValidationErrorList: - """Uses the relevant jsonschema validator to validate the passed in spec + """ + Uses the relevant jsonschema validator to validate the passed in spec against the schema using the rootschema to resolve references. The schema and rootschema themselves are not validated but instead considered as valid. @@ -211,8 +213,10 @@ def _get_json_schema_draft_url(schema: dict[str, Any]) -> str: def _use_referencing_library() -> bool: - """In version 4.18.0, the jsonschema package deprecated RefResolver in - favor of the referencing library.""" + """ + In version 4.18.0, the jsonschema package deprecated RefResolver in + favor of the referencing library. + """ return Version(jsonschema_version_str) >= Version("4.18") @@ -223,7 +227,8 @@ def _prepare_references_in_schema(schema: dict[str, Any]) -> dict[str, Any]: schema = copy.deepcopy(schema) def _prepare_refs(d: dict[str, Any]) -> dict[str, Any]: - """Add _VEGA_LITE_ROOT_URI in front of all $ref values. + """ + Add _VEGA_LITE_ROOT_URI in front of all $ref values. This function recursively iterates through the whole dictionary. @@ -276,10 +281,11 @@ def _get_referencing_registry( def _json_path(err: jsonschema.exceptions.ValidationError) -> str: - """Drop in replacement for the .json_path property of the jsonschema + """ + Drop in replacement for the .json_path property of the jsonschema ValidationError class, which is not available as property for ValidationError with jsonschema<4.0.1. - More info, see https://github.com/vega/altair/issues/3038 + More info, see https://github.com/vega/altair/issues/3038. """ path = "$" for elem in err.absolute_path: @@ -293,7 +299,8 @@ def _json_path(err: jsonschema.exceptions.ValidationError) -> str: def _group_errors_by_json_path( errors: ValidationErrorList, ) -> GroupedValidationErrors: - """Groups errors by the `json_path` attribute of the jsonschema ValidationError + """ + Groups errors by the `json_path` attribute of the jsonschema ValidationError class. This attribute contains the path to the offending element within a chart specification and can therefore be considered as an identifier of an 'issue' in the chart that needs to be fixed. @@ -308,7 +315,8 @@ def _group_errors_by_json_path( def _get_leaves_of_error_tree( errors: ValidationErrorList, ) -> ValidationErrorList: - """For each error in `errors`, it traverses down the "error tree" that is generated + """ + For each error in `errors`, it traverses down the "error tree" that is generated by the jsonschema library to find and return all "leaf" errors. These are errors which have no further errors that caused it and so they are the most specific errors with the most specific error messages. @@ -328,7 +336,8 @@ def _get_leaves_of_error_tree( def _subset_to_most_specific_json_paths( errors_by_json_path: GroupedValidationErrors, ) -> GroupedValidationErrors: - """Removes key (json path), value (errors) pairs where the json path is fully + """ + Removes key (json path), value (errors) pairs where the json path is fully contained in another json path. For example if `errors_by_json_path` has two keys, `$.encoding.X` and `$.encoding.X.tooltip`, then the first one will be removed and only the second one is returned. This is done under the assumption that @@ -352,7 +361,8 @@ def _contained_at_start_of_one_of_other_values(x: str, values: Sequence[str]) -> def _deduplicate_errors( grouped_errors: GroupedValidationErrors, ) -> GroupedValidationErrors: - """Some errors have very similar error messages or are just in general not helpful + """ + Some errors have very similar error messages or are just in general not helpful for a user. This function removes as many of these cases as possible and can be extended over time to handle new cases that come up. """ @@ -391,7 +401,8 @@ def _is_required_value_error(err: jsonschema.exceptions.ValidationError) -> bool def _group_errors_by_validator(errors: ValidationErrorList) -> GroupedValidationErrors: - """Groups the errors by the json schema "validator" that casued the error. For + """ + Groups the errors by the json schema "validator" that casued the error. For example if the error is that a value is not one of an enumeration in the json schema then the "validator" is `"enum"`, if the error is due to an unknown property that was set although no additional properties are allowed then "validator" is @@ -407,7 +418,8 @@ def _group_errors_by_validator(errors: ValidationErrorList) -> GroupedValidation def _deduplicate_enum_errors(errors: ValidationErrorList) -> ValidationErrorList: - """Deduplicate enum errors by removing the errors where the allowed values + """ + Deduplicate enum errors by removing the errors where the allowed values are a subset of another error. For example, if `enum` contains two errors and one has `validator_value` (i.e. accepted values) ["A", "B"] and the other one ["A", "B", "C"] then the first one is removed and the final @@ -429,7 +441,8 @@ def _deduplicate_enum_errors(errors: ValidationErrorList) -> ValidationErrorList def _deduplicate_additional_properties_errors( errors: ValidationErrorList, ) -> ValidationErrorList: - """If there are multiple additional property errors it usually means that + """ + If there are multiple additional property errors it usually means that the offending element was validated against multiple schemas and its parent is a common anyOf validator. The error messages produced from these cases are usually @@ -438,7 +451,7 @@ def _deduplicate_additional_properties_errors( `alt.X("variety", unknown=2)`: - "Additional properties are not allowed ('unknown' was unexpected)" - "Additional properties are not allowed ('field', 'unknown' were unexpected)" - - "Additional properties are not allowed ('field', 'type', 'unknown' were unexpected)" + - "Additional properties are not allowed ('field', 'type', 'unknown' were unexpected)". """ if len(errors) > 1: # Test if all parent errors are the same anyOf error and only do @@ -457,7 +470,8 @@ def _deduplicate_additional_properties_errors( def _deduplicate_by_message(errors: ValidationErrorList) -> ValidationErrorList: - """Deduplicate errors by message. This keeps the original order in case + """ + Deduplicate errors by message. This keeps the original order in case it was chosen intentionally. """ return list({e.message: e for e in errors}.values()) @@ -509,7 +523,8 @@ def _todict(obj: Any, context: dict[str, Any] | None, np_opt: Any, pd_opt: Any) def _resolve_references( schema: dict[str, Any], rootschema: dict[str, Any] | None = None ) -> dict[str, Any]: - """Resolve schema references until there is no $ref anymore + """ + Resolve schema references until there is no $ref anymore in the top-level of the dictionary. """ if _use_referencing_library(): @@ -531,7 +546,7 @@ def _resolve_references( class SchemaValidationError(jsonschema.ValidationError): - """A wrapper for jsonschema.ValidationError with friendlier traceback""" + """A wrapper for jsonschema.ValidationError with friendlier traceback.""" def __init__(self, obj: SchemaBase, err: jsonschema.ValidationError) -> None: super().__init__(**err._contents()) @@ -611,7 +626,8 @@ def _get_additional_properties_error_message( def _get_altair_class_for_error( self, error: jsonschema.exceptions.ValidationError ) -> type[SchemaBase]: - """Try to get the lowest class possible in the chart hierarchy so + """ + Try to get the lowest class possible in the chart hierarchy so it can be displayed in the error message. This should lead to more informative error messages pointing the user closer to the source of the issue. """ @@ -631,7 +647,7 @@ def _get_altair_class_for_error( @staticmethod def _format_params_as_table(param_dict_keys: Iterable[str]) -> str: - """Format param names into a table so that they are easier to read""" + """Format param names into a table so that they are easier to read.""" param_names: tuple[str, ...] name_lengths: tuple[int, ...] param_names, name_lengths = zip( @@ -741,7 +757,7 @@ def _get_default_error_message( class UndefinedType: - """A singleton object for marking undefined parameters""" + """A singleton object for marking undefined parameters.""" __instance = None @@ -788,7 +804,8 @@ def func_2( def is_undefined(obj: Any) -> TypeIs[UndefinedType]: - """Type-safe singleton check for `UndefinedType`. + """ + Type-safe singleton check for `UndefinedType`. Notes ----- @@ -801,7 +818,8 @@ def is_undefined(obj: Any) -> TypeIs[UndefinedType]: class SchemaBase: - """Base class for schema wrappers. + """ + Base class for schema wrappers. Each derived class should set the _schema class attribute (and optionally the _rootschema class attribute) which is used for validation. @@ -839,7 +857,8 @@ def __init__(self, *args: Any, **kwds: Any) -> None: def copy( self, deep: bool | Iterable[Any] = True, ignore: list[str] | None = None ) -> Self: - """Return a copy of the object + """ + Return a copy of the object. Parameters ---------- @@ -956,7 +975,8 @@ def to_dict( ignore: list[str] | None = None, context: dict[str, Any] | None = None, ) -> dict[str, Any]: - """Return a dictionary representation of the object + """ + Return a dictionary representation of the object. Parameters ---------- @@ -1056,7 +1076,8 @@ def to_json( context: dict[str, Any] | None = None, **kwargs, ) -> str: - """Emit the JSON representation for this object as a string. + """ + Emit the JSON representation for this object as a string. Parameters ---------- @@ -1095,14 +1116,15 @@ def to_json( @classmethod def _default_wrapper_classes(cls) -> Iterator[type[SchemaBase]]: - """Return the set of classes used within cls.from_dict()""" + """Return the set of classes used within cls.from_dict().""" return _subclasses(SchemaBase) @classmethod def from_dict( cls: type[TSchemaBase], dct: dict[str, Any], validate: bool = True ) -> TSchemaBase: - """Construct class from a dictionary representation + """ + Construct class from a dictionary representation. Parameters ---------- @@ -1135,7 +1157,8 @@ def from_json( # Type hints for this method would get rather complicated # if we want to provide a more specific return type ) -> ChartType: - """Instantiate the object from a valid JSON string + """ + Instantiate the object from a valid JSON string. Parameters ---------- @@ -1187,7 +1210,7 @@ def validate_property( ) -> None: """ Validate a property against property schema in the context of the - rootschema + rootschema. """ # The following return the package only if it has already been # imported - otherwise they return None. This is useful for @@ -1221,7 +1244,8 @@ def _passthrough(*args: Any, **kwds: Any) -> Any | dict[str, Any]: class _FromDict: - """Class used to construct SchemaBase class hierarchies from a dict + """ + Class used to construct SchemaBase class hierarchies from a dict. The primary purpose of using this class is to be able to build a hash table that maps schemas to their wrapper classes. The candidate classes are @@ -1327,7 +1351,7 @@ def from_dict( rootschema: dict[str, Any] | None = None, default_class: Any = _passthrough, ) -> TSchemaBase: - """Construct an object from a dict representation""" + """Construct an object from a dict representation.""" target_tp: type[TSchemaBase] current_schema: dict[str, Any] if isinstance(dct, SchemaBase): @@ -1426,9 +1450,7 @@ def __call__(self, *args: Any, **kwargs: Any): def with_property_setters(cls: type[TSchemaBase]) -> type[TSchemaBase]: - """ - Decorator to add property setters to a Schema class. - """ + """Decorator to add property setters to a Schema class.""" schema = cls.resolve_references() for prop, propschema in schema.get("properties", {}).items(): setattr(cls, prop, _PropertySetter(prop, propschema)) diff --git a/altair/utils/server.py b/altair/utils/server.py index a9f1000a7..8c57e9e8b 100644 --- a/altair/utils/server.py +++ b/altair/utils/server.py @@ -68,7 +68,7 @@ def do_GET(self): def find_open_port(ip, port, n=50): - """Find an open port near the specified port""" + """Find an open port near the specified port.""" ports = itertools.chain( (port + i for i in range(n)), (port + random.randint(-2 * n, 2 * n)) ) @@ -93,7 +93,8 @@ def serve( open_browser=True, http_server=None, ) -> None: - """Start a server serving the given HTML, and (optionally) open a browser + """ + Start a server serving the given HTML, and (optionally) open a browser. Parameters ---------- diff --git a/altair/utils/theme.py b/altair/utils/theme.py index 4ad0209da..8a913cdc1 100644 --- a/altair/utils/theme.py +++ b/altair/utils/theme.py @@ -1,4 +1,4 @@ -"""Utilities for registering and working with themes""" +"""Utilities for registering and working with themes.""" from .plugin_registry import PluginRegistry from typing import Callable diff --git a/altair/vegalite/v5/api.py b/altair/vegalite/v5/api.py index 58820e5fa..341c23237 100644 --- a/altair/vegalite/v5/api.py +++ b/altair/vegalite/v5/api.py @@ -131,7 +131,8 @@ # ------------------------------------------------------------------------ # Data Utilities def _dataset_name(values: dict | list | InlineDataset) -> str: - """Generate a unique hash of the data + """ + Generate a unique hash of the data. Parameters ---------- @@ -153,7 +154,8 @@ def _dataset_name(values: dict | list | InlineDataset) -> str: def _consolidate_data(data: Any, context: Any) -> Any: - """If data is specified inline, then move it to context['datasets'] + """ + If data is specified inline, then move it to context['datasets']. This function will modify context in-place, and return a new version of data """ @@ -181,7 +183,8 @@ def _consolidate_data(data: Any, context: Any) -> Any: def _prepare_data(data, context=None): - """Convert input data to data for use within schema + """ + Convert input data to data for use within schema. Parameters ---------- @@ -267,7 +270,7 @@ def to_dict(self, *args, **kwargs) -> dict: # ------------------------------------------------------------------------- # Tools for working with parameters class Parameter(_expr_core.OperatorMixin): - """A Parameter object""" + """A Parameter object.""" _counter: int = 0 @@ -294,7 +297,7 @@ def __init__( @utils.deprecated(version="5.0.0", alternative="to_dict") def ref(self) -> dict: - "'ref' is deprecated. No need to call '.ref()' anymore." + """'ref' is deprecated. No need to call '.ref()' anymore.""" return self.to_dict() def to_dict(self) -> dict[str, str | dict]: @@ -599,7 +602,8 @@ def _is_condition_extra(obj: Any, *objs: Any, kwds: Map) -> TypeIs[_Condition]: def _parse_when_constraints( constraints: dict[str, _FieldEqualType], / ) -> Iterator[BinaryExpression]: - """Wrap kwargs with `alt.datum`. + """ + Wrap kwargs with `alt.datum`. ```py # before @@ -633,7 +637,8 @@ def _parse_when_compose( constraints: dict[str, _FieldEqualType], /, ) -> BinaryExpression: - """Compose an `&` reduction predicate. + """ + Compose an `&` reduction predicate. Parameters ---------- @@ -730,7 +735,8 @@ def _when_then( class When(_BaseWhen): - """Utility class for ``when-then-otherwise`` conditions. + """ + Utility class for ``when-then-otherwise`` conditions. Represents the state after calling :func:`.when()`. @@ -753,7 +759,8 @@ def then( self, statement: dict[str, Any] | SchemaBase, /, **kwds: Any ) -> Then[Any]: ... def then(self, statement: _StatementType, /, **kwds: Any) -> Then[Any]: - """Attach a statement to this predicate. + """ + Attach a statement to this predicate. Parameters ---------- @@ -777,7 +784,8 @@ def then(self, statement: _StatementType, /, **kwds: Any) -> Then[Any]: class Then(core.SchemaBase, t.Generic[_C]): - """Utility class for ``when-then-otherwise`` conditions. + """ + Utility class for ``when-then-otherwise`` conditions. Represents the state after calling :func:`.when().then()`. @@ -812,7 +820,8 @@ def otherwise( def otherwise( self, statement: _StatementType, /, **kwds: Any ) -> SchemaBase | _Conditional[Any]: - """Finalize the condition with a default value. + """ + Finalize the condition with a default value. Parameters ---------- @@ -864,7 +873,8 @@ def when( empty: Optional[bool] = Undefined, **constraints: _FieldEqualType, ) -> ChainedWhen: - """Attach another predicate to the condition. + """ + Attach another predicate to the condition. The resulting predicate is an ``&`` reduction over ``predicate`` and optional ``*``, ``**``, arguments. @@ -938,7 +948,8 @@ def __init__( self._conditions = conditions def then(self, statement: _StatementType, /, **kwds: Any) -> Then[_Conditions]: - """Attach a statement to this predicate. + """ + Attach a statement to this predicate. Parameters ---------- @@ -966,7 +977,8 @@ def when( empty: Optional[bool] = Undefined, **constraints: _FieldEqualType, ) -> When: - """Start a ``when-then-otherwise`` condition. + """ + Start a ``when-then-otherwise`` condition. The resulting predicate is an ``&`` reduction over ``predicate`` and optional ``*``, ``**``, arguments. @@ -1022,7 +1034,7 @@ def when( def value(value, **kwargs) -> _Value: - """Specify a value for use in an encoding""" + """Specify a value for use in an encoding.""" return _Value(value=value, **kwargs) # type: ignore[typeddict-item] @@ -1034,7 +1046,8 @@ def param( expr: Optional[str | Expr | Expression] = Undefined, **kwds, ) -> Parameter: - """Create a named parameter. + """ + Create a named parameter. See https://altair-viz.github.io/user_guide/interactions.html for examples. Although both variable parameters and selection parameters can be created using this 'param' function, to create a selection parameter, it is recommended to use @@ -1161,7 +1174,6 @@ def selection(type: Optional[SelectionType_T] = Undefined, **kwds) -> Parameter: **kwds : additional keywords to control the selection. """ - return _selection(type=type, **kwds) @@ -1180,7 +1192,8 @@ def selection_interval( zoom: Optional[str | bool] = Undefined, **kwds, ) -> Parameter: - """Create an interval selection parameter. Selection parameters define data queries that are driven by direct manipulation from user input (e.g., mouse clicks or drags). Interval selection parameters are used to select a continuous range of data values on drag, whereas point selection parameters (`selection_point`) are used to select multiple discrete data values.) + """ + Create an interval selection parameter. Selection parameters define data queries that are driven by direct manipulation from user input (e.g., mouse clicks or drags). Interval selection parameters are used to select a continuous range of data values on drag, whereas point selection parameters (`selection_point`) are used to select multiple discrete data values.). Parameters ---------- @@ -1292,7 +1305,8 @@ def selection_point( nearest: Optional[bool] = Undefined, **kwds, ) -> Parameter: - """Create a point selection parameter. Selection parameters define data queries that are driven by direct manipulation from user input (e.g., mouse clicks or drags). Point selection parameters are used to select multiple discrete data values; the first value is selected on click and additional values toggled on shift-click. To select a continuous range of data values on drag interval selection parameters (`selection_interval`) can be used instead. + """ + Create a point selection parameter. Selection parameters define data queries that are driven by direct manipulation from user input (e.g., mouse clicks or drags). Point selection parameters are used to select multiple discrete data values; the first value is selected on click and additional values toggled on shift-click. To select a continuous range of data values on drag interval selection parameters (`selection_interval`) can be used instead. Parameters ---------- @@ -1395,43 +1409,43 @@ def selection_point( @utils.deprecated(version="5.0.0", alternative="selection_point") def selection_multi(**kwargs): - """'selection_multi' is deprecated. Use 'selection_point'""" + """'selection_multi' is deprecated. Use 'selection_point'.""" return _selection(type="point", **kwargs) @utils.deprecated(version="5.0.0", alternative="selection_point") def selection_single(**kwargs): - """'selection_single' is deprecated. Use 'selection_point'""" + """'selection_single' is deprecated. Use 'selection_point'.""" return _selection(type="point", **kwargs) @utils.use_signature(core.Binding) def binding(input, **kwargs): - """A generic binding""" + """A generic binding.""" return core.Binding(input=input, **kwargs) @utils.use_signature(core.BindCheckbox) def binding_checkbox(**kwargs): - """A checkbox binding""" + """A checkbox binding.""" return core.BindCheckbox(input="checkbox", **kwargs) @utils.use_signature(core.BindRadioSelect) def binding_radio(**kwargs): - """A radio button binding""" + """A radio button binding.""" return core.BindRadioSelect(input="radio", **kwargs) @utils.use_signature(core.BindRadioSelect) def binding_select(**kwargs): - """A select binding""" + """A select binding.""" return core.BindRadioSelect(input="select", **kwargs) @utils.use_signature(core.BindRange) def binding_range(**kwargs): - """A range binding""" + """A range binding.""" return core.BindRange(input="range", **kwargs) @@ -1475,7 +1489,8 @@ def condition( empty: Optional[bool] = Undefined, **kwargs, ) -> SchemaBase | dict[str, _ConditionType | Any]: - """A conditional attribute or encoding + """ + A conditional attribute or encoding. Parameters ---------- @@ -1510,7 +1525,8 @@ def condition( def _top_schema_base(obj: Any, /): # -> - """Enforces an intersection type w/ `SchemaBase` & `TopLevelMixin` objects. + """ + Enforces an intersection type w/ `SchemaBase` & `TopLevelMixin` objects. Use for instance methods. """ @@ -1535,7 +1551,8 @@ def to_dict( ignore: list[str] | None = None, context: dict[str, Any] | None = None, ) -> dict: - """Convert the chart to a dictionary suitable for JSON export + """ + Convert the chart to a dictionary suitable for JSON export. Parameters ---------- @@ -1566,7 +1583,6 @@ def to_dict( SchemaValidationError if validate=True and the dict does not conform to the schema """ - # Validate format if format not in {"vega-lite", "vega"}: msg = f'The format argument must be either "vega-lite" or "vega". Received {format!r}' @@ -1663,7 +1679,8 @@ def to_json( context: dict[str, Any] | None = None, **kwargs, ) -> str: - """Convert a chart to a JSON string + """ + Convert a chart to a JSON string. Parameters ---------- @@ -1707,7 +1724,8 @@ def to_html( inline: bool = False, **kwargs, ) -> str: - """Embed a Vega/Vega-Lite spec into an HTML page + """ + Embed a Vega/Vega-Lite spec into an HTML page. Parameters ---------- @@ -1734,6 +1752,7 @@ def to_html( The vl-convert-python package is required if True. **kwargs : additional kwargs passed to spec_to_html. + Returns ------- output : string @@ -1757,7 +1776,8 @@ def to_html( ) def to_url(self, *, fullscreen: bool = False) -> str: - """Convert a chart to a URL that opens the chart specification in the Vega chart editor + """ + Convert a chart to a URL that opens the chart specification in the Vega chart editor The chart specification (including any inline data) is encoded in the URL. This method requires that the vl-convert-python package is installed. @@ -1776,7 +1796,8 @@ def to_url(self, *, fullscreen: bool = False) -> str: return vlc.vegalite_to_url(self.to_dict(), fullscreen=fullscreen) def open_editor(self, *, fullscreen: bool = False) -> None: - """Opens the chart specification in the Vega chart editor using the default browser. + """ + Opens the chart specification in the Vega chart editor using the default browser. Parameters ---------- @@ -1804,7 +1825,8 @@ def save( inline=False, **kwargs, ) -> None: - """Save a chart to file in a variety of formats + """ + Save a chart to file in a variety of formats. Supported formats are json, html, png, svg, pdf; the last three require the vl-convert-python package to be installed. @@ -1922,7 +1944,8 @@ def repeat( columns: Optional[int] = Undefined, **kwargs, ) -> RepeatChart: - """Return a RepeatChart built from the chart + """ + Return a RepeatChart built from the chart. Fields within the chart can be set to correspond to the row or column using `alt.repeat('row')` and `alt.repeat('column')`. @@ -1973,7 +1996,8 @@ def repeat( return RepeatChart(spec=self, repeat=repeat_arg, columns=columns, **kwargs) def properties(self, **kwargs) -> Self: - """Set top-level properties of the Chart. + """ + Set top-level properties of the Chart. Argument names and types are the same as class initialization. """ @@ -2021,7 +2045,8 @@ def project( ] = Undefined, **kwds, ) -> Self: - """Add a geographic projection to the chart. + """ + Add a geographic projection to the chart. This is generally used either with ``mark_geoshape`` or with the ``latitude``/``longitude`` encodings. @@ -2143,7 +2168,7 @@ def project( return self.properties(projection=projection) def _add_transform(self, *transforms: Transform) -> Self: - """Copy the chart and add specified transforms to chart.transform""" + """Copy the chart and add specified transforms to chart.transform.""" copy = _top_schema_base(self).copy(deep=["transform"]) if copy.transform is Undefined: copy.transform = [] @@ -2374,7 +2399,8 @@ def transform_density( steps: Optional[int] = Undefined, resolve: Optional[ResolveMode_T] = Undefined, ) -> Self: - """Add a :class:`DensityTransform` to the spec. + """ + Add a :class:`DensityTransform` to the spec. Parameters ---------- @@ -2566,7 +2592,8 @@ def transform_joinaggregate( def transform_extent( self, extent: str | FieldName, param: str | ParameterName ) -> Self: - """Add a :class:`ExtentTransform` to the spec. + """ + Add a :class:`ExtentTransform` to the spec. Parameters ---------- @@ -2628,7 +2655,8 @@ def transform_flatten( flatten: list[str | FieldName], as_: Optional[list[str | FieldName]] = Undefined, ) -> Self: - """Add a :class:`FlattenTransform` to the schema. + """ + Add a :class:`FlattenTransform` to the schema. Parameters ---------- @@ -2660,7 +2688,8 @@ def transform_fold( fold: list[str | FieldName], as_: Optional[list[str | FieldName]] = Undefined, ) -> Self: - """Add a :class:`FoldTransform` to the spec. + """ + Add a :class:`FoldTransform` to the spec. Parameters ---------- @@ -2690,7 +2719,8 @@ def transform_loess( bandwidth: Optional[float] = Undefined, groupby: Optional[list[str | FieldName]] = Undefined, ) -> Self: - """Add a :class:`LoessTransform` to the spec. + """ + Add a :class:`LoessTransform` to the spec. Parameters ---------- @@ -2732,7 +2762,8 @@ def transform_lookup( default: Optional[str] = Undefined, **kwargs, ) -> Self: - """Add a :class:`DataLookupTransform` or :class:`SelectionLookupTransform` to the chart + """ + Add a :class:`DataLookupTransform` or :class:`SelectionLookupTransform` to the chart. Parameters ---------- @@ -2785,7 +2816,8 @@ def transform_pivot( limit: Optional[int] = Undefined, op: Optional[AggregateOp_T | AggregateOp] = Undefined, ) -> Self: - """Add a :class:`PivotTransform` to the chart. + """ + Add a :class:`PivotTransform` to the chart. Parameters ---------- @@ -2831,7 +2863,8 @@ def transform_quantile( probs: Optional[list[float]] = Undefined, step: Optional[float] = Undefined, ) -> Self: - """Add a :class:`QuantileTransform` to the chart + """ + Add a :class:`QuantileTransform` to the chart. Parameters ---------- @@ -2882,7 +2915,8 @@ def transform_regression( order: Optional[int] = Undefined, params: Optional[bool] = Undefined, ) -> Self: - """Add a :class:`RegressionTransform` to the chart. + """ + Add a :class:`RegressionTransform` to the chart. Parameters ---------- @@ -3090,7 +3124,8 @@ def transform_window( sort: Optional[list[SortField | dict[str, str]]] = Undefined, **kwargs: str, ) -> Self: - """Add a :class:`WindowTransform` to the schema + """ + Add a :class:`WindowTransform` to the schema. Parameters ---------- @@ -3204,7 +3239,8 @@ def display( actions: Optional[bool | dict] = Undefined, **kwargs, ) -> None: - """Display chart in Jupyter notebook or JupyterLab + """ + Display chart in Jupyter notebook or JupyterLab. Parameters are passed as options to vega-embed within supported frontends. See https://github.com/vega/vega-embed#options for details. @@ -3300,7 +3336,7 @@ def serve( ) def show(self) -> None: - """Display the chart using the active renderer""" + """Display the chart using the active renderer.""" if renderers.active == "browser": # Opens browser window as side-effect. # We use a special case here so that IPython is not required @@ -3313,7 +3349,7 @@ def show(self) -> None: @utils.use_signature(core.Resolve) def _set_resolve(self, **kwargs): - """Copy the chart and update the resolve property with kwargs""" + """Copy the chart and update the resolve property with kwargs.""" if not hasattr(self, "resolve"): msg = f"{self.__class__} object has no attribute " "'resolve'" raise ValueError(msg) @@ -3355,7 +3391,8 @@ def facet( columns: Optional[int] = Undefined, **kwargs, ) -> FacetChart: - """Create a facet chart from the current chart. + """ + Create a facet chart from the current chart. Faceted charts require data to be specified at the top level; if data is not specified, the data from the current chart will be used at the @@ -3415,7 +3452,8 @@ def facet( class Chart( TopLevelMixin, _EncodingMixin, mixins.MarkMethodMixin, core.TopLevelUnitSpec ): - """Create a basic Altair/Vega-Lite chart. + """ + Create a basic Altair/Vega-Lite chart. Although it is possible to set all Chart properties as constructor attributes, it is more idiomatic to use methods such as ``mark_point()``, ``encode()``, @@ -3503,7 +3541,8 @@ def _get_name(cls) -> str: def from_dict( cls: type[_TSchemaBase], dct: dict[str, Any], validate: bool = True ) -> _TSchemaBase: - """Construct class from a dictionary representation + """ + Construct class from a dictionary representation. Parameters ---------- @@ -3541,7 +3580,8 @@ def to_dict( ignore: list[str] | None = None, context: dict[str, Any] | None = None, ) -> dict: - """Convert the chart to a dictionary suitable for JSON export + """ + Convert the chart to a dictionary suitable for JSON export. Parameters ---------- @@ -3585,7 +3625,8 @@ def to_dict( def transformed_data( self, row_limit: int | None = None, exclude: Iterable[str] | None = None ) -> DataFrameLike | None: - """Evaluate a Chart's transforms + """ + Evaluate a Chart's transforms. Evaluate the data transforms associated with a Chart and return the transformed data a DataFrame @@ -3626,7 +3667,8 @@ def add_selection(self, *params) -> Self: def interactive( self, name: str | None = None, bind_x: bool = True, bind_y: bool = True ) -> Self: - """Make chart axes scales interactive + """ + Make chart axes scales interactive. Parameters ---------- @@ -3663,7 +3705,8 @@ def _check_if_valid_subspec( "VConcatChart", ], ) -> None: - """Check if the spec is a valid sub-spec. + """ + Check if the spec is a valid sub-spec. If it is not, then raise a ValueError """ @@ -3723,7 +3766,7 @@ def _get_any(spec: dict | SchemaBase, *attrs: str) -> bool: class RepeatChart(TopLevelMixin, core.TopLevelRepeatSpec): - """A chart repeated across rows and columns with small changes""" + """A chart repeated across rows and columns with small changes.""" # Because TopLevelRepeatSpec is defined as a union as of Vega-Lite schema 4.9, # we set the arguments explicitly here. @@ -3786,7 +3829,8 @@ def __init__( def transformed_data( self, row_limit: int | None = None, exclude: Iterable[str] | None = None ) -> DataFrameLike | None: - """Evaluate a RepeatChart's transforms + """ + Evaluate a RepeatChart's transforms. Evaluate the data transforms associated with a RepeatChart and return the transformed data a DataFrame @@ -3809,7 +3853,8 @@ def transformed_data( def interactive( self, name: str | None = None, bind_x: bool = True, bind_y: bool = True ) -> Self: - """Make chart axes scales interactive + """ + Make chart axes scales interactive. Parameters ---------- @@ -3848,7 +3893,8 @@ def add_selection(self, *selections) -> Self: def repeat( repeater: Literal["row", "column", "repeat", "layer"] = "repeat", ) -> RepeatRef: - """Tie a channel to the row or column within a repeated chart + """ + Tie a channel to the row or column within a repeated chart. The output of this should be passed to the ``field`` attribute of a channel. @@ -3869,7 +3915,7 @@ def repeat( class ConcatChart(TopLevelMixin, core.TopLevelConcatSpec): - """A chart with horizontally-concatenated facets""" + """A chart with horizontally-concatenated facets.""" @utils.use_signature(core.TopLevelConcatSpec) def __init__(self, data=Undefined, concat=(), columns=Undefined, **kwargs): @@ -3895,7 +3941,8 @@ def __or__(self, other) -> Self: def transformed_data( self, row_limit: int | None = None, exclude: Iterable[str] | None = None ) -> list[DataFrameLike]: - """Evaluate a ConcatChart's transforms + """ + Evaluate a ConcatChart's transforms. Evaluate the data transforms associated with a ConcatChart and return the transformed data for each subplot as a list of DataFrames @@ -3919,7 +3966,8 @@ def transformed_data( def interactive( self, name: str | None = None, bind_x: bool = True, bind_y: bool = True ) -> Self: - """Make chart axes scales interactive + """ + Make chart axes scales interactive. Parameters ---------- @@ -3959,12 +4007,12 @@ def add_selection(self, *selections) -> Self: def concat(*charts, **kwargs) -> ConcatChart: - """Concatenate charts horizontally""" + """Concatenate charts horizontally.""" return ConcatChart(concat=charts, **kwargs) # pyright: ignore class HConcatChart(TopLevelMixin, core.TopLevelHConcatSpec): - """A chart with horizontally-concatenated facets""" + """A chart with horizontally-concatenated facets.""" @utils.use_signature(core.TopLevelHConcatSpec) def __init__(self, data=Undefined, hconcat=(), **kwargs): @@ -3990,7 +4038,8 @@ def __or__(self, other) -> Self: def transformed_data( self, row_limit: int | None = None, exclude: Iterable[str] | None = None ) -> list[DataFrameLike]: - """Evaluate a HConcatChart's transforms + """ + Evaluate a HConcatChart's transforms. Evaluate the data transforms associated with a HConcatChart and return the transformed data for each subplot as a list of DataFrames @@ -4014,7 +4063,8 @@ def transformed_data( def interactive( self, name: str | None = None, bind_x: bool = True, bind_y: bool = True ) -> Self: - """Make chart axes scales interactive + """ + Make chart axes scales interactive. Parameters ---------- @@ -4054,12 +4104,12 @@ def add_selection(self, *selections) -> Self: def hconcat(*charts, **kwargs) -> HConcatChart: - """Concatenate charts horizontally""" + """Concatenate charts horizontally.""" return HConcatChart(hconcat=charts, **kwargs) # pyright: ignore class VConcatChart(TopLevelMixin, core.TopLevelVConcatSpec): - """A chart with vertically-concatenated facets""" + """A chart with vertically-concatenated facets.""" @utils.use_signature(core.TopLevelVConcatSpec) def __init__(self, data=Undefined, vconcat=(), **kwargs): @@ -4087,7 +4137,8 @@ def transformed_data( row_limit: int | None = None, exclude: Iterable[str] | None = None, ) -> list[DataFrameLike]: - """Evaluate a VConcatChart's transforms + """ + Evaluate a VConcatChart's transforms. Evaluate the data transforms associated with a VConcatChart and return the transformed data for each subplot as a list of DataFrames @@ -4111,7 +4162,8 @@ def transformed_data( def interactive( self, name: str | None = None, bind_x: bool = True, bind_y: bool = True ) -> Self: - """Make chart axes scales interactive + """ + Make chart axes scales interactive. Parameters ---------- @@ -4151,12 +4203,12 @@ def add_selection(self, *selections) -> Self: def vconcat(*charts, **kwargs) -> VConcatChart: - """Concatenate charts vertically""" + """Concatenate charts vertically.""" return VConcatChart(vconcat=charts, **kwargs) # pyright: ignore class LayerChart(TopLevelMixin, _EncodingMixin, core.TopLevelLayerSpec): - """A Chart with layers within a single panel""" + """A Chart with layers within a single panel.""" @utils.use_signature(core.TopLevelLayerSpec) def __init__(self, data=Undefined, layer=(), **kwargs): @@ -4183,7 +4235,8 @@ def transformed_data( row_limit: int | None = None, exclude: Iterable[str] | None = None, ) -> list[DataFrameLike]: - """Evaluate a LayerChart's transforms + """ + Evaluate a LayerChart's transforms. Evaluate the data transforms associated with a LayerChart and return the transformed data for each layer as a list of DataFrames @@ -4226,7 +4279,8 @@ def add_layers(self, *layers: LayerChart | Chart) -> Self: def interactive( self, name: str | None = None, bind_x: bool = True, bind_y: bool = True ) -> Self: - """Make chart axes scales interactive + """ + Make chart axes scales interactive. Parameters ---------- @@ -4268,12 +4322,12 @@ def add_selection(self, *selections) -> Self: def layer(*charts, **kwargs) -> LayerChart: - """layer multiple charts""" + """Layer multiple charts.""" return LayerChart(layer=charts, **kwargs) # pyright: ignore class FacetChart(TopLevelMixin, core.TopLevelFacetSpec): - """A Chart with layers within a single panel""" + """A Chart with layers within a single panel.""" @utils.use_signature(core.TopLevelFacetSpec) def __init__( @@ -4293,7 +4347,8 @@ def __init__( def transformed_data( self, row_limit: int | None = None, exclude: Iterable[str] | None = None ) -> DataFrameLike | None: - """Evaluate a FacetChart's transforms + """ + Evaluate a FacetChart's transforms. Evaluate the data transforms associated with a FacetChart and return the transformed data a DataFrame @@ -4317,7 +4372,8 @@ def transformed_data( def interactive( self, name: str | None = None, bind_x: bool = True, bind_y: bool = True ) -> Self: - """Make chart axes scales interactive + """ + Make chart axes scales interactive. Parameters ---------- @@ -4354,7 +4410,8 @@ def add_selection(self, *selections) -> Self: def topo_feature(url: str, feature: str, **kwargs) -> UrlData: - """A convenience function for extracting features from a topojson url + """ + A convenience function for extracting features from a topojson url. Parameters ---------- @@ -4670,7 +4727,8 @@ def sphere() -> SphereGenerator: def is_chart_type(obj: Any) -> TypeIs[ChartType]: - """Return `True` if the object is an Altair chart. This can be a basic chart + """ + Return `True` if the object is an Altair chart. This can be a basic chart but also a repeat, concat, or facet chart. """ return isinstance( diff --git a/altair/vegalite/v5/compiler.py b/altair/vegalite/v5/compiler.py index 4a892e6ed..b01ee4187 100644 --- a/altair/vegalite/v5/compiler.py +++ b/altair/vegalite/v5/compiler.py @@ -9,9 +9,7 @@ def vl_convert_compiler(vegalite_spec: dict) -> dict: - """ - Vega-Lite to Vega compiler that uses vl-convert - """ + """Vega-Lite to Vega compiler that uses vl-convert.""" from . import SCHEMA_VERSION vlc = import_vl_convert() diff --git a/altair/vegalite/v5/display.py b/altair/vegalite/v5/display.py index 0f066597c..f6a85835c 100644 --- a/altair/vegalite/v5/display.py +++ b/altair/vegalite/v5/display.py @@ -89,7 +89,7 @@ def svg_renderer(spec: dict, **metadata) -> dict[str, str]: def jupyter_renderer(spec: dict, **metadata): - """Render chart using the JupyterChart Jupyter Widget""" + """Render chart using the JupyterChart Jupyter Widget.""" from altair import Chart, JupyterChart # Configure offline mode @@ -165,12 +165,13 @@ class VegaLite(Displayable): def vegalite(spec: dict, validate: bool = True) -> None: - """Render and optionally validate a VegaLite 5 spec. + """ + Render and optionally validate a VegaLite 5 spec. This will use the currently enabled renderer to render the spec. Parameters - ========== + ---------- spec: dict A fully compliant VegaLite 5 spec, with the data portion fully processed. validate: bool diff --git a/altair/vegalite/v5/theme.py b/altair/vegalite/v5/theme.py index 41af1a252..0b0273629 100644 --- a/altair/vegalite/v5/theme.py +++ b/altair/vegalite/v5/theme.py @@ -1,4 +1,4 @@ -"""Tools for enabling and registering chart themes""" +"""Tools for enabling and registering chart themes.""" from __future__ import annotations from typing import Final diff --git a/pyproject.toml b/pyproject.toml index 3363e85a2..5a6b3616d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -359,9 +359,9 @@ mccabe={ max-complexity=18 } # https://docs.astral.sh/ruff/settings/#lint_flake8-tidy-imports_banned-api "typing.Optional".msg = "Use `Union[T, None]` instead.\n`typing.Optional` is likely to be confused with `altair.Optional`, which have a similar but different semantic meaning.\nSee https://github.com/vega/altair/pull/3449" -[tool.ruff.lint.per-file-ignores] +# [tool.ruff.lint.per-file-ignores] # Ignore `D` rules everywhere *except* for auto-generated code. -"!altair/vegalite/v5/schema/*.py" = ["D","D213"] +# "!altair/vegalite/v5/schema/*.py" = ["D","D213"] [tool.ruff.format] diff --git a/sphinxext/altairgallery.py b/sphinxext/altairgallery.py index a17eeb28e..4ce2ab629 100644 --- a/sphinxext/altairgallery.py +++ b/sphinxext/altairgallery.py @@ -157,7 +157,7 @@ def save_example_pngs( examples: list[dict[str, Any]], image_dir: Path, make_thumbnails: bool = True ) -> None: - """Save example pngs and (optionally) thumbnails""" + """Save example pngs and (optionally) thumbnails.""" encoding = "utf-8" # store hashes so that we know whether images need to be generated @@ -210,8 +210,7 @@ def save_example_pngs( def populate_examples(**kwds: Any) -> list[dict[str, Any]]: - """Iterate through Altair examples and extract code""" - + """Iterate through Altair examples and extract code.""" examples = sorted(iter_examples_arguments_syntax(), key=itemgetter("name")) method_examples = {x["name"]: x for x in iter_examples_methods_syntax()} diff --git a/sphinxext/schematable.py b/sphinxext/schematable.py index 484baf29a..04d69ef6f 100644 --- a/sphinxext/schematable.py +++ b/sphinxext/schematable.py @@ -13,7 +13,7 @@ def type_description(schema: dict[str, Any]) -> str: - """Return a concise type description for the given schema""" + """Return a concise type description for the given schema.""" if not schema or not isinstance(schema, dict) or schema.keys() == {"description"}: return "any" elif "$ref" in schema: @@ -44,7 +44,7 @@ def type_description(schema: dict[str, Any]) -> str: def prepare_table_header( titles: Sequence[str], widths: Sequence[float] ) -> tuple[nodes.table, nodes.tbody]: - """Build docutil empty table""" + """Build docutil empty table.""" ncols = len(titles) assert len(widths) == ncols @@ -67,8 +67,7 @@ def prepare_table_header( def add_class_def(node: nodes.paragraph, classDef: str) -> nodes.paragraph: - """Add reference on classDef to node""" - + """Add reference on classDef to node.""" ref = addnodes.pending_xref( reftarget=classDef, reftype="class", @@ -86,7 +85,7 @@ def add_class_def(node: nodes.paragraph, classDef: str) -> nodes.paragraph: def add_text(node: nodes.paragraph, text: str) -> nodes.paragraph: - """Add text with inline code to node""" + """Add text with inline code to node.""" is_text = True for part in reCode.split(text): if part: @@ -103,8 +102,7 @@ def add_text(node: nodes.paragraph, text: str) -> nodes.paragraph: def build_row( item: tuple[str, dict[str, Any]], rootschema: dict[str, Any] | None ) -> nodes.row: - """Return nodes.row with property description""" - + """Return nodes.row with property description.""" prop, propschema, _ = item row = nodes.row() @@ -150,7 +148,7 @@ def build_row( def build_schema_table( items: Iterator[tuple[str, dict[str, Any]]], rootschema: dict[str, Any] | None ) -> nodes.table: - """Return schema table of items (iterator of prop, schema.item, required)""" + """Return schema table of items (iterator of prop, schema.item, required).""" table, tbody = prepare_table_header( ["Property", "Type", "Description"], [10, 20, 50] ) @@ -163,7 +161,7 @@ def build_schema_table( def select_items_from_schema( schema: dict[str, Any], props: list[str] | None = None ) -> Iterator[tuple[Any, Any, bool] | tuple[str, Any, bool]]: - """Return iterator (prop, schema.item, required) on prop, return all in None""" + """Return iterator (prop, schema.item, required) on prop, return all in None.""" properties = schema.get("properties", {}) required = schema.get("required", []) if not props: diff --git a/sphinxext/utils.py b/sphinxext/utils.py index 51c4f05d6..5851fe5e6 100644 --- a/sphinxext/utils.py +++ b/sphinxext/utils.py @@ -14,7 +14,7 @@ def create_thumbnail( thumb_filename: Path, window_size: tuple[float, float] = (280, 160), ) -> None: - """Create a thumbnail whose shortest dimension matches the window""" + """Create a thumbnail whose shortest dimension matches the window.""" from PIL import Image im = Image.open(image_filename) @@ -37,7 +37,7 @@ def create_thumbnail( def create_generic_image( filename: Path, shape: tuple[float, float] = (200, 300), gradient: bool = True ) -> None: - """Create a generic image""" + """Create a generic image.""" from PIL import Image import numpy as np @@ -59,7 +59,8 @@ def create_generic_image( def _parse_source_file(filename: str) -> tuple[ast.Module | None, str]: - """Parse source file into AST node + """ + Parse source file into AST node. Parameters ---------- @@ -88,7 +89,8 @@ def _parse_source_file(filename: str) -> tuple[ast.Module | None, str]: def get_docstring_and_rest(filename: str) -> tuple[str, str | None, str, int]: - """Separate ``filename`` content between docstring and the rest + """ + Separate ``filename`` content between docstring and the rest. Strongly inspired from ast.get_docstring. @@ -190,14 +192,14 @@ def get_docstring_and_rest(filename: str) -> tuple[str, str | None, str, int]: def prev_this_next( it: list[dict[str, Any]], sentinel: None = None ) -> zip[tuple[dict[str, Any] | None, dict[str, Any], dict[str, Any] | None]]: - """Utility to return (prev, this, next) tuples from an iterator""" + """Utility to return (prev, this, next) tuples from an iterator.""" i1, i2, i3 = itertools.tee(it, 3) next(i3, None) return zip(itertools.chain([sentinel], i1), i2, itertools.chain(i3, [sentinel])) def dict_hash(dct: dict[Any, Any]) -> Any: - """Return a hash of the contents of a dictionary""" + """Return a hash of the contents of a dictionary.""" serialized = json.dumps(dct, sort_keys=True) try: diff --git a/tests/expr/test_expr.py b/tests/expr/test_expr.py index 248fe859d..bd3b0d9f9 100644 --- a/tests/expr/test_expr.py +++ b/tests/expr/test_expr.py @@ -88,7 +88,7 @@ def test_abs(): @pytest.mark.parametrize(("veganame", "methodname"), _remap_classmethod_names(expr)) def test_expr_funcs(veganame: str, methodname: str): - """test all functions defined in expr.funcs""" + """Test all functions defined in expr.funcs.""" func = getattr(expr, methodname) z = func(datum.xxx) assert repr(z) == f"{veganame}(datum.xxx)" @@ -96,8 +96,7 @@ def test_expr_funcs(veganame: str, methodname: str): @pytest.mark.parametrize("constname", _get_property_names(_ConstExpressionType)) def test_expr_consts(constname: str): - """Test all constants defined in expr.consts""" - + """Test all constants defined in expr.consts.""" const = getattr(expr, constname) z = const * datum.xxx assert repr(z) == f"({constname} * datum.xxx)" @@ -117,7 +116,7 @@ def test_expr_consts_immutable(constname: str): def test_json_reprs(): - """Test JSON representations of special values""" + """Test JSON representations of special values.""" assert repr(datum.xxx == None) == "(datum.xxx === null)" # noqa: E711 assert repr(datum.xxx == False) == "(datum.xxx === false)" # noqa: E712 assert repr(datum.xxx == True) == "(datum.xxx === true)" # noqa: E712 diff --git a/tests/test_examples.py b/tests/test_examples.py index 4a449499b..d79dce75c 100644 --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -1,4 +1,5 @@ -"""This module dominates the testing time. +""" +This module dominates the testing time. TODO ---- @@ -69,7 +70,8 @@ def _distributed_examples() -> Iterator[tuple[Any, str]]: def id_func(val) -> str: - """Ensures the generated test-id name uses only `filename` and not `source`. + """ + Ensures the generated test-id name uses only `filename` and not `source`. Without this, the name is repr(source code)-filename """ @@ -105,7 +107,8 @@ def test_render_examples_to_chart(source, filename) -> None: ) @pytest.mark.parametrize(("source", "filename"), distributed_examples, ids=id_func) def test_from_and_to_json_roundtrip(source, filename) -> None: - """Tests if the to_json and from_json (and by extension to_dict and from_dict) + """ + Tests if the to_json and from_json (and by extension to_dict and from_dict) work for all examples in the Example Gallery. """ chart = eval_block(source) diff --git a/tests/utils/test_data.py b/tests/utils/test_data.py index f58fc9f10..4a5c817fd 100644 --- a/tests/utils/test_data.py +++ b/tests/utils/test_data.py @@ -87,9 +87,10 @@ def test_type_error(): def test_dataframe_to_json(): - """Test to_json + """ + Test to_json - make certain the filename is deterministic - - make certain the file contents match the data + - make certain the file contents match the data. """ data = _create_dataframe(10) try: @@ -105,9 +106,10 @@ def test_dataframe_to_json(): def test_dict_to_json(): - """Test to_json + """ + Test to_json - make certain the filename is deterministic - - make certain the file contents match the data + - make certain the file contents match the data. """ data = _create_data_with_values(10) try: @@ -123,9 +125,10 @@ def test_dict_to_json(): def test_dataframe_to_csv(): - """Test to_csv with dataframe input + """ + Test to_csv with dataframe input - make certain the filename is deterministic - - make certain the file contents match the data + - make certain the file contents match the data. """ data = _create_dataframe(10) try: @@ -141,9 +144,10 @@ def test_dataframe_to_csv(): def test_dict_to_csv(): - """Test to_csv with dict input + """ + Test to_csv with dict input - make certain the filename is deterministic - - make certain the file contents match the data + - make certain the file contents match the data. """ data = _create_data_with_values(10) try: diff --git a/tests/utils/test_server.py b/tests/utils/test_server.py index 09129e9c4..6f72cff29 100644 --- a/tests/utils/test_server.py +++ b/tests/utils/test_server.py @@ -1,6 +1,4 @@ -""" -Test http server -""" +"""Test http server.""" from altair.utils.server import serve, MockServer diff --git a/tests/utils/test_to_values_narwhals.py b/tests/utils/test_to_values_narwhals.py index 3e7977d18..c636b7aea 100644 --- a/tests/utils/test_to_values_narwhals.py +++ b/tests/utils/test_to_values_narwhals.py @@ -15,7 +15,7 @@ def windows_has_tzdata(): """ - From PyArrow: python/pyarrow/tests/util.py + From PyArrow: python/pyarrow/tests/util.py. This is the default location where tz.cpp will look for (until we make this configurable at run-time) @@ -31,7 +31,7 @@ def windows_has_tzdata(): ) @pytest.mark.skipif(pa is None, reason="pyarrow not installed") def test_arrow_timestamp_conversion(): - """Test that arrow timestamp values are converted to ISO-8601 strings""" + """Test that arrow timestamp values are converted to ISO-8601 strings.""" data = { "date": [datetime(2004, 8, 1), datetime(2004, 9, 1), None], "value": [102, 129, 139], diff --git a/tests/vegalite/test_common.py b/tests/vegalite/test_common.py index 2c043f47f..997231b74 100644 --- a/tests/vegalite/test_common.py +++ b/tests/vegalite/test_common.py @@ -1,4 +1,4 @@ -"""Tests of functionality that should work in all vegalite versions""" +"""Tests of functionality that should work in all vegalite versions.""" import pytest diff --git a/tests/vegalite/v5/test_api.py b/tests/vegalite/v5/test_api.py index 92441f955..043fe6768 100644 --- a/tests/vegalite/v5/test_api.py +++ b/tests/vegalite/v5/test_api.py @@ -1,4 +1,4 @@ -"""Unit tests for altair API""" +"""Unit tests for altair API.""" from __future__ import annotations @@ -410,7 +410,6 @@ def test_when_then() -> None: def test_when_then_only(basic_chart) -> None: """`Then` is an acceptable encode argument.""" - select = alt.selection_point(name="select", on="click") basic_chart.encode(fillOpacity=alt.when(select).then(alt.value(5))).to_dict() @@ -435,7 +434,6 @@ def test_when_then_otherwise() -> None: def test_when_then_when_then_otherwise() -> None: """Test for [#3301](https://github.com/vega/altair/issues/3301).""" - data = { "values": [ {"a": "A", "b": 28}, @@ -483,7 +481,7 @@ def test_when_then_when_then_otherwise() -> None: def test_when_multi_channel_param(cars): - """Adapted from [2236376458](https://github.com/vega/altair/pull/3427#issuecomment-2236376458)""" + """Adapted from [2236376458](https://github.com/vega/altair/pull/3427#issuecomment-2236376458).""" brush = alt.selection_interval() hover = alt.selection_point(on="pointerover", nearest=True, empty=False) @@ -522,7 +520,8 @@ def test_when_multi_channel_param(cars): def test_when_labels_position_based_on_condition() -> None: - """Test for [2144026368-1](https://github.com/vega/altair/pull/3427#issuecomment-2144026368) + """ + Test for [2144026368-1](https://github.com/vega/altair/pull/3427#issuecomment-2144026368). Original [labels-position-based-on-condition](https://altair-viz.github.io/user_guide/marks/text.html#labels-position-based-on-condition) """ @@ -575,7 +574,8 @@ def test_when_labels_position_based_on_condition() -> None: def test_when_expressions_inside_parameters() -> None: - """Test for [2144026368-2](https://github.com/vega/altair/pull/3427#issuecomment-2144026368) + """ + Test for [2144026368-2](https://github.com/vega/altair/pull/3427#issuecomment-2144026368). Original [expressions-inside-parameters](https://altair-viz.github.io/user_guide/interactions.html#expressions-inside-parameters) """ diff --git a/tests/vegalite/v5/test_display.py b/tests/vegalite/v5/test_display.py index 636d05402..2f45a3db0 100644 --- a/tests/vegalite/v5/test_display.py +++ b/tests/vegalite/v5/test_display.py @@ -9,7 +9,7 @@ def check_render_options(**options): """ Context manager that will assert that alt.renderers.options are equivalent - to the given options in the IPython.display.display call + to the given options in the IPython.display.display call. """ import IPython.display diff --git a/tests/vegalite/v5/test_params.py b/tests/vegalite/v5/test_params.py index b88d3fb36..da3c85f8e 100644 --- a/tests/vegalite/v5/test_params.py +++ b/tests/vegalite/v5/test_params.py @@ -1,4 +1,4 @@ -"""Tests for variable parameters and selection parameters""" +"""Tests for variable parameters and selection parameters.""" import pandas as pd diff --git a/tests/vegalite/v5/test_renderers.py b/tests/vegalite/v5/test_renderers.py index b84aa9796..0b02ef214 100644 --- a/tests/vegalite/v5/test_renderers.py +++ b/tests/vegalite/v5/test_renderers.py @@ -1,4 +1,4 @@ -"""Tests of various renderers""" +"""Tests of various renderers.""" import json @@ -25,7 +25,7 @@ def chart(): def test_html_renderer_embed_options(chart, renderer="html"): - """Test that embed_options in renderer metadata are correctly manifest in html""" + """Test that embed_options in renderer metadata are correctly manifest in html.""" # Short of parsing the javascript, it's difficult to parse out the # actions. So we use string matching @@ -61,7 +61,7 @@ def test_mimetype_renderer_embed_options(chart, renderer="mimetype"): def test_json_renderer_embed_options(chart, renderer="json"): - """Test that embed_options in renderer metadata are correctly manifest in html""" + """Test that embed_options in renderer metadata are correctly manifest in html.""" mimetype = "application/json" spec = chart.to_dict() with alt.renderers.enable(renderer): @@ -97,7 +97,7 @@ def test_renderer_with_none_embed_options(chart, renderer="mimetype"): @pytest.mark.filterwarnings("ignore:Deprecated in traitlets 4.1.*:DeprecationWarning") def test_jupyter_renderer_mimetype(chart, renderer="jupyter") -> None: - """Test that we get the expected widget mimetype when the jupyter renderer is enabled""" + """Test that we get the expected widget mimetype when the jupyter renderer is enabled.""" if not anywidget: pytest.skip("anywidget not importable; skipping test") diff --git a/tools/generate_schema_wrapper.py b/tools/generate_schema_wrapper.py index 490d15a8f..4c56efa4c 100644 --- a/tools/generate_schema_wrapper.py +++ b/tools/generate_schema_wrapper.py @@ -1,4 +1,4 @@ -"""Generate a schema wrapper from a schema""" +"""Generate a schema wrapper from a schema.""" from __future__ import annotations import argparse @@ -403,9 +403,7 @@ def _add_shorthand_property_to_field_encodings(schema: dict) -> dict: def copy_schemapi_util() -> None: - """ - Copy the schemapi utility into altair/utils/ and its test file to tests/utils/ - """ + """Copy the schemapi utility into altair/utils/ and its test file to tests/utils/.""" # copy the schemapi utility file source_fp = Path(__file__).parent / "schemapi" / "schemapi.py" destination_fp = Path(__file__).parent / ".." / "altair" / "utils" / "schemapi.py" @@ -452,7 +450,8 @@ def get_field_datum_value_defs(propschema: SchemaInfo, root: dict) -> dict[str, def toposort(graph: dict[str, list[str]]) -> list[str]: - """Topological sort of a directed acyclic graph. + """ + Topological sort of a directed acyclic graph. Parameters ---------- diff --git a/tools/schemapi/__init__.py b/tools/schemapi/__init__.py index 58b90a73f..394d5f9b6 100644 --- a/tools/schemapi/__init__.py +++ b/tools/schemapi/__init__.py @@ -1,6 +1,4 @@ -""" -schemapi: tools for generating Python APIs from JSON schemas -""" +"""schemapi: tools for generating Python APIs from JSON schemas.""" from tools.schemapi.schemapi import SchemaBase, Undefined from tools.schemapi.utils import SchemaInfo diff --git a/tools/schemapi/codegen.py b/tools/schemapi/codegen.py index 8f2fb1d4c..a0e632f56 100644 --- a/tools/schemapi/codegen.py +++ b/tools/schemapi/codegen.py @@ -1,4 +1,4 @@ -"""Code generation utilities""" +"""Code generation utilities.""" from __future__ import annotations import re @@ -16,7 +16,7 @@ class CodeSnippet: - """Object whose repr() is a string of code""" + """Object whose repr() is a string of code.""" def __init__(self, code: str): self.code = code @@ -35,7 +35,7 @@ class ArgInfo: def get_args(info: SchemaInfo) -> ArgInfo: - """Return the list of args & kwds for building the __init__ function""" + """Return the list of args & kwds for building the __init__ function.""" # TODO: - set additional properties correctly # - handle patternProperties etc. required: set[str] = set() @@ -83,7 +83,8 @@ def get_args(info: SchemaInfo) -> ArgInfo: class SchemaGenerator: - """Class that defines methods for generating code from schemas + """ + Class that defines methods for generating code from schemas. Parameters ---------- @@ -159,7 +160,7 @@ def subclasses(self) -> list[str]: return [child.refname for child in info.anyOf if child.is_reference()] def schema_class(self) -> str: - """Generate code for a schema class""" + """Generate code for a schema class.""" rootschema: dict = ( self.rootschema if self.rootschema is not None else self.schema ) @@ -237,7 +238,7 @@ def docstring(self, indent: int = 0) -> str: return indent_docstring(doc, indent_level=indent, width=100, lstrip=True) def init_code(self, indent: int = 0) -> str: - """Return code suitable for the __init__ function of a Schema class""" + """Return code suitable for the __init__ function of a Schema class.""" args, super_args = self.init_args() initfunc = self.init_template.format( @@ -380,7 +381,7 @@ def _get_signature_any_of( return list(flatten(signatures)) def method_code(self, indent: int = 0) -> str | None: - """Return code to assist setter methods""" + """Return code to assist setter methods.""" if not self.haspropsetters: return None args = self.init_kwds diff --git a/tools/schemapi/schemapi.py b/tools/schemapi/schemapi.py index 5bfe39053..b556348e2 100644 --- a/tools/schemapi/schemapi.py +++ b/tools/schemapi/schemapi.py @@ -128,7 +128,8 @@ def validate_jsonschema( *, raise_error=True, ): - """Validates the passed in spec against the schema in the context of the + """ + Validates the passed in spec against the schema in the context of the rootschema. If any errors are found, they are deduplicated and prioritized and only the most relevant errors are kept. Errors are then either raised or returned, depending on the value of `raise_error`. @@ -162,7 +163,8 @@ def _get_errors_from_spec( schema: dict[str, Any], rootschema: dict[str, Any] | None = None, ) -> ValidationErrorList: - """Uses the relevant jsonschema validator to validate the passed in spec + """ + Uses the relevant jsonschema validator to validate the passed in spec against the schema using the rootschema to resolve references. The schema and rootschema themselves are not validated but instead considered as valid. @@ -209,8 +211,10 @@ def _get_json_schema_draft_url(schema: dict[str, Any]) -> str: def _use_referencing_library() -> bool: - """In version 4.18.0, the jsonschema package deprecated RefResolver in - favor of the referencing library.""" + """ + In version 4.18.0, the jsonschema package deprecated RefResolver in + favor of the referencing library. + """ return Version(jsonschema_version_str) >= Version("4.18") @@ -221,7 +225,8 @@ def _prepare_references_in_schema(schema: dict[str, Any]) -> dict[str, Any]: schema = copy.deepcopy(schema) def _prepare_refs(d: dict[str, Any]) -> dict[str, Any]: - """Add _VEGA_LITE_ROOT_URI in front of all $ref values. + """ + Add _VEGA_LITE_ROOT_URI in front of all $ref values. This function recursively iterates through the whole dictionary. @@ -274,10 +279,11 @@ def _get_referencing_registry( def _json_path(err: jsonschema.exceptions.ValidationError) -> str: - """Drop in replacement for the .json_path property of the jsonschema + """ + Drop in replacement for the .json_path property of the jsonschema ValidationError class, which is not available as property for ValidationError with jsonschema<4.0.1. - More info, see https://github.com/vega/altair/issues/3038 + More info, see https://github.com/vega/altair/issues/3038. """ path = "$" for elem in err.absolute_path: @@ -291,7 +297,8 @@ def _json_path(err: jsonschema.exceptions.ValidationError) -> str: def _group_errors_by_json_path( errors: ValidationErrorList, ) -> GroupedValidationErrors: - """Groups errors by the `json_path` attribute of the jsonschema ValidationError + """ + Groups errors by the `json_path` attribute of the jsonschema ValidationError class. This attribute contains the path to the offending element within a chart specification and can therefore be considered as an identifier of an 'issue' in the chart that needs to be fixed. @@ -306,7 +313,8 @@ def _group_errors_by_json_path( def _get_leaves_of_error_tree( errors: ValidationErrorList, ) -> ValidationErrorList: - """For each error in `errors`, it traverses down the "error tree" that is generated + """ + For each error in `errors`, it traverses down the "error tree" that is generated by the jsonschema library to find and return all "leaf" errors. These are errors which have no further errors that caused it and so they are the most specific errors with the most specific error messages. @@ -326,7 +334,8 @@ def _get_leaves_of_error_tree( def _subset_to_most_specific_json_paths( errors_by_json_path: GroupedValidationErrors, ) -> GroupedValidationErrors: - """Removes key (json path), value (errors) pairs where the json path is fully + """ + Removes key (json path), value (errors) pairs where the json path is fully contained in another json path. For example if `errors_by_json_path` has two keys, `$.encoding.X` and `$.encoding.X.tooltip`, then the first one will be removed and only the second one is returned. This is done under the assumption that @@ -350,7 +359,8 @@ def _contained_at_start_of_one_of_other_values(x: str, values: Sequence[str]) -> def _deduplicate_errors( grouped_errors: GroupedValidationErrors, ) -> GroupedValidationErrors: - """Some errors have very similar error messages or are just in general not helpful + """ + Some errors have very similar error messages or are just in general not helpful for a user. This function removes as many of these cases as possible and can be extended over time to handle new cases that come up. """ @@ -389,7 +399,8 @@ def _is_required_value_error(err: jsonschema.exceptions.ValidationError) -> bool def _group_errors_by_validator(errors: ValidationErrorList) -> GroupedValidationErrors: - """Groups the errors by the json schema "validator" that casued the error. For + """ + Groups the errors by the json schema "validator" that casued the error. For example if the error is that a value is not one of an enumeration in the json schema then the "validator" is `"enum"`, if the error is due to an unknown property that was set although no additional properties are allowed then "validator" is @@ -405,7 +416,8 @@ def _group_errors_by_validator(errors: ValidationErrorList) -> GroupedValidation def _deduplicate_enum_errors(errors: ValidationErrorList) -> ValidationErrorList: - """Deduplicate enum errors by removing the errors where the allowed values + """ + Deduplicate enum errors by removing the errors where the allowed values are a subset of another error. For example, if `enum` contains two errors and one has `validator_value` (i.e. accepted values) ["A", "B"] and the other one ["A", "B", "C"] then the first one is removed and the final @@ -427,7 +439,8 @@ def _deduplicate_enum_errors(errors: ValidationErrorList) -> ValidationErrorList def _deduplicate_additional_properties_errors( errors: ValidationErrorList, ) -> ValidationErrorList: - """If there are multiple additional property errors it usually means that + """ + If there are multiple additional property errors it usually means that the offending element was validated against multiple schemas and its parent is a common anyOf validator. The error messages produced from these cases are usually @@ -436,7 +449,7 @@ def _deduplicate_additional_properties_errors( `alt.X("variety", unknown=2)`: - "Additional properties are not allowed ('unknown' was unexpected)" - "Additional properties are not allowed ('field', 'unknown' were unexpected)" - - "Additional properties are not allowed ('field', 'type', 'unknown' were unexpected)" + - "Additional properties are not allowed ('field', 'type', 'unknown' were unexpected)". """ if len(errors) > 1: # Test if all parent errors are the same anyOf error and only do @@ -455,7 +468,8 @@ def _deduplicate_additional_properties_errors( def _deduplicate_by_message(errors: ValidationErrorList) -> ValidationErrorList: - """Deduplicate errors by message. This keeps the original order in case + """ + Deduplicate errors by message. This keeps the original order in case it was chosen intentionally. """ return list({e.message: e for e in errors}.values()) @@ -507,7 +521,8 @@ def _todict(obj: Any, context: dict[str, Any] | None, np_opt: Any, pd_opt: Any) def _resolve_references( schema: dict[str, Any], rootschema: dict[str, Any] | None = None ) -> dict[str, Any]: - """Resolve schema references until there is no $ref anymore + """ + Resolve schema references until there is no $ref anymore in the top-level of the dictionary. """ if _use_referencing_library(): @@ -529,7 +544,7 @@ def _resolve_references( class SchemaValidationError(jsonschema.ValidationError): - """A wrapper for jsonschema.ValidationError with friendlier traceback""" + """A wrapper for jsonschema.ValidationError with friendlier traceback.""" def __init__(self, obj: SchemaBase, err: jsonschema.ValidationError) -> None: super().__init__(**err._contents()) @@ -609,7 +624,8 @@ def _get_additional_properties_error_message( def _get_altair_class_for_error( self, error: jsonschema.exceptions.ValidationError ) -> type[SchemaBase]: - """Try to get the lowest class possible in the chart hierarchy so + """ + Try to get the lowest class possible in the chart hierarchy so it can be displayed in the error message. This should lead to more informative error messages pointing the user closer to the source of the issue. """ @@ -629,7 +645,7 @@ def _get_altair_class_for_error( @staticmethod def _format_params_as_table(param_dict_keys: Iterable[str]) -> str: - """Format param names into a table so that they are easier to read""" + """Format param names into a table so that they are easier to read.""" param_names: tuple[str, ...] name_lengths: tuple[int, ...] param_names, name_lengths = zip( @@ -739,7 +755,7 @@ def _get_default_error_message( class UndefinedType: - """A singleton object for marking undefined parameters""" + """A singleton object for marking undefined parameters.""" __instance = None @@ -786,7 +802,8 @@ def func_2( def is_undefined(obj: Any) -> TypeIs[UndefinedType]: - """Type-safe singleton check for `UndefinedType`. + """ + Type-safe singleton check for `UndefinedType`. Notes ----- @@ -799,7 +816,8 @@ def is_undefined(obj: Any) -> TypeIs[UndefinedType]: class SchemaBase: - """Base class for schema wrappers. + """ + Base class for schema wrappers. Each derived class should set the _schema class attribute (and optionally the _rootschema class attribute) which is used for validation. @@ -837,7 +855,8 @@ def __init__(self, *args: Any, **kwds: Any) -> None: def copy( self, deep: bool | Iterable[Any] = True, ignore: list[str] | None = None ) -> Self: - """Return a copy of the object + """ + Return a copy of the object. Parameters ---------- @@ -954,7 +973,8 @@ def to_dict( ignore: list[str] | None = None, context: dict[str, Any] | None = None, ) -> dict[str, Any]: - """Return a dictionary representation of the object + """ + Return a dictionary representation of the object. Parameters ---------- @@ -1054,7 +1074,8 @@ def to_json( context: dict[str, Any] | None = None, **kwargs, ) -> str: - """Emit the JSON representation for this object as a string. + """ + Emit the JSON representation for this object as a string. Parameters ---------- @@ -1093,14 +1114,15 @@ def to_json( @classmethod def _default_wrapper_classes(cls) -> Iterator[type[SchemaBase]]: - """Return the set of classes used within cls.from_dict()""" + """Return the set of classes used within cls.from_dict().""" return _subclasses(SchemaBase) @classmethod def from_dict( cls: type[TSchemaBase], dct: dict[str, Any], validate: bool = True ) -> TSchemaBase: - """Construct class from a dictionary representation + """ + Construct class from a dictionary representation. Parameters ---------- @@ -1133,7 +1155,8 @@ def from_json( # Type hints for this method would get rather complicated # if we want to provide a more specific return type ) -> ChartType: - """Instantiate the object from a valid JSON string + """ + Instantiate the object from a valid JSON string. Parameters ---------- @@ -1185,7 +1208,7 @@ def validate_property( ) -> None: """ Validate a property against property schema in the context of the - rootschema + rootschema. """ # The following return the package only if it has already been # imported - otherwise they return None. This is useful for @@ -1219,7 +1242,8 @@ def _passthrough(*args: Any, **kwds: Any) -> Any | dict[str, Any]: class _FromDict: - """Class used to construct SchemaBase class hierarchies from a dict + """ + Class used to construct SchemaBase class hierarchies from a dict. The primary purpose of using this class is to be able to build a hash table that maps schemas to their wrapper classes. The candidate classes are @@ -1325,7 +1349,7 @@ def from_dict( rootschema: dict[str, Any] | None = None, default_class: Any = _passthrough, ) -> TSchemaBase: - """Construct an object from a dict representation""" + """Construct an object from a dict representation.""" target_tp: type[TSchemaBase] current_schema: dict[str, Any] if isinstance(dct, SchemaBase): @@ -1424,9 +1448,7 @@ def __call__(self, *args: Any, **kwargs: Any): def with_property_setters(cls: type[TSchemaBase]) -> type[TSchemaBase]: - """ - Decorator to add property setters to a Schema class. - """ + """Decorator to add property setters to a Schema class.""" schema = cls.resolve_references() for prop, propschema in schema.get("properties", {}).items(): setattr(cls, prop, _PropertySetter(prop, propschema)) diff --git a/tools/schemapi/utils.py b/tools/schemapi/utils.py index e504cf299..60e90d53d 100644 --- a/tools/schemapi/utils.py +++ b/tools/schemapi/utils.py @@ -1,4 +1,4 @@ -"""Utilities for working with schemas""" +"""Utilities for working with schemas.""" from __future__ import annotations from itertools import chain @@ -29,7 +29,8 @@ class _TypeAliasTracer: - """Recording all `enum` -> `Literal` translations. + """ + Recording all `enum` -> `Literal` translations. Rewrites as `TypeAlias` to be reused anywhere, and not clog up method definitions. @@ -87,7 +88,8 @@ def _update_literals(self, name: str, tp: str, /) -> None: def add_literal( self, info: SchemaInfo, tp: str, /, *, replace: bool = False ) -> str: - """`replace=True` returns the eventual alias name. + """ + `replace=True` returns the eventual alias name. - Doing so will mean that the `_typing` module must be written first, before the source of `info`. - Otherwise, `ruff` will raise an error during `check`/`format`, as the import will be invalid. @@ -114,7 +116,8 @@ def add_literal( return tp def update_aliases(self, *name_statement: tuple[str, str]) -> None: - """Adds `(name, statement)` pairs to the definitions. + """ + Adds `(name, statement)` pairs to the definitions. These types should support annotations in generated code, but are not required to be derived from the schema itself. @@ -134,7 +137,8 @@ def generate_aliases(self) -> Iterator[str]: yield f"{name}: TypeAlias = {statement}" def is_cached(self, tp: str, /) -> bool: - """Applies to both docstring and type hints. + """ + Applies to both docstring and type hints. Currently used as a sort key, to place literals/aliases last. """ @@ -143,7 +147,8 @@ def is_cached(self, tp: str, /) -> bool: def write_module( self, fp: Path, *extra_all: str, header: LiteralString, extra: LiteralString ) -> None: - """Write all collected `TypeAlias`'s to `fp`. + """ + Write all collected `TypeAlias`'s to `fp`. Parameters ---------- @@ -197,7 +202,8 @@ def get_valid_identifier( allow_unicode: bool = False, url_decode: bool = True, ) -> str: - """Given a string property, generate a valid Python identifier + """ + Given a string property, generate a valid Python identifier. Parameters ---------- @@ -254,7 +260,8 @@ def get_valid_identifier( def is_valid_identifier(var: str, allow_unicode: bool = False): - """Return true if var contains a valid Python identifier + """ + Return true if var contains a valid Python identifier. Parameters ---------- @@ -269,7 +276,7 @@ def is_valid_identifier(var: str, allow_unicode: bool = False): class SchemaProperties: - """A wrapper for properties within a schema""" + """A wrapper for properties within a schema.""" def __init__( self, @@ -313,7 +320,7 @@ def values(self): class SchemaInfo: - """A wrapper for inspecting a JSON schema""" + """A wrapper for inspecting a JSON schema.""" def __init__( self, schema: dict[str, Any], rootschema: dict[str, Any] | None = None @@ -648,7 +655,7 @@ def is_union_enum(self) -> bool: def indent_docstring( lines: list[str], indent_level: int, width: int = 100, lstrip=True ) -> str: - """Indent a docstring for use in generated code""" + """Indent a docstring for use in generated code.""" final_lines = [] for i, line in enumerate(lines): @@ -741,7 +748,8 @@ def rst_syntax_for_class(class_name: str) -> str: def flatten(container: Iterable) -> Iterable: - """Flatten arbitrarily flattened list + """ + Flatten arbitrarily flattened list. From https://stackoverflow.com/a/10824420 """ @@ -772,14 +780,14 @@ def ruff_format_str(code: str | list[str]) -> str: def ruff_format_py(fp: Path, /, *extra_args: str) -> None: - """Format an existing file. + """ + Format an existing file. Running on `win32` after writing lines will ensure "lf" is used before: ```bash ruff format --diff --check . ``` """ - cmd = ["ruff", "format", fp] if extra_args: cmd.extend(extra_args) @@ -790,7 +798,8 @@ def ruff_format_py(fp: Path, /, *extra_args: str) -> None: def ruff_write_lint_format_str( fp: Path, code: str | Iterable[str], /, *, encoding: str = "utf-8" ) -> None: - """Combined steps of writing, `ruff check`, `ruff format`. + """ + Combined steps of writing, `ruff check`, `ruff format`. Notes ----- diff --git a/tools/update_init_file.py b/tools/update_init_file.py index e58cb14dc..03424a15f 100644 --- a/tools/update_init_file.py +++ b/tools/update_init_file.py @@ -41,7 +41,8 @@ def update__all__variable() -> None: - """Updates the __all__ variable to all relevant attributes of top-level Altair. + """ + Updates the __all__ variable to all relevant attributes of top-level Altair. This is for example useful to hide deprecated attributes from code completion in Jupyter. """ @@ -79,7 +80,8 @@ def update__all__variable() -> None: def relevant_attributes(namespace: dict[str, t.Any], /) -> list[str]: - """Figure out which attributes in `__all__` are relevant. + """ + Figure out which attributes in `__all__` are relevant. Returns an alphabetically sorted list, to insert into `__all__`. From 5e374a35e99b4b80a80dc843841a2d3e8d13ccb0 Mon Sep 17 00:00:00 2001 From: dangotbanned <125183946+dangotbanned@users.noreply.github.com> Date: Mon, 22 Jul 2024 18:07:26 +0100 Subject: [PATCH 06/11] docs: Manually fix `pydocstyle` violations *Excluding altair/utils/schemapi.py --- altair/expr/__init__.py | 1 + altair/jupyter/jupyter_chart.py | 19 ++---- altair/utils/_dfi_types.py | 6 +- altair/utils/core.py | 6 +- altair/utils/save.py | 5 +- altair/utils/selection.py | 11 +--- altair/vegalite/v5/api.py | 12 ++-- tests/test_examples.py | 7 ++- tests/utils/test_data.py | 12 ++-- tests/vegalite/v5/test_display.py | 5 +- tools/generate_api_docs.py | 5 +- tools/schemapi/schemapi.py | 96 ++++++++++++++----------------- tools/update_init_file.py | 6 +- 13 files changed, 81 insertions(+), 110 deletions(-) diff --git a/altair/expr/__init__.py b/altair/expr/__init__.py index be9282f88..1f93ac2b7 100644 --- a/altair/expr/__init__.py +++ b/altair/expr/__init__.py @@ -914,6 +914,7 @@ def upper(cls, *args) -> FunctionExpression: def merge(cls, *args) -> FunctionExpression: """ Merges the input objects *object1*, *object2*, etc into a new output object. + Inputs are visited in sequential order, such that key values from later arguments can overwrite those from earlier arguments. Example: `merge({a:1, b:2}, {a:3}) -> {a:3, b:2}`. diff --git a/altair/jupyter/jupyter_chart.py b/altair/jupyter/jupyter_chart.py index 6386848c2..3b1fa07ab 100644 --- a/altair/jupyter/jupyter_chart.py +++ b/altair/jupyter/jupyter_chart.py @@ -74,10 +74,7 @@ def __repr__(self): return f"Selections({self.trait_values()})" def _make_read_only(self, change): - """ - Work around to make traits read-only, but still allow us to change - them internally. - """ + """Work around to make traits read-only, but still allow us to change them internally.""" if change["name"] in self.traits() and change["old"] != change["new"]: self._set_value(change["name"], change["old"]) msg = ( @@ -188,8 +185,7 @@ def __init__( **kwargs: Any, ): """ - Jupyter Widget for displaying and updating Altair Charts, and - retrieving selection and parameter values. + Jupyter Widget for displaying and updating Altair Charts, and retrieving selection and parameter values. Parameters ---------- @@ -221,10 +217,7 @@ def __init__( @traitlets.observe("chart") def _on_change_chart(self, change): - """ - Internal callback function that updates the JupyterChart's internal - state when the wrapped Chart instance changes. - """ + """Updates the JupyterChart's internal state when the wrapped Chart instance changes.""" new_chart = change.new selection_watches = [] selection_types = {} @@ -356,11 +349,7 @@ def _on_change_params(self, change): @traitlets.observe("_vl_selections") def _on_change_selections(self, change): - """ - Internal callback function that updates the JupyterChart's public - selections traitlet in response to changes that the JavaScript logic - makes to the internal _selections traitlet. - """ + """Updates the JupyterChart's public selections traitlet in response to changes that the JavaScript logic makes to the internal _selections traitlet.""" for selection_name, selection_dict in change.new.items(): value = selection_dict["value"] store = selection_dict["store"] diff --git a/altair/utils/_dfi_types.py b/altair/utils/_dfi_types.py index baad12dc7..12b7761f8 100644 --- a/altair/utils/_dfi_types.py +++ b/altair/utils/_dfi_types.py @@ -84,7 +84,8 @@ def dtype(self) -> tuple[Any, int, str, str]: @property def describe_categorical(self) -> Any: """ - If the dtype is categorical, there are two options: + If the dtype is categorical, there are two options. + - There are only values in the data buffer. - There is a separate non-categorical Column encoding categorical values. @@ -105,8 +106,7 @@ def describe_categorical(self) -> Any: class DataFrame(Protocol): """ - A data frame class, with only the methods required by the interchange - protocol defined. + A data frame class, with only the methods required by the interchange protocol defined. A "data frame" represents an ordered collection of named columns. A column's "name" must be a unique string. diff --git a/altair/utils/core.py b/altair/utils/core.py index 012e9552f..028414485 100644 --- a/altair/utils/core.py +++ b/altair/utils/core.py @@ -212,7 +212,8 @@ def infer_vegalite_type_for_pandas( data: object, ) -> InferredVegaLiteType | tuple[InferredVegaLiteType, list[Any]]: """ - From an array-like input, infer the correct vega typecode + From an array-like input, infer the correct vega typecode. + ('ordinal', 'nominal', 'quantitative', or 'temporal'). Parameters @@ -257,7 +258,8 @@ def infer_vegalite_type_for_pandas( def merge_props_geom(feat: dict[str, Any]) -> dict[str, Any]: """ - Merge properties with geometry + Merge properties with geometry. + * Overwrites 'type' and 'geometry' entries if existing. """ geom = {k: feat[k] for k in ("type", "geometry")} diff --git a/altair/utils/save.py b/altair/utils/save.py index 2c5a9d807..be22637c9 100644 --- a/altair/utils/save.py +++ b/altair/utils/save.py @@ -19,10 +19,7 @@ def write_file_or_filename( mode: str = "w", encoding: str | None = None, ) -> None: - """ - Write content to fp, whether fp is a string, a pathlib Path or a - file-like object. - """ + """Write content to fp, whether fp is a string, a pathlib Path or a file-like object.""" if isinstance(fp, (str, pathlib.Path)): with pathlib.Path(fp).open(mode=mode, encoding=encoding) as f: f.write(content) diff --git a/altair/utils/selection.py b/altair/utils/selection.py index fedf4bce0..94a763d40 100644 --- a/altair/utils/selection.py +++ b/altair/utils/selection.py @@ -11,9 +11,7 @@ @dataclass(frozen=True, eq=True) class IndexSelection: """ - An IndexSelection represents the state of an Altair - point selection (as constructed by alt.selection_point()) - when neither the fields nor encodings arguments are specified. + Represents the state of an alt.selection_point() when neither the fields nor encodings arguments are specified. The value field is a list of zero-based indices into the selected dataset. @@ -56,9 +54,7 @@ def from_vega(name: str, signal: dict[str, dict] | None, store: Store): @dataclass(frozen=True, eq=True) class PointSelection: """ - A PointSelection represents the state of an Altair - point selection (as constructed by alt.selection_point()) - when the fields or encodings arguments are specified. + Represents the state of an alt.selection_point() when the fields or encodings arguments are specified. The value field is a list of dicts of the form: [{"dim1": 1, "dim2": "A"}, {"dim1": 2, "dim2": "BB"}] @@ -97,8 +93,7 @@ def from_vega(name: str, signal: dict[str, dict] | None, store: Store): @dataclass(frozen=True, eq=True) class IntervalSelection: """ - An IntervalSelection represents the state of an Altair - interval selection (as constructed by alt.selection_interval()). + Represents the state of an alt.selection_interval(). The value field is a dict of the form: {"dim1": [0, 10], "dim2": ["A", "BB", "CCC"]} diff --git a/altair/vegalite/v5/api.py b/altair/vegalite/v5/api.py index 341c23237..f6c8b6c05 100644 --- a/altair/vegalite/v5/api.py +++ b/altair/vegalite/v5/api.py @@ -1047,8 +1047,8 @@ def param( **kwds, ) -> Parameter: """ - Create a named parameter. - See https://altair-viz.github.io/user_guide/interactions.html for examples. + Create a named parameter, see https://altair-viz.github.io/user_guide/interactions.html for examples. + Although both variable parameters and selection parameters can be created using this 'param' function, to create a selection parameter, it is recommended to use either 'selection_point' or 'selection_interval' instead. @@ -1777,7 +1777,8 @@ def to_html( def to_url(self, *, fullscreen: bool = False) -> str: """ - Convert a chart to a URL that opens the chart specification in the Vega chart editor + Convert a chart to a URL that opens the chart specification in the Vega chart editor. + The chart specification (including any inline data) is encoded in the URL. This method requires that the vl-convert-python package is installed. @@ -4728,8 +4729,9 @@ def sphere() -> SphereGenerator: def is_chart_type(obj: Any) -> TypeIs[ChartType]: """ - Return `True` if the object is an Altair chart. This can be a basic chart - but also a repeat, concat, or facet chart. + Return `True` if the object is an Altair chart. + + This can be a basic chart but also a repeat, concat, or facet chart. """ return isinstance( obj, diff --git a/tests/test_examples.py b/tests/test_examples.py index d79dce75c..be46a885c 100644 --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -1,5 +1,5 @@ """ -This module dominates the testing time. +Note that this module dominates the testing time. TODO ---- @@ -108,8 +108,9 @@ def test_render_examples_to_chart(source, filename) -> None: @pytest.mark.parametrize(("source", "filename"), distributed_examples, ids=id_func) def test_from_and_to_json_roundtrip(source, filename) -> None: """ - Tests if the to_json and from_json (and by extension to_dict and from_dict) - work for all examples in the Example Gallery. + Tests if the to_json and from_json work for all examples in the Example Gallery. + + (and by extension to_dict and from_dict) """ chart = eval_block(source) if chart is None: diff --git a/tests/utils/test_data.py b/tests/utils/test_data.py index 4a5c817fd..0bbba764b 100644 --- a/tests/utils/test_data.py +++ b/tests/utils/test_data.py @@ -88,7 +88,8 @@ def test_type_error(): def test_dataframe_to_json(): """ - Test to_json + Test to_json. + - make certain the filename is deterministic - make certain the file contents match the data. """ @@ -107,7 +108,8 @@ def test_dataframe_to_json(): def test_dict_to_json(): """ - Test to_json + Test to_json. + - make certain the filename is deterministic - make certain the file contents match the data. """ @@ -126,7 +128,8 @@ def test_dict_to_json(): def test_dataframe_to_csv(): """ - Test to_csv with dataframe input + Test to_csv with dataframe input. + - make certain the filename is deterministic - make certain the file contents match the data. """ @@ -145,7 +148,8 @@ def test_dataframe_to_csv(): def test_dict_to_csv(): """ - Test to_csv with dict input + Test to_csv with dict input. + - make certain the filename is deterministic - make certain the file contents match the data. """ diff --git a/tests/vegalite/v5/test_display.py b/tests/vegalite/v5/test_display.py index 2f45a3db0..2a70081fa 100644 --- a/tests/vegalite/v5/test_display.py +++ b/tests/vegalite/v5/test_display.py @@ -7,10 +7,7 @@ @contextmanager def check_render_options(**options): - """ - Context manager that will assert that alt.renderers.options are equivalent - to the given options in the IPython.display.display call. - """ + """Asserts that alt.renderers.options are equivalent to the given options in the IPython.display.display call.""" import IPython.display def check_options(obj): diff --git a/tools/generate_api_docs.py b/tools/generate_api_docs.py index a5757548d..ac4389ae4 100644 --- a/tools/generate_api_docs.py +++ b/tools/generate_api_docs.py @@ -1,7 +1,4 @@ -""" -This script fills the contents of doc/user_guide/api.rst -based on the updated Altair schema. -""" +"""Fills the contents of doc/user_guide/api.rst based on the updated Altair schema.""" from __future__ import annotations from pathlib import Path diff --git a/tools/schemapi/schemapi.py b/tools/schemapi/schemapi.py index b556348e2..43ecdc73f 100644 --- a/tools/schemapi/schemapi.py +++ b/tools/schemapi/schemapi.py @@ -129,8 +129,9 @@ def validate_jsonschema( raise_error=True, ): """ - Validates the passed in spec against the schema in the context of the - rootschema. If any errors are found, they are deduplicated and prioritized + Validates the passed in spec against the schema in the context of the rootschema. + + If any errors are found, they are deduplicated and prioritized and only the most relevant errors are kept. Errors are then either raised or returned, depending on the value of `raise_error`. """ @@ -164,10 +165,9 @@ def _get_errors_from_spec( rootschema: dict[str, Any] | None = None, ) -> ValidationErrorList: """ - Uses the relevant jsonschema validator to validate the passed in spec - against the schema using the rootschema to resolve references. - The schema and rootschema themselves are not validated but instead considered - as valid. + Uses the relevant jsonschema validator to validate the passed in spec against the schema using the rootschema to resolve references. + + The schema and rootschema themselves are not validated but instead considered as valid. """ # We don't use jsonschema.validate as this would validate the schema itself. # Instead, we pass the schema directly to the validator class. This is done for @@ -211,10 +211,7 @@ def _get_json_schema_draft_url(schema: dict[str, Any]) -> str: def _use_referencing_library() -> bool: - """ - In version 4.18.0, the jsonschema package deprecated RefResolver in - favor of the referencing library. - """ + """In version 4.18.0, the jsonschema package deprecated RefResolver in favor of the referencing library.""" return Version(jsonschema_version_str) >= Version("4.18") @@ -280,9 +277,10 @@ def _get_referencing_registry( def _json_path(err: jsonschema.exceptions.ValidationError) -> str: """ - Drop in replacement for the .json_path property of the jsonschema - ValidationError class, which is not available as property for - ValidationError with jsonschema<4.0.1. + Drop in replacement for the .json_path property of the jsonschema ValidationError class. + + This is not available as property for ValidationError with jsonschema<4.0.1. + More info, see https://github.com/vega/altair/issues/3038. """ path = "$" @@ -298,8 +296,9 @@ def _group_errors_by_json_path( errors: ValidationErrorList, ) -> GroupedValidationErrors: """ - Groups errors by the `json_path` attribute of the jsonschema ValidationError - class. This attribute contains the path to the offending element within + Groups errors by the `json_path` attribute of the jsonschema ValidationError class. + + This attribute contains the path to the offending element within a chart specification and can therefore be considered as an identifier of an 'issue' in the chart that needs to be fixed. """ @@ -314,9 +313,9 @@ def _get_leaves_of_error_tree( errors: ValidationErrorList, ) -> ValidationErrorList: """ - For each error in `errors`, it traverses down the "error tree" that is generated - by the jsonschema library to find and return all "leaf" errors. These are errors - which have no further errors that caused it and so they are the most specific errors + For each error in `errors`, it traverses down the "error tree" that is generated by the jsonschema library to find and return all "leaf" errors. + + These are errors which have no further errors that caused it and so they are the most specific errors with the most specific error messages. """ leaves: ValidationErrorList = [] @@ -335,11 +334,12 @@ def _subset_to_most_specific_json_paths( errors_by_json_path: GroupedValidationErrors, ) -> GroupedValidationErrors: """ - Removes key (json path), value (errors) pairs where the json path is fully - contained in another json path. For example if `errors_by_json_path` has two - keys, `$.encoding.X` and `$.encoding.X.tooltip`, then the first one will be removed - and only the second one is returned. This is done under the assumption that - more specific json paths give more helpful error messages to the user. + Removes key (json path), value (errors) pairs where the json path is fully contained in another json path. + + For example if `errors_by_json_path` has two keys, `$.encoding.X` and `$.encoding.X.tooltip`, + then the first one will be removed and only the second one is returned. + + This is done under the assumption that more specific json paths give more helpful error messages to the user. """ errors_by_json_path_specific: GroupedValidationErrors = {} for json_path, errors in errors_by_json_path.items(): @@ -360,8 +360,9 @@ def _deduplicate_errors( grouped_errors: GroupedValidationErrors, ) -> GroupedValidationErrors: """ - Some errors have very similar error messages or are just in general not helpful - for a user. This function removes as many of these cases as possible and + Some errors have very similar error messages or are just in general not helpful for a user. + + This function removes as many of these cases as possible and can be extended over time to handle new cases that come up. """ grouped_errors_deduplicated: GroupedValidationErrors = {} @@ -400,8 +401,9 @@ def _is_required_value_error(err: jsonschema.exceptions.ValidationError) -> bool def _group_errors_by_validator(errors: ValidationErrorList) -> GroupedValidationErrors: """ - Groups the errors by the json schema "validator" that casued the error. For - example if the error is that a value is not one of an enumeration in the json schema + Groups the errors by the json schema "validator" that casued the error. + + For example if the error is that a value is not one of an enumeration in the json schema then the "validator" is `"enum"`, if the error is due to an unknown property that was set although no additional properties are allowed then "validator" is `"additionalProperties`, etc. @@ -417,9 +419,9 @@ def _group_errors_by_validator(errors: ValidationErrorList) -> GroupedValidation def _deduplicate_enum_errors(errors: ValidationErrorList) -> ValidationErrorList: """ - Deduplicate enum errors by removing the errors where the allowed values - are a subset of another error. For example, if `enum` contains two errors - and one has `validator_value` (i.e. accepted values) ["A", "B"] and the + Deduplicate enum errors by removing the errors where the allowed values are a subset of another error. + + For example, if `enum` contains two errors and one has `validator_value` (i.e. accepted values) ["A", "B"] and the other one ["A", "B", "C"] then the first one is removed and the final `enum` list only contains the error with ["A", "B", "C"]. """ @@ -440,9 +442,8 @@ def _deduplicate_additional_properties_errors( errors: ValidationErrorList, ) -> ValidationErrorList: """ - If there are multiple additional property errors it usually means that - the offending element was validated against multiple schemas and - its parent is a common anyOf validator. + If there are multiple additional property errors it usually means that the offending element was validated against multiple schemas and its parent is a common anyOf validator. + The error messages produced from these cases are usually very similar and we just take the shortest one. For example, the following 3 errors are raised for the `unknown` channel option in @@ -468,10 +469,7 @@ def _deduplicate_additional_properties_errors( def _deduplicate_by_message(errors: ValidationErrorList) -> ValidationErrorList: - """ - Deduplicate errors by message. This keeps the original order in case - it was chosen intentionally. - """ + """Deduplicate errors by message. This keeps the original order in case it was chosen intentionally.""" return list({e.message: e for e in errors}.values()) @@ -521,10 +519,7 @@ def _todict(obj: Any, context: dict[str, Any] | None, np_opt: Any, pd_opt: Any) def _resolve_references( schema: dict[str, Any], rootschema: dict[str, Any] | None = None ) -> dict[str, Any]: - """ - Resolve schema references until there is no $ref anymore - in the top-level of the dictionary. - """ + """Resolve schema references until there is no $ref anymore in the top-level of the dictionary.""" if _use_referencing_library(): registry = _get_referencing_registry(rootschema or schema) # Using a different variable name to show that this is not the @@ -625,9 +620,9 @@ def _get_altair_class_for_error( self, error: jsonschema.exceptions.ValidationError ) -> type[SchemaBase]: """ - Try to get the lowest class possible in the chart hierarchy so - it can be displayed in the error message. This should lead to more informative - error messages pointing the user closer to the source of the issue. + Try to get the lowest class possible in the chart hierarchy so it can be displayed in the error message. + + This should lead to more informative error messages pointing the user closer to the source of the issue. """ for prop_name in reversed(error.absolute_path): # Check if str as e.g. first item can be a 0 @@ -1179,10 +1174,7 @@ def from_json( def validate( cls, instance: dict[str, Any], schema: dict[str, Any] | None = None ) -> None: - """ - Validate the instance against the class schema in the context of the - rootschema. - """ + """Validate the instance against the class schema in the context of the rootschema.""" if schema is None: schema = cls._schema # For the benefit of mypy @@ -1206,10 +1198,7 @@ def resolve_references(cls, schema: dict[str, Any] | None = None) -> dict[str, A def validate_property( cls, name: str, value: Any, schema: dict[str, Any] | None = None ) -> None: - """ - Validate a property against property schema in the context of the - rootschema. - """ + """Validate a property against property schema in the context of the rootschema.""" # The following return the package only if it has already been # imported - otherwise they return None. This is useful for # isinstance checks - for example, if pandas has not been imported, @@ -1263,8 +1252,7 @@ def __init__(self, wrapper_classes: Iterable[type[SchemaBase]], /) -> None: @classmethod def hash_schema(cls, schema: dict[str, Any], use_json: bool = True) -> int: """ - Compute a python hash for a nested dictionary which - properly handles dicts, lists, sets, and tuples. + Compute a python hash for a nested dictionary which properly handles dicts, lists, sets, and tuples. At the top level, the function excludes from the hashed schema all keys listed in `exclude_keys`. diff --git a/tools/update_init_file.py b/tools/update_init_file.py index 03424a15f..a1e368571 100644 --- a/tools/update_init_file.py +++ b/tools/update_init_file.py @@ -1,7 +1,4 @@ -""" -This script updates the attribute __all__ in altair/__init__.py -based on the updated Altair schema. -""" +"""Updates the attribute __all__ in altair/__init__.py based on the updated Altair schema.""" from __future__ import annotations @@ -43,6 +40,7 @@ def update__all__variable() -> None: """ Updates the __all__ variable to all relevant attributes of top-level Altair. + This is for example useful to hide deprecated attributes from code completion in Jupyter. """ From f718729f98e362cc5ebe48a9cab6b752a4057f66 Mon Sep 17 00:00:00 2001 From: dangotbanned <125183946+dangotbanned@users.noreply.github.com> Date: Mon, 22 Jul 2024 18:10:18 +0100 Subject: [PATCH 07/11] build: run `generate-schema-wrapper` Propagates `schemapi` fixes --- altair/utils/schemapi.py | 96 ++++++++++++++++++---------------------- 1 file changed, 42 insertions(+), 54 deletions(-) diff --git a/altair/utils/schemapi.py b/altair/utils/schemapi.py index aa8eeb054..7726eef70 100644 --- a/altair/utils/schemapi.py +++ b/altair/utils/schemapi.py @@ -131,8 +131,9 @@ def validate_jsonschema( raise_error=True, ): """ - Validates the passed in spec against the schema in the context of the - rootschema. If any errors are found, they are deduplicated and prioritized + Validates the passed in spec against the schema in the context of the rootschema. + + If any errors are found, they are deduplicated and prioritized and only the most relevant errors are kept. Errors are then either raised or returned, depending on the value of `raise_error`. """ @@ -166,10 +167,9 @@ def _get_errors_from_spec( rootschema: dict[str, Any] | None = None, ) -> ValidationErrorList: """ - Uses the relevant jsonschema validator to validate the passed in spec - against the schema using the rootschema to resolve references. - The schema and rootschema themselves are not validated but instead considered - as valid. + Uses the relevant jsonschema validator to validate the passed in spec against the schema using the rootschema to resolve references. + + The schema and rootschema themselves are not validated but instead considered as valid. """ # We don't use jsonschema.validate as this would validate the schema itself. # Instead, we pass the schema directly to the validator class. This is done for @@ -213,10 +213,7 @@ def _get_json_schema_draft_url(schema: dict[str, Any]) -> str: def _use_referencing_library() -> bool: - """ - In version 4.18.0, the jsonschema package deprecated RefResolver in - favor of the referencing library. - """ + """In version 4.18.0, the jsonschema package deprecated RefResolver in favor of the referencing library.""" return Version(jsonschema_version_str) >= Version("4.18") @@ -282,9 +279,10 @@ def _get_referencing_registry( def _json_path(err: jsonschema.exceptions.ValidationError) -> str: """ - Drop in replacement for the .json_path property of the jsonschema - ValidationError class, which is not available as property for - ValidationError with jsonschema<4.0.1. + Drop in replacement for the .json_path property of the jsonschema ValidationError class. + + This is not available as property for ValidationError with jsonschema<4.0.1. + More info, see https://github.com/vega/altair/issues/3038. """ path = "$" @@ -300,8 +298,9 @@ def _group_errors_by_json_path( errors: ValidationErrorList, ) -> GroupedValidationErrors: """ - Groups errors by the `json_path` attribute of the jsonschema ValidationError - class. This attribute contains the path to the offending element within + Groups errors by the `json_path` attribute of the jsonschema ValidationError class. + + This attribute contains the path to the offending element within a chart specification and can therefore be considered as an identifier of an 'issue' in the chart that needs to be fixed. """ @@ -316,9 +315,9 @@ def _get_leaves_of_error_tree( errors: ValidationErrorList, ) -> ValidationErrorList: """ - For each error in `errors`, it traverses down the "error tree" that is generated - by the jsonschema library to find and return all "leaf" errors. These are errors - which have no further errors that caused it and so they are the most specific errors + For each error in `errors`, it traverses down the "error tree" that is generated by the jsonschema library to find and return all "leaf" errors. + + These are errors which have no further errors that caused it and so they are the most specific errors with the most specific error messages. """ leaves: ValidationErrorList = [] @@ -337,11 +336,12 @@ def _subset_to_most_specific_json_paths( errors_by_json_path: GroupedValidationErrors, ) -> GroupedValidationErrors: """ - Removes key (json path), value (errors) pairs where the json path is fully - contained in another json path. For example if `errors_by_json_path` has two - keys, `$.encoding.X` and `$.encoding.X.tooltip`, then the first one will be removed - and only the second one is returned. This is done under the assumption that - more specific json paths give more helpful error messages to the user. + Removes key (json path), value (errors) pairs where the json path is fully contained in another json path. + + For example if `errors_by_json_path` has two keys, `$.encoding.X` and `$.encoding.X.tooltip`, + then the first one will be removed and only the second one is returned. + + This is done under the assumption that more specific json paths give more helpful error messages to the user. """ errors_by_json_path_specific: GroupedValidationErrors = {} for json_path, errors in errors_by_json_path.items(): @@ -362,8 +362,9 @@ def _deduplicate_errors( grouped_errors: GroupedValidationErrors, ) -> GroupedValidationErrors: """ - Some errors have very similar error messages or are just in general not helpful - for a user. This function removes as many of these cases as possible and + Some errors have very similar error messages or are just in general not helpful for a user. + + This function removes as many of these cases as possible and can be extended over time to handle new cases that come up. """ grouped_errors_deduplicated: GroupedValidationErrors = {} @@ -402,8 +403,9 @@ def _is_required_value_error(err: jsonschema.exceptions.ValidationError) -> bool def _group_errors_by_validator(errors: ValidationErrorList) -> GroupedValidationErrors: """ - Groups the errors by the json schema "validator" that casued the error. For - example if the error is that a value is not one of an enumeration in the json schema + Groups the errors by the json schema "validator" that casued the error. + + For example if the error is that a value is not one of an enumeration in the json schema then the "validator" is `"enum"`, if the error is due to an unknown property that was set although no additional properties are allowed then "validator" is `"additionalProperties`, etc. @@ -419,9 +421,9 @@ def _group_errors_by_validator(errors: ValidationErrorList) -> GroupedValidation def _deduplicate_enum_errors(errors: ValidationErrorList) -> ValidationErrorList: """ - Deduplicate enum errors by removing the errors where the allowed values - are a subset of another error. For example, if `enum` contains two errors - and one has `validator_value` (i.e. accepted values) ["A", "B"] and the + Deduplicate enum errors by removing the errors where the allowed values are a subset of another error. + + For example, if `enum` contains two errors and one has `validator_value` (i.e. accepted values) ["A", "B"] and the other one ["A", "B", "C"] then the first one is removed and the final `enum` list only contains the error with ["A", "B", "C"]. """ @@ -442,9 +444,8 @@ def _deduplicate_additional_properties_errors( errors: ValidationErrorList, ) -> ValidationErrorList: """ - If there are multiple additional property errors it usually means that - the offending element was validated against multiple schemas and - its parent is a common anyOf validator. + If there are multiple additional property errors it usually means that the offending element was validated against multiple schemas and its parent is a common anyOf validator. + The error messages produced from these cases are usually very similar and we just take the shortest one. For example, the following 3 errors are raised for the `unknown` channel option in @@ -470,10 +471,7 @@ def _deduplicate_additional_properties_errors( def _deduplicate_by_message(errors: ValidationErrorList) -> ValidationErrorList: - """ - Deduplicate errors by message. This keeps the original order in case - it was chosen intentionally. - """ + """Deduplicate errors by message. This keeps the original order in case it was chosen intentionally.""" return list({e.message: e for e in errors}.values()) @@ -523,10 +521,7 @@ def _todict(obj: Any, context: dict[str, Any] | None, np_opt: Any, pd_opt: Any) def _resolve_references( schema: dict[str, Any], rootschema: dict[str, Any] | None = None ) -> dict[str, Any]: - """ - Resolve schema references until there is no $ref anymore - in the top-level of the dictionary. - """ + """Resolve schema references until there is no $ref anymore in the top-level of the dictionary.""" if _use_referencing_library(): registry = _get_referencing_registry(rootschema or schema) # Using a different variable name to show that this is not the @@ -627,9 +622,9 @@ def _get_altair_class_for_error( self, error: jsonschema.exceptions.ValidationError ) -> type[SchemaBase]: """ - Try to get the lowest class possible in the chart hierarchy so - it can be displayed in the error message. This should lead to more informative - error messages pointing the user closer to the source of the issue. + Try to get the lowest class possible in the chart hierarchy so it can be displayed in the error message. + + This should lead to more informative error messages pointing the user closer to the source of the issue. """ for prop_name in reversed(error.absolute_path): # Check if str as e.g. first item can be a 0 @@ -1181,10 +1176,7 @@ def from_json( def validate( cls, instance: dict[str, Any], schema: dict[str, Any] | None = None ) -> None: - """ - Validate the instance against the class schema in the context of the - rootschema. - """ + """Validate the instance against the class schema in the context of the rootschema.""" if schema is None: schema = cls._schema # For the benefit of mypy @@ -1208,10 +1200,7 @@ def resolve_references(cls, schema: dict[str, Any] | None = None) -> dict[str, A def validate_property( cls, name: str, value: Any, schema: dict[str, Any] | None = None ) -> None: - """ - Validate a property against property schema in the context of the - rootschema. - """ + """Validate a property against property schema in the context of the rootschema.""" # The following return the package only if it has already been # imported - otherwise they return None. This is useful for # isinstance checks - for example, if pandas has not been imported, @@ -1265,8 +1254,7 @@ def __init__(self, wrapper_classes: Iterable[type[SchemaBase]], /) -> None: @classmethod def hash_schema(cls, schema: dict[str, Any], use_json: bool = True) -> int: """ - Compute a python hash for a nested dictionary which - properly handles dicts, lists, sets, and tuples. + Compute a python hash for a nested dictionary which properly handles dicts, lists, sets, and tuples. At the top level, the function excludes from the hashed schema all keys listed in `exclude_keys`. From c08b17a7615367cf39a4f61d2a050aa59d4a78a4 Mon Sep 17 00:00:00 2001 From: dangotbanned <125183946+dangotbanned@users.noreply.github.com> Date: Mon, 22 Jul 2024 18:14:39 +0100 Subject: [PATCH 08/11] ci(ruff): Remove commented out section --- pyproject.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5a6b3616d..0c0c309d3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -359,10 +359,6 @@ mccabe={ max-complexity=18 } # https://docs.astral.sh/ruff/settings/#lint_flake8-tidy-imports_banned-api "typing.Optional".msg = "Use `Union[T, None]` instead.\n`typing.Optional` is likely to be confused with `altair.Optional`, which have a similar but different semantic meaning.\nSee https://github.com/vega/altair/pull/3449" -# [tool.ruff.lint.per-file-ignores] -# Ignore `D` rules everywhere *except* for auto-generated code. -# "!altair/vegalite/v5/schema/*.py" = ["D","D213"] - [tool.ruff.format] quote-style = "double" From 18695af4ae3ee42ac032bb2862edaf816ea1a0f1 Mon Sep 17 00:00:00 2001 From: dangotbanned <125183946+dangotbanned@users.noreply.github.com> Date: Mon, 22 Jul 2024 19:43:42 +0100 Subject: [PATCH 09/11] docs(ruff): Apply `docstring-code-line-length` default --- altair/utils/_transformed_data.py | 68 +++++++++++++------------------ altair/utils/_vegafusion_data.py | 10 +---- altair/utils/core.py | 50 +++++++++++++++-------- altair/utils/plugin_registry.py | 4 +- altair/vegalite/v5/api.py | 45 ++++++++++---------- pyproject.toml | 2 +- tools/schemapi/utils.py | 8 ++-- 7 files changed, 96 insertions(+), 91 deletions(-) diff --git a/altair/utils/_transformed_data.py b/altair/utils/_transformed_data.py index 0a622a2a8..5847ad94f 100644 --- a/altair/utils/_transformed_data.py +++ b/altair/utils/_transformed_data.py @@ -241,13 +241,8 @@ def get_group_mark_for_scope( -------- >>> spec = { ... "marks": [ - ... { - ... "type": "group", - ... "marks": [{"type": "symbol"}] - ... }, - ... { - ... "type": "group", - ... "marks": [{"type": "rect"}]} + ... {"type": "group", "marks": [{"type": "symbol"}]}, + ... {"type": "group", "marks": [{"type": "rect"}]}, ... ] ... } >>> get_group_mark_for_scope(spec, (1,)) @@ -293,16 +288,12 @@ def get_datasets_for_scope(vega_spec: dict[str, Any], scope: Scope) -> list[str] Examples -------- >>> spec = { - ... "data": [ - ... {"name": "data1"} - ... ], + ... "data": [{"name": "data1"}], ... "marks": [ ... { ... "type": "group", - ... "data": [ - ... {"name": "data2"} - ... ], - ... "marks": [{"type": "symbol"}] + ... "data": [{"name": "data2"}], + ... "marks": [{"type": "symbol"}], ... }, ... { ... "type": "group", @@ -310,9 +301,9 @@ def get_datasets_for_scope(vega_spec: dict[str, Any], scope: Scope) -> list[str] ... {"name": "data3"}, ... {"name": "data4"}, ... ], - ... "marks": [{"type": "rect"}] - ... } - ... ] + ... "marks": [{"type": "rect"}], + ... }, + ... ], ... } >>> get_datasets_for_scope(spec, ()) @@ -366,26 +357,24 @@ def get_definition_scope_for_data_reference( Examples -------- >>> spec = { - ... "data": [ - ... {"name": "data1"} - ... ], + ... "data": [{"name": "data1"}], ... "marks": [ ... { ... "type": "group", - ... "data": [ - ... {"name": "data2"} - ... ], - ... "marks": [{ - ... "type": "symbol", - ... "encode": { - ... "update": { - ... "x": {"field": "x", "data": "data1"}, - ... "y": {"field": "y", "data": "data2"}, - ... } + ... "data": [{"name": "data2"}], + ... "marks": [ + ... { + ... "type": "symbol", + ... "encode": { + ... "update": { + ... "x": {"field": "x", "data": "data1"}, + ... "y": {"field": "y", "data": "data2"}, + ... } + ... }, ... } - ... }] + ... ], ... } - ... ] + ... ], ... } data1 is referenced at scope [0] and defined at scope [] @@ -428,9 +417,7 @@ def get_facet_mapping(group: dict[str, Any], scope: Scope = ()) -> FacetMapping: Examples -------- >>> spec = { - ... "data": [ - ... {"name": "data1"} - ... ], + ... "data": [{"name": "data1"}], ... "marks": [ ... { ... "type": "group", @@ -438,11 +425,11 @@ def get_facet_mapping(group: dict[str, Any], scope: Scope = ()) -> FacetMapping: ... "facet": { ... "name": "facet1", ... "data": "data1", - ... "groupby": ["colA"] + ... "groupby": ["colA"], ... } - ... } + ... }, ... } - ... ] + ... ], ... } >>> get_facet_mapping(spec) {('facet1', (0,)): ('data1', ())} @@ -497,7 +484,10 @@ def get_from_facet_mapping( Examples -------- Facet mapping as produced by get_facet_mapping - >>> facet_mapping = {("facet1", (0,)): ("data1", ()), ("facet2", (0, 1)): ("facet1", (0,))} + >>> facet_mapping = { + ... ("facet1", (0,)): ("data1", ()), + ... ("facet2", (0, 1)): ("facet1", (0,)), + ... } >>> get_from_facet_mapping(("facet2", (0, 1)), facet_mapping) ('data1', ()) """ diff --git a/altair/utils/_vegafusion_data.py b/altair/utils/_vegafusion_data.py index d7c318865..26f79d22e 100644 --- a/altair/utils/_vegafusion_data.py +++ b/altair/utils/_vegafusion_data.py @@ -108,14 +108,8 @@ def get_inline_table_names(vega_spec: dict[str, Any]) -> set[str]: -------- >>> spec = { ... "data": [ - ... { - ... "name": "foo", - ... "url": "https://path/to/file.csv" - ... }, - ... { - ... "name": "bar", - ... "url": "vegafusion+dataset://inline_dataset_123" - ... } + ... {"name": "foo", "url": "https://path/to/file.csv"}, + ... {"name": "bar", "url": "vegafusion+dataset://inline_dataset_123"}, ... ] ... } >>> get_inline_table_names(spec) diff --git a/altair/utils/core.py b/altair/utils/core.py index 028414485..d6f6bad65 100644 --- a/altair/utils/core.py +++ b/altair/utils/core.py @@ -545,43 +545,61 @@ def parse_shorthand( Examples -------- >>> import pandas as pd - >>> data = pd.DataFrame({'foo': ['A', 'B', 'A', 'B'], - ... 'bar': [1, 2, 3, 4]}) + >>> data = pd.DataFrame({"foo": ["A", "B", "A", "B"], "bar": [1, 2, 3, 4]}) - >>> parse_shorthand('name') == {'field': 'name'} + >>> parse_shorthand("name") == {"field": "name"} True - >>> parse_shorthand('name:Q') == {'field': 'name', 'type': 'quantitative'} + >>> parse_shorthand("name:Q") == {"field": "name", "type": "quantitative"} True - >>> parse_shorthand('average(col)') == {'aggregate': 'average', 'field': 'col'} + >>> parse_shorthand("average(col)") == {"aggregate": "average", "field": "col"} True - >>> parse_shorthand('foo:O') == {'field': 'foo', 'type': 'ordinal'} + >>> parse_shorthand("foo:O") == {"field": "foo", "type": "ordinal"} True - >>> parse_shorthand('min(foo):Q') == {'aggregate': 'min', 'field': 'foo', 'type': 'quantitative'} + >>> parse_shorthand("min(foo):Q") == { + ... "aggregate": "min", + ... "field": "foo", + ... "type": "quantitative", + ... } True - >>> parse_shorthand('month(col)') == {'field': 'col', 'timeUnit': 'month', 'type': 'temporal'} + >>> parse_shorthand("month(col)") == { + ... "field": "col", + ... "timeUnit": "month", + ... "type": "temporal", + ... } True - >>> parse_shorthand('year(col):O') == {'field': 'col', 'timeUnit': 'year', 'type': 'ordinal'} + >>> parse_shorthand("year(col):O") == { + ... "field": "col", + ... "timeUnit": "year", + ... "type": "ordinal", + ... } True - >>> parse_shorthand('foo', data) == {'field': 'foo', 'type': 'nominal'} + >>> parse_shorthand("foo", data) == {"field": "foo", "type": "nominal"} True - >>> parse_shorthand('bar', data) == {'field': 'bar', 'type': 'quantitative'} + >>> parse_shorthand("bar", data) == {"field": "bar", "type": "quantitative"} True - >>> parse_shorthand('bar:O', data) == {'field': 'bar', 'type': 'ordinal'} + >>> parse_shorthand("bar:O", data) == {"field": "bar", "type": "ordinal"} True - >>> parse_shorthand('sum(bar)', data) == {'aggregate': 'sum', 'field': 'bar', 'type': 'quantitative'} + >>> parse_shorthand("sum(bar)", data) == { + ... "aggregate": "sum", + ... "field": "bar", + ... "type": "quantitative", + ... } True - >>> parse_shorthand('count()', data) == {'aggregate': 'count', 'type': 'quantitative'} + >>> parse_shorthand("count()", data) == { + ... "aggregate": "count", + ... "type": "quantitative", + ... } True """ from altair.utils.data import is_data_type @@ -743,8 +761,8 @@ def update_nested( Examples -------- - >>> original = {'x': {'b': 2, 'c': 4}} - >>> update = {'x': {'b': 5, 'd': 6}, 'y': 40} + >>> original = {"x": {"b": 2, "c": 4}} + >>> update = {"x": {"b": 5, "d": 6}, "y": 40} >>> update_nested(original, update) # doctest: +SKIP {'x': {'b': 5, 'c': 4, 'd': 6}, 'y': 40} >>> original # doctest: +SKIP diff --git a/altair/utils/plugin_registry.py b/altair/utils/plugin_registry.py index d2ae15cc1..4b4f01dbd 100644 --- a/altair/utils/plugin_registry.py +++ b/altair/utils/plugin_registry.py @@ -47,7 +47,7 @@ class PluginEnabler: This object lets you use enable() as a context manager to temporarily enable a given plugin:: - with plugins.enable('name'): + with plugins.enable("name"): do_something() # 'name' plugin temporarily enabled # plugins back to original state """ @@ -83,7 +83,7 @@ class PluginRegistry(Generic[PluginT, R]): When you create an instance of this class, provide the name of the entry point group to use:: - reg = PluginRegister('my_entrypoint_group') + reg = PluginRegister("my_entrypoint_group") """ diff --git a/altair/vegalite/v5/api.py b/altair/vegalite/v5/api.py index f6c8b6c05..d7d377133 100644 --- a/altair/vegalite/v5/api.py +++ b/altair/vegalite/v5/api.py @@ -610,7 +610,7 @@ def _parse_when_constraints( alt.when(alt.datum.Origin == "Europe") # after - alt.when(Origin = "Europe") + alt.when(Origin="Europe") ``` """ for name, value in constraints.items(): @@ -1016,6 +1016,7 @@ def when( Using keyword-argument ``constraints`` can simplify compositions like:: import altair as alt + verbose_composition = ( (alt.datum.Name == "Name_1") & (alt.datum.Color == "Green") @@ -1023,7 +1024,9 @@ def when( & (alt.datum.StartDate == "2000-10-01") ) when_verbose = alt.when(verbose_composition) - when_concise = alt.when(Name="Name_1", Color="Green", Age=25, StartDate="2000-10-01") + when_concise = alt.when( + Name="Name_1", Color="Green", Age=25, StartDate="2000-10-01" + ) """ condition = _parse_when(predicate, *more_predicates, empty=empty, **constraints) return When(condition) @@ -2208,8 +2211,7 @@ def transform_aggregate( >>> import altair as alt >>> chart1 = alt.Chart().transform_aggregate( - ... mean_acc='mean(Acceleration)', - ... groupby=['Origin'] + ... mean_acc="mean(Acceleration)", groupby=["Origin"] ... ) >>> print(chart1.transform[0].to_json()) # doctest: +NORMALIZE_WHITESPACE { @@ -2229,9 +2231,12 @@ def transform_aggregate( so you can create the above transform like this: >>> chart2 = alt.Chart().transform_aggregate( - ... [alt.AggregatedFieldDef(field='Acceleration', op='mean', - ... **{'as': 'mean_acc'})], - ... groupby=['Origin'] + ... [ + ... alt.AggregatedFieldDef( + ... field="Acceleration", op="mean", **{"as": "mean_acc"} + ... ) + ... ], + ... groupby=["Origin"], ... ) >>> chart2.transform == chart1.transform True @@ -2292,8 +2297,7 @@ def transform_bin( field: 'x' }) - >>> chart = alt.Chart().transform_bin("x_binned", "x", - ... bin=alt.Bin(maxbins=10)) + >>> chart = alt.Chart().transform_bin("x_binned", "x", bin=alt.Bin(maxbins=10)) >>> chart.transform[0] BinTransform({ as: 'x_binned', @@ -2346,7 +2350,7 @@ def transform_calculate( >>> import altair as alt >>> from altair import datum, expr - >>> chart = alt.Chart().transform_calculate(y = 2 * expr.sin(datum.x)) + >>> chart = alt.Chart().transform_calculate(y=2 * expr.sin(datum.x)) >>> chart.transform[0] CalculateTransform({ as: 'y', @@ -2355,7 +2359,7 @@ def transform_calculate( It's also possible to pass the ``CalculateTransform`` arguments directly: - >>> kwds = {'as_': 'y', 'calculate': '2 * sin(datum.x)'} + >>> kwds = {"as_": "y", "calculate": "2 * sin(datum.x)"} >>> chart = alt.Chart().transform_calculate(**kwds) >>> chart.transform[0] CalculateTransform({ @@ -2561,7 +2565,7 @@ def transform_joinaggregate( Examples -------- >>> import altair as alt - >>> chart = alt.Chart().transform_joinaggregate(x='sum(y)') + >>> chart = alt.Chart().transform_joinaggregate(x="sum(y)") >>> chart.transform[0] JoinAggregateTransform({ joinaggregate: [JoinAggregateFieldDef({ @@ -3064,7 +3068,7 @@ def transform_timeunit( >>> import altair as alt >>> from altair import datum, expr - >>> chart = alt.Chart().transform_timeunit(month='month(date)') + >>> chart = alt.Chart().transform_timeunit(month="month(date)") >>> chart.transform[0] TimeUnitTransform({ as: 'month', @@ -3076,7 +3080,7 @@ def transform_timeunit( this is most useful in cases where the desired field name is not a valid python identifier: - >>> kwds = {'as': 'month', 'timeUnit': 'month', 'field': 'The Month'} + >>> kwds = {"as": "month", "timeUnit": "month", "field": "The Month"} >>> chart = alt.Chart().transform_timeunit(**kwds) >>> chart.transform[0] TimeUnitTransform({ @@ -3175,13 +3179,12 @@ def transform_window( >>> import altair as alt >>> import numpy as np >>> import pandas as pd - >>> data = pd.DataFrame({'x': np.arange(100), - ... 'y': np.random.randn(100)}) - >>> chart = alt.Chart(data).mark_line().encode( - ... x='x:Q', - ... y='ycuml:Q' - ... ).transform_window( - ... ycuml='sum(y)' + >>> data = pd.DataFrame({"x": np.arange(100), "y": np.random.randn(100)}) + >>> chart = ( + ... alt.Chart(data) + ... .mark_line() + ... .encode(x="x:Q", y="ycuml:Q") + ... .transform_window(ycuml="sum(y)") ... ) >>> chart.transform[0] WindowTransform({ diff --git a/pyproject.toml b/pyproject.toml index 0c0c309d3..a5415ffd0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -367,7 +367,7 @@ skip-magic-trailing-comma = false line-ending = "lf" # Enable once `D` are applied to non-generated code # https://docs.astral.sh/ruff/formatter/#docstring-formatting -# docstring-code-format = true +docstring-code-format = true [tool.pytest.ini_options] # Pytest does not need to search these folders for test functions. diff --git a/tools/schemapi/utils.py b/tools/schemapi/utils.py index 60e90d53d..2880ab5ae 100644 --- a/tools/schemapi/utils.py +++ b/tools/schemapi/utils.py @@ -218,16 +218,16 @@ def get_valid_identifier( Examples -------- - >>> get_valid_identifier('my-var') + >>> get_valid_identifier("my-var") 'myvar' - >>> get_valid_identifier('if') + >>> get_valid_identifier("if") 'if_' - >>> get_valid_identifier('$schema', '_') + >>> get_valid_identifier("$schema", "_") '_schema' - >>> get_valid_identifier('$*#$') + >>> get_valid_identifier("$*#$") '_' >>> get_valid_identifier("Name%3Cstring%3E") From 4ccad22c7f54dc9ed54532a211526225aa19c662 Mon Sep 17 00:00:00 2001 From: dangotbanned <125183946+dangotbanned@users.noreply.github.com> Date: Mon, 22 Jul 2024 19:44:16 +0100 Subject: [PATCH 10/11] docs(ruff): Apply `docstring-code-line-length = 88` --- altair/vegalite/v5/api.py | 10 ++-------- pyproject.toml | 1 + 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/altair/vegalite/v5/api.py b/altair/vegalite/v5/api.py index d7d377133..240b7b3fc 100644 --- a/altair/vegalite/v5/api.py +++ b/altair/vegalite/v5/api.py @@ -1024,9 +1024,7 @@ def when( & (alt.datum.StartDate == "2000-10-01") ) when_verbose = alt.when(verbose_composition) - when_concise = alt.when( - Name="Name_1", Color="Green", Age=25, StartDate="2000-10-01" - ) + when_concise = alt.when(Name="Name_1", Color="Green", Age=25, StartDate="2000-10-01") """ condition = _parse_when(predicate, *more_predicates, empty=empty, **constraints) return When(condition) @@ -2231,11 +2229,7 @@ def transform_aggregate( so you can create the above transform like this: >>> chart2 = alt.Chart().transform_aggregate( - ... [ - ... alt.AggregatedFieldDef( - ... field="Acceleration", op="mean", **{"as": "mean_acc"} - ... ) - ... ], + ... [alt.AggregatedFieldDef(field="Acceleration", op="mean", **{"as": "mean_acc"})], ... groupby=["Origin"], ... ) >>> chart2.transform == chart1.transform diff --git a/pyproject.toml b/pyproject.toml index a5415ffd0..285beda63 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -368,6 +368,7 @@ line-ending = "lf" # Enable once `D` are applied to non-generated code # https://docs.astral.sh/ruff/formatter/#docstring-formatting docstring-code-format = true +docstring-code-line-length = 88 [tool.pytest.ini_options] # Pytest does not need to search these folders for test functions. From 05f328eb1f8302206afa80b543762ce681e5e654 Mon Sep 17 00:00:00 2001 From: dangotbanned <125183946+dangotbanned@users.noreply.github.com> Date: Mon, 22 Jul 2024 19:47:03 +0100 Subject: [PATCH 11/11] fix(ruff): Add period to docstring --- altair/vegalite/schema.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/altair/vegalite/schema.py b/altair/vegalite/schema.py index 3807f3767..738ad36a3 100644 --- a/altair/vegalite/schema.py +++ b/altair/vegalite/schema.py @@ -1,4 +1,4 @@ -"""Altair schema wrappers""" +"""Altair schema wrappers.""" # ruff: noqa from .v5.schema import *