diff --git a/altair/vegalite/v5/schema/channels.py b/altair/vegalite/v5/schema/channels.py index 67b9c0627..684f1f7f9 100644 --- a/altair/vegalite/v5/schema/channels.py +++ b/altair/vegalite/v5/schema/channels.py @@ -420,7 +420,11 @@ def bin( binned: Union[bool, UndefinedType] = Undefined, divide: Union[Sequence[float], UndefinedType] = Undefined, extent: Union[ - Union[Sequence[float], Union[core.ParameterExtent, dict], core.BinExtent], + Union[ + Sequence[float], + Union[core.ParameterExtent, core._ParameterProtocol, dict], + core.BinExtent, + ], UndefinedType, ] = Undefined, maxbins: Union[float, UndefinedType] = Undefined, @@ -2058,7 +2062,7 @@ def scale( ], Union[core.DomainUnionWith, dict], Union[core.ExprRef, core._ParameterProtocol, dict], - Union[core.ParameterExtent, dict], + Union[core.ParameterExtent, core._ParameterProtocol, dict], str, ], UndefinedType, @@ -4598,7 +4602,11 @@ def bin( binned: Union[bool, UndefinedType] = Undefined, divide: Union[Sequence[float], UndefinedType] = Undefined, extent: Union[ - Union[Sequence[float], Union[core.ParameterExtent, dict], core.BinExtent], + Union[ + Sequence[float], + Union[core.ParameterExtent, core._ParameterProtocol, dict], + core.BinExtent, + ], UndefinedType, ] = Undefined, maxbins: Union[float, UndefinedType] = Undefined, @@ -6254,7 +6262,7 @@ def scale( ], Union[core.DomainUnionWith, dict], Union[core.ExprRef, core._ParameterProtocol, dict], - Union[core.ParameterExtent, dict], + Union[core.ParameterExtent, core._ParameterProtocol, dict], str, ], UndefinedType, @@ -8849,7 +8857,11 @@ def bin( binned: Union[bool, UndefinedType] = Undefined, divide: Union[Sequence[float], UndefinedType] = Undefined, extent: Union[ - Union[Sequence[float], Union[core.ParameterExtent, dict], core.BinExtent], + Union[ + Sequence[float], + Union[core.ParameterExtent, core._ParameterProtocol, dict], + core.BinExtent, + ], UndefinedType, ] = Undefined, maxbins: Union[float, UndefinedType] = Undefined, @@ -10274,7 +10286,11 @@ def bin( binned: Union[bool, UndefinedType] = Undefined, divide: Union[Sequence[float], UndefinedType] = Undefined, extent: Union[ - Union[Sequence[float], Union[core.ParameterExtent, dict], core.BinExtent], + Union[ + Sequence[float], + Union[core.ParameterExtent, core._ParameterProtocol, dict], + core.BinExtent, + ], UndefinedType, ] = Undefined, maxbins: Union[float, UndefinedType] = Undefined, @@ -11882,7 +11898,11 @@ def bin( binned: Union[bool, UndefinedType] = Undefined, divide: Union[Sequence[float], UndefinedType] = Undefined, extent: Union[ - Union[Sequence[float], Union[core.ParameterExtent, dict], core.BinExtent], + Union[ + Sequence[float], + Union[core.ParameterExtent, core._ParameterProtocol, dict], + core.BinExtent, + ], UndefinedType, ] = Undefined, maxbins: Union[float, UndefinedType] = Undefined, @@ -12774,7 +12794,11 @@ def bin( binned: Union[bool, UndefinedType] = Undefined, divide: Union[Sequence[float], UndefinedType] = Undefined, extent: Union[ - Union[Sequence[float], Union[core.ParameterExtent, dict], core.BinExtent], + Union[ + Sequence[float], + Union[core.ParameterExtent, core._ParameterProtocol, dict], + core.BinExtent, + ], UndefinedType, ] = Undefined, maxbins: Union[float, UndefinedType] = Undefined, @@ -14268,7 +14292,11 @@ def bin( binned: Union[bool, UndefinedType] = Undefined, divide: Union[Sequence[float], UndefinedType] = Undefined, extent: Union[ - Union[Sequence[float], Union[core.ParameterExtent, dict], core.BinExtent], + Union[ + Sequence[float], + Union[core.ParameterExtent, core._ParameterProtocol, dict], + core.BinExtent, + ], UndefinedType, ] = Undefined, maxbins: Union[float, UndefinedType] = Undefined, @@ -15924,7 +15952,7 @@ def scale( ], Union[core.DomainUnionWith, dict], Union[core.ExprRef, core._ParameterProtocol, dict], - Union[core.ParameterExtent, dict], + Union[core.ParameterExtent, core._ParameterProtocol, dict], str, ], UndefinedType, @@ -18531,7 +18559,11 @@ def bin( binned: Union[bool, UndefinedType] = Undefined, divide: Union[Sequence[float], UndefinedType] = Undefined, extent: Union[ - Union[Sequence[float], Union[core.ParameterExtent, dict], core.BinExtent], + Union[ + Sequence[float], + Union[core.ParameterExtent, core._ParameterProtocol, dict], + core.BinExtent, + ], UndefinedType, ] = Undefined, maxbins: Union[float, UndefinedType] = Undefined, @@ -20169,7 +20201,7 @@ def scale( ], Union[core.DomainUnionWith, dict], Union[core.ExprRef, core._ParameterProtocol, dict], - Union[core.ParameterExtent, dict], + Union[core.ParameterExtent, core._ParameterProtocol, dict], str, ], UndefinedType, @@ -22680,7 +22712,11 @@ def bin( binned: Union[bool, UndefinedType] = Undefined, divide: Union[Sequence[float], UndefinedType] = Undefined, extent: Union[ - Union[Sequence[float], Union[core.ParameterExtent, dict], core.BinExtent], + Union[ + Sequence[float], + Union[core.ParameterExtent, core._ParameterProtocol, dict], + core.BinExtent, + ], UndefinedType, ] = Undefined, maxbins: Union[float, UndefinedType] = Undefined, @@ -24288,7 +24324,11 @@ def bin( binned: Union[bool, UndefinedType] = Undefined, divide: Union[Sequence[float], UndefinedType] = Undefined, extent: Union[ - Union[Sequence[float], Union[core.ParameterExtent, dict], core.BinExtent], + Union[ + Sequence[float], + Union[core.ParameterExtent, core._ParameterProtocol, dict], + core.BinExtent, + ], UndefinedType, ] = Undefined, maxbins: Union[float, UndefinedType] = Undefined, @@ -28639,7 +28679,11 @@ def bin( binned: Union[bool, UndefinedType] = Undefined, divide: Union[Sequence[float], UndefinedType] = Undefined, extent: Union[ - Union[Sequence[float], Union[core.ParameterExtent, dict], core.BinExtent], + Union[ + Sequence[float], + Union[core.ParameterExtent, core._ParameterProtocol, dict], + core.BinExtent, + ], UndefinedType, ] = Undefined, maxbins: Union[float, UndefinedType] = Undefined, @@ -30277,7 +30321,7 @@ def scale( ], Union[core.DomainUnionWith, dict], Union[core.ExprRef, core._ParameterProtocol, dict], - Union[core.ParameterExtent, dict], + Union[core.ParameterExtent, core._ParameterProtocol, dict], str, ], UndefinedType, @@ -32747,7 +32791,11 @@ def bin( binned: Union[bool, UndefinedType] = Undefined, divide: Union[Sequence[float], UndefinedType] = Undefined, extent: Union[ - Union[Sequence[float], Union[core.ParameterExtent, dict], core.BinExtent], + Union[ + Sequence[float], + Union[core.ParameterExtent, core._ParameterProtocol, dict], + core.BinExtent, + ], UndefinedType, ] = Undefined, maxbins: Union[float, UndefinedType] = Undefined, @@ -33717,7 +33765,11 @@ def bin( binned: Union[bool, UndefinedType] = Undefined, divide: Union[Sequence[float], UndefinedType] = Undefined, extent: Union[ - Union[Sequence[float], Union[core.ParameterExtent, dict], core.BinExtent], + Union[ + Sequence[float], + Union[core.ParameterExtent, core._ParameterProtocol, dict], + core.BinExtent, + ], UndefinedType, ] = Undefined, maxbins: Union[float, UndefinedType] = Undefined, @@ -33788,7 +33840,7 @@ def scale( ], Union[core.DomainUnionWith, dict], Union[core.ExprRef, core._ParameterProtocol, dict], - Union[core.ParameterExtent, dict], + Union[core.ParameterExtent, core._ParameterProtocol, dict], str, ], UndefinedType, @@ -35252,7 +35304,7 @@ def scale( ], Union[core.DomainUnionWith, dict], Union[core.ExprRef, core._ParameterProtocol, dict], - Union[core.ParameterExtent, dict], + Union[core.ParameterExtent, core._ParameterProtocol, dict], str, ], UndefinedType, @@ -37002,7 +37054,11 @@ def bin( binned: Union[bool, UndefinedType] = Undefined, divide: Union[Sequence[float], UndefinedType] = Undefined, extent: Union[ - Union[Sequence[float], Union[core.ParameterExtent, dict], core.BinExtent], + Union[ + Sequence[float], + Union[core.ParameterExtent, core._ParameterProtocol, dict], + core.BinExtent, + ], UndefinedType, ] = Undefined, maxbins: Union[float, UndefinedType] = Undefined, @@ -38458,7 +38514,11 @@ def bin( binned: Union[bool, UndefinedType] = Undefined, divide: Union[Sequence[float], UndefinedType] = Undefined, extent: Union[ - Union[Sequence[float], Union[core.ParameterExtent, dict], core.BinExtent], + Union[ + Sequence[float], + Union[core.ParameterExtent, core._ParameterProtocol, dict], + core.BinExtent, + ], UndefinedType, ] = Undefined, maxbins: Union[float, UndefinedType] = Undefined, @@ -40096,7 +40156,7 @@ def scale( ], Union[core.DomainUnionWith, dict], Union[core.ExprRef, core._ParameterProtocol, dict], - Union[core.ParameterExtent, dict], + Union[core.ParameterExtent, core._ParameterProtocol, dict], str, ], UndefinedType, @@ -42630,7 +42690,11 @@ def bin( binned: Union[bool, UndefinedType] = Undefined, divide: Union[Sequence[float], UndefinedType] = Undefined, extent: Union[ - Union[Sequence[float], Union[core.ParameterExtent, dict], core.BinExtent], + Union[ + Sequence[float], + Union[core.ParameterExtent, core._ParameterProtocol, dict], + core.BinExtent, + ], UndefinedType, ] = Undefined, maxbins: Union[float, UndefinedType] = Undefined, @@ -44268,7 +44332,7 @@ def scale( ], Union[core.DomainUnionWith, dict], Union[core.ExprRef, core._ParameterProtocol, dict], - Union[core.ParameterExtent, dict], + Union[core.ParameterExtent, core._ParameterProtocol, dict], str, ], UndefinedType, @@ -46808,7 +46872,11 @@ def bin( binned: Union[bool, UndefinedType] = Undefined, divide: Union[Sequence[float], UndefinedType] = Undefined, extent: Union[ - Union[Sequence[float], Union[core.ParameterExtent, dict], core.BinExtent], + Union[ + Sequence[float], + Union[core.ParameterExtent, core._ParameterProtocol, dict], + core.BinExtent, + ], UndefinedType, ] = Undefined, maxbins: Union[float, UndefinedType] = Undefined, @@ -48464,7 +48532,7 @@ def scale( ], Union[core.DomainUnionWith, dict], Union[core.ExprRef, core._ParameterProtocol, dict], - Union[core.ParameterExtent, dict], + Union[core.ParameterExtent, core._ParameterProtocol, dict], str, ], UndefinedType, @@ -51071,7 +51139,11 @@ def bin( binned: Union[bool, UndefinedType] = Undefined, divide: Union[Sequence[float], UndefinedType] = Undefined, extent: Union[ - Union[Sequence[float], Union[core.ParameterExtent, dict], core.BinExtent], + Union[ + Sequence[float], + Union[core.ParameterExtent, core._ParameterProtocol, dict], + core.BinExtent, + ], UndefinedType, ] = Undefined, maxbins: Union[float, UndefinedType] = Undefined, @@ -52709,7 +52781,7 @@ def scale( ], Union[core.DomainUnionWith, dict], Union[core.ExprRef, core._ParameterProtocol, dict], - Union[core.ParameterExtent, dict], + Union[core.ParameterExtent, core._ParameterProtocol, dict], str, ], UndefinedType, @@ -55261,7 +55333,11 @@ def bin( binned: Union[bool, UndefinedType] = Undefined, divide: Union[Sequence[float], UndefinedType] = Undefined, extent: Union[ - Union[Sequence[float], Union[core.ParameterExtent, dict], core.BinExtent], + Union[ + Sequence[float], + Union[core.ParameterExtent, core._ParameterProtocol, dict], + core.BinExtent, + ], UndefinedType, ] = Undefined, maxbins: Union[float, UndefinedType] = Undefined, @@ -56899,7 +56975,7 @@ def scale( ], Union[core.DomainUnionWith, dict], Union[core.ExprRef, core._ParameterProtocol, dict], - Union[core.ParameterExtent, dict], + Union[core.ParameterExtent, core._ParameterProtocol, dict], str, ], UndefinedType, @@ -59441,7 +59517,11 @@ def bin( binned: Union[bool, UndefinedType] = Undefined, divide: Union[Sequence[float], UndefinedType] = Undefined, extent: Union[ - Union[Sequence[float], Union[core.ParameterExtent, dict], core.BinExtent], + Union[ + Sequence[float], + Union[core.ParameterExtent, core._ParameterProtocol, dict], + core.BinExtent, + ], UndefinedType, ] = Undefined, maxbins: Union[float, UndefinedType] = Undefined, @@ -61079,7 +61159,7 @@ def scale( ], Union[core.DomainUnionWith, dict], Union[core.ExprRef, core._ParameterProtocol, dict], - Union[core.ParameterExtent, dict], + Union[core.ParameterExtent, core._ParameterProtocol, dict], str, ], UndefinedType, @@ -63590,7 +63670,11 @@ def bin( binned: Union[bool, UndefinedType] = Undefined, divide: Union[Sequence[float], UndefinedType] = Undefined, extent: Union[ - Union[Sequence[float], Union[core.ParameterExtent, dict], core.BinExtent], + Union[ + Sequence[float], + Union[core.ParameterExtent, core._ParameterProtocol, dict], + core.BinExtent, + ], UndefinedType, ] = Undefined, maxbins: Union[float, UndefinedType] = Undefined, @@ -65391,7 +65475,11 @@ def bin( binned: Union[bool, UndefinedType] = Undefined, divide: Union[Sequence[float], UndefinedType] = Undefined, extent: Union[ - Union[Sequence[float], Union[core.ParameterExtent, dict], core.BinExtent], + Union[ + Sequence[float], + Union[core.ParameterExtent, core._ParameterProtocol, dict], + core.BinExtent, + ], UndefinedType, ] = Undefined, maxbins: Union[float, UndefinedType] = Undefined, @@ -65462,7 +65550,7 @@ def scale( ], Union[core.DomainUnionWith, dict], Union[core.ExprRef, core._ParameterProtocol, dict], - Union[core.ParameterExtent, dict], + Union[core.ParameterExtent, core._ParameterProtocol, dict], str, ], UndefinedType, @@ -66926,7 +67014,7 @@ def scale( ], Union[core.DomainUnionWith, dict], Union[core.ExprRef, core._ParameterProtocol, dict], - Union[core.ParameterExtent, dict], + Union[core.ParameterExtent, core._ParameterProtocol, dict], str, ], UndefinedType, @@ -68659,7 +68747,11 @@ def bin( binned: Union[bool, UndefinedType] = Undefined, divide: Union[Sequence[float], UndefinedType] = Undefined, extent: Union[ - Union[Sequence[float], Union[core.ParameterExtent, dict], core.BinExtent], + Union[ + Sequence[float], + Union[core.ParameterExtent, core._ParameterProtocol, dict], + core.BinExtent, + ], UndefinedType, ] = Undefined, maxbins: Union[float, UndefinedType] = Undefined, @@ -70307,7 +70399,11 @@ def bin( binned: Union[bool, UndefinedType] = Undefined, divide: Union[Sequence[float], UndefinedType] = Undefined, extent: Union[ - Union[Sequence[float], Union[core.ParameterExtent, dict], core.BinExtent], + Union[ + Sequence[float], + Union[core.ParameterExtent, core._ParameterProtocol, dict], + core.BinExtent, + ], UndefinedType, ] = Undefined, maxbins: Union[float, UndefinedType] = Undefined, @@ -73290,7 +73386,11 @@ def bin( binned: Union[bool, UndefinedType] = Undefined, divide: Union[Sequence[float], UndefinedType] = Undefined, extent: Union[ - Union[Sequence[float], Union[core.ParameterExtent, dict], core.BinExtent], + Union[ + Sequence[float], + Union[core.ParameterExtent, core._ParameterProtocol, dict], + core.BinExtent, + ], UndefinedType, ] = Undefined, maxbins: Union[float, UndefinedType] = Undefined, @@ -73381,7 +73481,7 @@ def scale( ], Union[core.DomainUnionWith, dict], Union[core.ExprRef, core._ParameterProtocol, dict], - Union[core.ParameterExtent, dict], + Union[core.ParameterExtent, core._ParameterProtocol, dict], str, ], UndefinedType, @@ -76164,7 +76264,7 @@ def scale( ], Union[core.DomainUnionWith, dict], Union[core.ExprRef, core._ParameterProtocol, dict], - Union[core.ParameterExtent, dict], + Union[core.ParameterExtent, core._ParameterProtocol, dict], str, ], UndefinedType, @@ -79306,7 +79406,11 @@ def bin( binned: Union[bool, UndefinedType] = Undefined, divide: Union[Sequence[float], UndefinedType] = Undefined, extent: Union[ - Union[Sequence[float], Union[core.ParameterExtent, dict], core.BinExtent], + Union[ + Sequence[float], + Union[core.ParameterExtent, core._ParameterProtocol, dict], + core.BinExtent, + ], UndefinedType, ] = Undefined, maxbins: Union[float, UndefinedType] = Undefined, @@ -79373,7 +79477,7 @@ def scale( ], Union[core.DomainUnionWith, dict], Union[core.ExprRef, core._ParameterProtocol, dict], - Union[core.ParameterExtent, dict], + Union[core.ParameterExtent, core._ParameterProtocol, dict], str, ], UndefinedType, @@ -80785,7 +80889,7 @@ def scale( ], Union[core.DomainUnionWith, dict], Union[core.ExprRef, core._ParameterProtocol, dict], - Union[core.ParameterExtent, dict], + Union[core.ParameterExtent, core._ParameterProtocol, dict], str, ], UndefinedType, @@ -82982,7 +83086,11 @@ def bin( binned: Union[bool, UndefinedType] = Undefined, divide: Union[Sequence[float], UndefinedType] = Undefined, extent: Union[ - Union[Sequence[float], Union[core.ParameterExtent, dict], core.BinExtent], + Union[ + Sequence[float], + Union[core.ParameterExtent, core._ParameterProtocol, dict], + core.BinExtent, + ], UndefinedType, ] = Undefined, maxbins: Union[float, UndefinedType] = Undefined, @@ -83073,7 +83181,7 @@ def scale( ], Union[core.DomainUnionWith, dict], Union[core.ExprRef, core._ParameterProtocol, dict], - Union[core.ParameterExtent, dict], + Union[core.ParameterExtent, core._ParameterProtocol, dict], str, ], UndefinedType, @@ -85856,7 +85964,7 @@ def scale( ], Union[core.DomainUnionWith, dict], Union[core.ExprRef, core._ParameterProtocol, dict], - Union[core.ParameterExtent, dict], + Union[core.ParameterExtent, core._ParameterProtocol, dict], str, ], UndefinedType, @@ -88998,7 +89106,11 @@ def bin( binned: Union[bool, UndefinedType] = Undefined, divide: Union[Sequence[float], UndefinedType] = Undefined, extent: Union[ - Union[Sequence[float], Union[core.ParameterExtent, dict], core.BinExtent], + Union[ + Sequence[float], + Union[core.ParameterExtent, core._ParameterProtocol, dict], + core.BinExtent, + ], UndefinedType, ] = Undefined, maxbins: Union[float, UndefinedType] = Undefined, @@ -89065,7 +89177,7 @@ def scale( ], Union[core.DomainUnionWith, dict], Union[core.ExprRef, core._ParameterProtocol, dict], - Union[core.ParameterExtent, dict], + Union[core.ParameterExtent, core._ParameterProtocol, dict], str, ], UndefinedType, @@ -90477,7 +90589,7 @@ def scale( ], Union[core.DomainUnionWith, dict], Union[core.ExprRef, core._ParameterProtocol, dict], - Union[core.ParameterExtent, dict], + Union[core.ParameterExtent, core._ParameterProtocol, dict], str, ], UndefinedType, diff --git a/altair/vegalite/v5/schema/core.py b/altair/vegalite/v5/schema/core.py index 73a4841da..e1b15a200 100644 --- a/altair/vegalite/v5/schema/core.py +++ b/altair/vegalite/v5/schema/core.py @@ -7482,7 +7482,11 @@ def __init__( binned: Union[bool, UndefinedType] = Undefined, divide: Union[Sequence[float], UndefinedType] = Undefined, extent: Union[ - Union["BinExtent", Sequence[float], Union["ParameterExtent", dict]], + Union[ + "BinExtent", + Sequence[float], + Union["ParameterExtent", "_ParameterProtocol", dict], + ], UndefinedType, ] = Undefined, maxbins: Union[float, UndefinedType] = Undefined, @@ -39866,7 +39870,7 @@ def __init__( ], Union["DomainUnionWith", dict], Union["ExprRef", "_ParameterProtocol", dict], - Union["ParameterExtent", dict], + Union["ParameterExtent", "_ParameterProtocol", dict], str, ], UndefinedType, diff --git a/tools/schemapi/utils.py b/tools/schemapi/utils.py index e1b440e59..123b0ab84 100644 --- a/tools/schemapi/utils.py +++ b/tools/schemapi/utils.py @@ -202,6 +202,8 @@ def get_python_type_representation( # but then we would need to write some overload signatures for # api.param). class_names.append("_ParameterProtocol") + if self.title == "ParameterExtent": + class_names.append("_ParameterProtocol") prefix = ( "" if not altair_classes_prefix else altair_classes_prefix + "."