From 18d96e4a1bafa21862a9047a5c0f50a72f3584f5 Mon Sep 17 00:00:00 2001 From: Stefan Binder Date: Mon, 30 Oct 2023 20:14:49 +0100 Subject: [PATCH] Fix mypy error for data argument. Add RepeatRef as a type hint for shorthand --- altair/vegalite/v5/api.py | 5 +- altair/vegalite/v5/schema/channels.py | 240 +++++++++++++++++--------- altair/vegalite/v5/schema/core.py | 90 ++++++---- tools/generate_schema_wrapper.py | 1 + 4 files changed, 225 insertions(+), 111 deletions(-) diff --git a/altair/vegalite/v5/api.py b/altair/vegalite/v5/api.py index 82bc08c10..ffa465a61 100644 --- a/altair/vegalite/v5/api.py +++ b/altair/vegalite/v5/api.py @@ -2769,7 +2769,10 @@ def __init__( **kwargs, ) -> None: super(Chart, self).__init__( - data=data, + # Data type hints won't match with what TopLevelUnitSpec expects + # as there is some data processing happening when converting to + # a VL spec + data=data, # type: ignore[arg-type] encoding=encoding, mark=mark, width=width, diff --git a/altair/vegalite/v5/schema/channels.py b/altair/vegalite/v5/schema/channels.py index 7f49d0462..67b9c0627 100644 --- a/altair/vegalite/v5/schema/channels.py +++ b/altair/vegalite/v5/schema/channels.py @@ -137,7 +137,7 @@ class Angle(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDef Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -3030,7 +3030,9 @@ def type( def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -4313,7 +4315,7 @@ class Color( Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -7224,7 +7226,9 @@ def type( def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -8572,7 +8576,7 @@ class Column(FieldChannelMixin, core.RowColumnEncodingFieldDef): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -9759,7 +9763,9 @@ def type( def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -10012,7 +10018,7 @@ class Description(FieldChannelMixin, core.StringFieldDefWithCondition): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -10671,7 +10677,9 @@ def type( def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -11659,7 +11667,7 @@ class Detail(FieldChannelMixin, core.FieldDefWithoutScale): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -12213,7 +12221,9 @@ def type( def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -12440,7 +12450,7 @@ class Facet(FieldChannelMixin, core.FacetEncodingFieldDef): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -13704,7 +13714,9 @@ def type( def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -13973,7 +13985,7 @@ class Fill( Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -16884,7 +16896,9 @@ def type( def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -18234,7 +18248,7 @@ class FillOpacity( Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -21127,7 +21141,9 @@ def type( def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -22408,7 +22424,7 @@ class Href(FieldChannelMixin, core.StringFieldDefWithCondition): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -23067,7 +23083,9 @@ def type( def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -24055,7 +24073,7 @@ class Key(FieldChannelMixin, core.FieldDefWithoutScale): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -24609,7 +24627,9 @@ def type( def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -24836,7 +24856,7 @@ class Latitude(FieldChannelMixin, core.LatLongFieldDef): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -25360,7 +25380,9 @@ def type(self, _: str, **kwds) -> "Latitude": def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -25735,7 +25757,7 @@ class Latitude2(FieldChannelMixin, core.SecondaryFieldDef): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -26186,7 +26208,9 @@ def title(self, _: None, **kwds) -> "Latitude2": def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -26581,7 +26605,7 @@ class Longitude(FieldChannelMixin, core.LatLongFieldDef): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -27105,7 +27129,9 @@ def type(self, _: str, **kwds) -> "Longitude": def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -27480,7 +27506,7 @@ class Longitude2(FieldChannelMixin, core.SecondaryFieldDef): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -27931,7 +27957,9 @@ def title(self, _: None, **kwds) -> "Longitude2": def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -28328,7 +28356,7 @@ class Opacity( Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -31221,7 +31249,9 @@ def type( def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -32500,7 +32530,7 @@ class Order(FieldChannelMixin, core.OrderFieldDef): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -33060,7 +33090,9 @@ def type( def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -33387,7 +33419,7 @@ class Radius(FieldChannelMixin, core.PositionFieldDefBase): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -34740,7 +34772,9 @@ def type( def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -35847,7 +35881,7 @@ class Radius2(FieldChannelMixin, core.SecondaryFieldDef): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -36298,7 +36332,9 @@ def title(self, _: None, **kwds) -> "Radius2": def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -36693,7 +36729,7 @@ class Row(FieldChannelMixin, core.RowColumnEncodingFieldDef): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -37880,7 +37916,9 @@ def type( def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -38137,7 +38175,7 @@ class Shape( Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -41028,7 +41066,9 @@ def type(self, _: Literal["nominal", "ordinal", "geojson"], **kwds) -> "Shape": def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -42307,7 +42347,7 @@ class Size(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefn Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -45200,7 +45240,9 @@ def type( def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -46483,7 +46525,7 @@ class Stroke( Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -49394,7 +49436,9 @@ def type( def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -50744,7 +50788,7 @@ class StrokeDash( Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -53637,7 +53681,9 @@ def type( def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -54932,7 +54978,7 @@ class StrokeOpacity( Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -57825,7 +57871,9 @@ def type( def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -59110,7 +59158,7 @@ class StrokeWidth( Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -62003,7 +62051,9 @@ def type( def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -63284,7 +63334,7 @@ class Text(FieldChannelMixin, core.FieldOrDatumDefWithConditionStringFieldDefTex Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -63947,7 +63997,9 @@ def type( def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -65041,7 +65093,7 @@ class Theta(FieldChannelMixin, core.PositionFieldDefBase): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -66394,7 +66446,9 @@ def type( def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -67501,7 +67555,7 @@ class Theta2(FieldChannelMixin, core.SecondaryFieldDef): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -67952,7 +68006,9 @@ def title(self, _: None, **kwds) -> "Theta2": def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -68347,7 +68403,7 @@ class Tooltip(FieldChannelMixin, core.StringFieldDefWithCondition): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -69006,7 +69062,9 @@ def type( def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -69993,7 +70051,7 @@ class Url(FieldChannelMixin, core.StringFieldDefWithCondition): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -70652,7 +70710,9 @@ def type( def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -71639,7 +71699,7 @@ class X(FieldChannelMixin, core.PositionFieldDef): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -74305,7 +74365,9 @@ def type( def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -76737,7 +76799,7 @@ class X2(FieldChannelMixin, core.SecondaryFieldDef): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -77188,7 +77250,9 @@ def title(self, _: None, **kwds) -> "X2": def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -77585,7 +77649,7 @@ class XError(FieldChannelMixin, core.SecondaryFieldDef): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -78036,7 +78100,9 @@ def title(self, _: None, **kwds) -> "XError": def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -78279,7 +78345,7 @@ class XError2(FieldChannelMixin, core.SecondaryFieldDef): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -78730,7 +78796,9 @@ def title(self, _: None, **kwds) -> "XError2": def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -78971,7 +79039,7 @@ class XOffset(FieldChannelMixin, core.ScaleFieldDef): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -80277,7 +80345,9 @@ def type( def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -81321,7 +81391,7 @@ class Y(FieldChannelMixin, core.PositionFieldDef): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -83987,7 +84057,9 @@ def type( def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -86419,7 +86491,7 @@ class Y2(FieldChannelMixin, core.SecondaryFieldDef): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -86870,7 +86942,9 @@ def title(self, _: None, **kwds) -> "Y2": def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -87267,7 +87341,7 @@ class YError(FieldChannelMixin, core.SecondaryFieldDef): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -87718,7 +87792,9 @@ def title(self, _: None, **kwds) -> "YError": def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -87961,7 +88037,7 @@ class YError2(FieldChannelMixin, core.SecondaryFieldDef): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -88412,7 +88488,9 @@ def title(self, _: None, **kwds) -> "YError2": def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ @@ -88653,7 +88731,7 @@ class YOffset(FieldChannelMixin, core.ScaleFieldDef): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -89959,7 +90037,9 @@ def type( def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ Union[ diff --git a/altair/vegalite/v5/schema/core.py b/altair/vegalite/v5/schema/core.py index 285453b06..73a4841da 100644 --- a/altair/vegalite/v5/schema/core.py +++ b/altair/vegalite/v5/schema/core.py @@ -13395,7 +13395,7 @@ class FacetEncodingFieldDef(VegaLiteSchema): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -13641,7 +13641,9 @@ class FacetEncodingFieldDef(VegaLiteSchema): def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union["RepeatRef", dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ "Aggregate", @@ -15096,7 +15098,7 @@ class FieldDefWithoutScale(VegaLiteSchema): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -15250,7 +15252,9 @@ class FieldDefWithoutScale(VegaLiteSchema): def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union["RepeatRef", dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ "Aggregate", @@ -18767,7 +18771,7 @@ class LatLongFieldDef(LatLongDef): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -18921,7 +18925,9 @@ class LatLongFieldDef(LatLongDef): def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union["RepeatRef", dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ "Aggregate", @@ -27872,7 +27878,7 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull( Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -28096,7 +28102,9 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull( def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union["RepeatRef", dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ "Aggregate", @@ -28897,7 +28905,7 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray( Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -29121,7 +29129,9 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray( def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union["RepeatRef", dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ "Aggregate", @@ -29606,7 +29616,7 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefnumber( Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -29830,7 +29840,9 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefnumber( def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union["RepeatRef", dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ "Aggregate", @@ -30146,7 +30158,7 @@ class OrderFieldDef(VegaLiteSchema): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -30302,7 +30314,9 @@ class OrderFieldDef(VegaLiteSchema): def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union["RepeatRef", dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ "Aggregate", @@ -33113,7 +33127,7 @@ class PositionFieldDef(PositionDef): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -33367,7 +33381,9 @@ class PositionFieldDef(PositionDef): def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union["RepeatRef", dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ "Aggregate", @@ -33663,7 +33679,7 @@ class PositionFieldDefBase(PolarDef): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -33900,7 +33916,9 @@ class PositionFieldDefBase(PolarDef): def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union["RepeatRef", dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ "Aggregate", @@ -39096,7 +39114,7 @@ class RowColumnEncodingFieldDef(VegaLiteSchema): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -39304,7 +39322,9 @@ class RowColumnEncodingFieldDef(VegaLiteSchema): def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union["RepeatRef", dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ "Aggregate", @@ -40824,7 +40844,7 @@ class ScaleFieldDef(OffsetDef): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -41030,7 +41050,9 @@ class ScaleFieldDef(OffsetDef): def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union["RepeatRef", dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ "Aggregate", @@ -41885,7 +41907,7 @@ class SecondaryFieldDef(Position2Def): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -41970,7 +41992,9 @@ class SecondaryFieldDef(Position2Def): def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union["RepeatRef", dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ "Aggregate", @@ -42789,7 +42813,7 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull( Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -43013,7 +43037,9 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull( def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union["RepeatRef", dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ "Aggregate", @@ -45914,7 +45940,7 @@ class StringFieldDefWithCondition(VegaLiteSchema): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -46109,7 +46135,9 @@ class StringFieldDefWithCondition(VegaLiteSchema): def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union["RepeatRef", dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ "Aggregate", @@ -46790,7 +46818,7 @@ class FieldOrDatumDefWithConditionStringFieldDefText(TextDef): Parameters ---------- - shorthand : Sequence[str], str + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, @@ -46987,7 +47015,9 @@ class FieldOrDatumDefWithConditionStringFieldDefText(TextDef): def __init__( self, - shorthand: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + shorthand: Union[ + Union[Sequence[str], Union["RepeatRef", dict], str], UndefinedType + ] = Undefined, aggregate: Union[ Union[ "Aggregate", diff --git a/tools/generate_schema_wrapper.py b/tools/generate_schema_wrapper.py index 10759224a..3ab9b7faf 100644 --- a/tools/generate_schema_wrapper.py +++ b/tools/generate_schema_wrapper.py @@ -368,6 +368,7 @@ def _add_shorthand_property_to_field_encodings(schema: dict) -> dict: "anyOf": [ {"type": "string"}, {"type": "array", "items": {"type": "string"}}, + {"$ref": "#/definitions/RepeatRef"}, ], "description": "shorthand for field, aggregate, and type", }