| 877 | self.array_ok = array_ok |
| 878 | |
| 879 | def description(self): |
| 880 | desc = """\ |
| 881 | The '{plotly_name}' property is an integer and may be specified as:""".format( |
| 882 | plotly_name=self.plotly_name |
| 883 | ) |
| 884 | |
| 885 | if not self.has_min_max: |
| 886 | desc = ( |
| 887 | desc |
| 888 | + """ |
| 889 | - An int (or float that will be cast to an int)""" |
| 890 | ) |
| 891 | else: |
| 892 | desc = desc + ( |
| 893 | """ |
| 894 | - An int (or float that will be cast to an int) |
| 895 | in the interval [{min_val}, {max_val}]""".format( |
| 896 | min_val=self.min_val, max_val=self.max_val |
| 897 | ) |
| 898 | ) |
| 899 | |
| 900 | # Extras |
| 901 | if self.extras: |
| 902 | desc = desc + ( |
| 903 | """ |
| 904 | OR exactly one of {extras} (e.g. '{eg_extra}')""" |
| 905 | ).format(extras=self.extras, eg_extra=self.extras[-1]) |
| 906 | |
| 907 | if self.array_ok: |
| 908 | desc = ( |
| 909 | desc |
| 910 | + """ |
| 911 | - A tuple, list, or one-dimensional numpy array of the above""" |
| 912 | ) |
| 913 | |
| 914 | return desc |
| 915 | |
| 916 | def validate_coerce(self, v): |
| 917 | if is_none_or_typed_array_spec(v): |