Skip to content

Commit 3aae838

Browse files
committed
Rename behaviour to behavior
1 parent fa82052 commit 3aae838

File tree

9 files changed

+39
-39
lines changed

9 files changed

+39
-39
lines changed

docs/source/examples/Output Widget.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@
350350
"\n",
351351
"This always prints in the currently active cell, not the cell that started the background thread.\n",
352352
"\n",
353-
"This can lead to surprising behaviour in output widgets. During the time in which output is captured by the output widget, *any* output generated in the notebook, regardless of thread, will go into the output widget.\n",
353+
"This can lead to surprising behavior in output widgets. During the time in which output is captured by the output widget, *any* output generated in the notebook, regardless of thread, will go into the output widget.\n",
354354
"\n",
355355
"The best way to avoid surprises is to *never* use an output widget's context manager in a context where multiple threads generate output. Instead, we can pass an output widget to the function executing in a thread, and use `append_display_data()`, `append_stdout()`, or `append_stderr()` methods to append displayable output to the output widget."
356356
]

docs/source/examples/Widget Styling.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@
336336
"\n",
337337
"#### align-items\n",
338338
"\n",
339-
"`align-items` can be one of `flex-start`, `flex-end`, `center`, `baseline`, `stretch`. This defines the default behaviour for how flex items are laid out along the cross axis on the current line. Think of it as the justify-content version for the cross-axis (perpendicular to the main-axis).\n",
339+
"`align-items` can be one of `flex-start`, `flex-end`, `center`, `baseline`, `stretch`. This defines the default behavior for how flex items are laid out along the cross axis on the current line. Think of it as the justify-content version for the cross-axis (perpendicular to the main-axis).\n",
340340
" ![Items](./images/align-items.svg)\n",
341341
" \n",
342342
"#### align-content\n",

ipywidgets/widgets/widget_float.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ class FloatSlider(_BoundedFloat):
159159
default is 'horizontal', orientation of the slider
160160
readout : {True, False}
161161
default is True, display the current value of the slider next to it
162-
behaviour : str
163-
slider handle and connector dragging behaviour. Default is 'drag-tap'.
162+
behavior : str
163+
slider handle and connector dragging behavior. Default is 'drag-tap'.
164164
readout_format : str
165165
default is '.2f', specifier for the format function used to represent
166166
slider value for human consumption, modeled after Python 3's format
@@ -177,8 +177,8 @@ class FloatSlider(_BoundedFloat):
177177
continuous_update = Bool(True, help="Update the value of the widget as the user is holding the slider.").tag(sync=True)
178178
disabled = Bool(False, help="Enable or disable user changes").tag(sync=True)
179179
style = InstanceDict(SliderStyle).tag(sync=True, **widget_serialization)
180-
behaviour = CaselessStrEnum(values=['drag-tap', 'drag-snap', 'tap', 'drag', 'snap'],
181-
default_value='drag-tap', help="Slider dragging behaviour.").tag(sync=True)
180+
behavior = CaselessStrEnum(values=['drag-tap', 'drag-snap', 'tap', 'drag', 'snap'],
181+
default_value='drag-tap', help="Slider dragging behavior.").tag(sync=True)
182182

183183

184184
@register
@@ -203,8 +203,8 @@ class FloatLogSlider(_BoundedLogFloat):
203203
default is 'horizontal', orientation of the slider
204204
readout : {True, False}
205205
default is True, display the current value of the slider next to it
206-
behaviour : str
207-
slider handle and connector dragging behaviour. Default is 'drag-tap'.
206+
behavior : str
207+
slider handle and connector dragging behavior. Default is 'drag-tap'.
208208
readout_format : str
209209
default is '.3g', specifier for the format function used to represent
210210
slider value for human consumption, modeled after Python 3's format
@@ -222,8 +222,8 @@ class FloatLogSlider(_BoundedLogFloat):
222222
disabled = Bool(False, help="Enable or disable user changes").tag(sync=True)
223223
base = CFloat(10., help="Base for the logarithm").tag(sync=True)
224224
style = InstanceDict(SliderStyle).tag(sync=True, **widget_serialization)
225-
behaviour = CaselessStrEnum(values=['drag-tap', 'drag-snap', 'tap', 'drag', 'snap'],
226-
default_value='drag-tap', help="Slider dragging behaviour.").tag(sync=True)
225+
behavior = CaselessStrEnum(values=['drag-tap', 'drag-snap', 'tap', 'drag', 'snap'],
226+
default_value='drag-tap', help="Slider dragging behavior.").tag(sync=True)
227227

228228

229229
@register
@@ -349,8 +349,8 @@ class FloatRangeSlider(_BoundedFloatRange):
349349
default is 'horizontal'
350350
readout : {True, False}
351351
default is True, display the current value of the slider next to it
352-
behaviour : str
353-
slider handle and connector dragging behaviour. Default is 'drag-tap'.
352+
behavior : str
353+
slider handle and connector dragging behavior. Default is 'drag-tap'.
354354
readout_format : str
355355
default is '.2f', specifier for the format function used to represent
356356
slider value for human consumption, modeled after Python 3's format
@@ -367,5 +367,5 @@ class FloatRangeSlider(_BoundedFloatRange):
367367
continuous_update = Bool(True, help="Update the value of the widget as the user is sliding the slider.").tag(sync=True)
368368
disabled = Bool(False, help="Enable or disable user changes").tag(sync=True)
369369
style = InstanceDict(SliderStyle).tag(sync=True, **widget_serialization)
370-
behaviour = CaselessStrEnum(values=['drag-tap', 'drag-snap', 'tap', 'drag', 'snap'],
371-
default_value='drag-tap', help="Slider dragging behaviour.").tag(sync=True)
370+
behavior = CaselessStrEnum(values=['drag-tap', 'drag-snap', 'tap', 'drag', 'snap'],
371+
default_value='drag-tap', help="Slider dragging behavior.").tag(sync=True)

ipywidgets/widgets/widget_int.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
The upper limit for the value.
3535
step: integer
3636
The step between allowed values.
37-
behaviour : str
38-
slider handle and connector dragging behaviour. Default is 'drag-tap'.
37+
behavior : str
38+
slider handle and connector dragging behavior. Default is 'drag-tap'.
3939
"""
4040

4141
def _int_doc(cls):
@@ -168,8 +168,8 @@ class IntSlider(_BoundedInt):
168168
continuous_update = Bool(True, help="Update the value of the widget as the user is holding the slider.").tag(sync=True)
169169
disabled = Bool(False, help="Enable or disable user changes").tag(sync=True)
170170
style = InstanceDict(SliderStyle).tag(sync=True, **widget_serialization)
171-
behaviour = CaselessStrEnum(values=['drag-tap', 'drag-snap', 'tap', 'drag', 'snap'],
172-
default_value='drag-tap', help="Slider dragging behaviour.").tag(sync=True)
171+
behavior = CaselessStrEnum(values=['drag-tap', 'drag-snap', 'tap', 'drag', 'snap'],
172+
default_value='drag-tap', help="Slider dragging behavior.").tag(sync=True)
173173

174174

175175
@register
@@ -300,8 +300,8 @@ class IntRangeSlider(_BoundedIntRange):
300300
default is 'horizontal'
301301
readout : {True, False}
302302
default is True, display the current value of the slider next to it
303-
behaviour : str
304-
slider handle and connector dragging behaviour. Default is 'drag-tap'.
303+
behavior : str
304+
slider handle and connector dragging behavior. Default is 'drag-tap'.
305305
readout_format : str
306306
default is '.2f', specifier for the format function used to represent
307307
slider value for human consumption, modeled after Python 3's format
@@ -318,5 +318,5 @@ class IntRangeSlider(_BoundedIntRange):
318318
continuous_update = Bool(True, help="Update the value of the widget as the user is sliding the slider.").tag(sync=True)
319319
style = InstanceDict(SliderStyle, help="Slider style customizations.").tag(sync=True, **widget_serialization)
320320
disabled = Bool(False, help="Enable or disable user changes").tag(sync=True)
321-
behaviour = CaselessStrEnum(values=['drag-tap', 'drag-snap', 'tap', 'drag', 'snap'],
322-
default_value='drag-tap', help="Slider dragging behaviour.").tag(sync=True)
321+
behavior = CaselessStrEnum(values=['drag-tap', 'drag-snap', 'tap', 'drag', 'snap'],
322+
default_value='drag-tap', help="Slider dragging behavior.").tag(sync=True)

ipywidgets/widgets/widget_selection.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -573,8 +573,8 @@ class SelectionSlider(_SelectionNonempty):
573573
help="Display the current selected label next to the slider").tag(sync=True)
574574
continuous_update = Bool(True,
575575
help="Update the value of the widget as the user is holding the slider.").tag(sync=True)
576-
behaviour = CaselessStrEnum(values=['drag-tap', 'drag-snap', 'tap', 'drag', 'snap'],
577-
default_value='drag-tap', help="Slider dragging behaviour.").tag(sync=True)
576+
behavior = CaselessStrEnum(values=['drag-tap', 'drag-snap', 'tap', 'drag', 'snap'],
577+
default_value='drag-tap', help="Slider dragging behavior.").tag(sync=True)
578578

579579
style = InstanceDict(SliderStyle).tag(sync=True, **widget_serialization)
580580

@@ -629,5 +629,5 @@ def _validate_index(self, proposal):
629629
help="Update the value of the widget as the user is holding the slider.").tag(sync=True)
630630

631631
style = InstanceDict(SliderStyle).tag(sync=True, **widget_serialization)
632-
behaviour = CaselessStrEnum(values=['drag-tap', 'drag-snap', 'tap', 'drag', 'snap'],
633-
default_value='drag-tap', help="Slider dragging behaviour.").tag(sync=True)
632+
behavior = CaselessStrEnum(values=['drag-tap', 'drag-snap', 'tap', 'drag', 'snap'],
633+
default_value='drag-tap', help="Slider dragging behavior.").tag(sync=True)

packages/controls/src/widget_float.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,11 @@ export class FloatLogSliderView extends BaseIntSliderView {
147147

148148
createSlider(): void {
149149
const orientation = this.model.get('orientation');
150-
const behaviour = this.model.get('behaviour');
150+
const behavior = this.model.get('behavior');
151151

152152
noUiSlider.create(this.$slider, {
153153
start: this.logCalc(this.model.get('value')),
154-
behaviour: behaviour,
154+
behaviour: behavior,
155155
range: {
156156
min: this.model.get('min'),
157157
max: this.model.get('max'),

packages/controls/src/widget_int.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,12 @@ export abstract class BaseIntSliderView extends DescriptionView {
203203
*/
204204
createSlider(): void {
205205
const orientation = this.model.get('orientation');
206-
const behaviour = this.model.get('behaviour');
206+
const behavior = this.model.get('behavior');
207207

208208
noUiSlider.create(this.$slider, {
209209
start: this.model.get('value'),
210210
connect: true,
211-
behaviour: behaviour,
211+
behaviour: behavior,
212212
range: {
213213
min: this.model.get('min'),
214214
max: this.model.get('max'),

packages/controls/src/widget_selection.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -746,12 +746,12 @@ export class SelectionSliderView extends DescriptionView {
746746
const min = 0;
747747
const max = labels.length - 1;
748748
const orientation = this.model.get('orientation');
749-
const behaviour = this.model.get('behaviour');
749+
const behavior = this.model.get('behavior');
750750

751751
noUiSlider.create(this.$slider, {
752752
start: this.model.get('index'),
753753
connect: true,
754-
behaviour: behaviour,
754+
behaviour: behavior,
755755
range: {
756756
min: min,
757757
max: max,

packages/schema/jupyterwidgetmodels.latest.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ Attribute | Type | Default | Help
509509
`_view_module_version` | string | `'2.0.0'` |
510510
`_view_name` | string | `'FloatLogSliderView'` |
511511
`base` | number (float) | `10.0` | Base for the logarithm
512-
`behaviour` | string (one of `'drag-tap'`, `'drag-snap'`, `'tap'`, `'drag'`, `'snap'`) | `'drag-tap'` | Slider dragging behaviour.
512+
`behavior` | string (one of `'drag-tap'`, `'drag-snap'`, `'tap'`, `'drag'`, `'snap'`) | `'drag-tap'` | Slider dragging behavior.
513513
`continuous_update` | boolean | `true` | Update the value of the widget as the user is holding the slider.
514514
`description` | string | `''` | Description of the control.
515515
`description_allow_html` | boolean | `false` | Accept HTML in the description.
@@ -560,7 +560,7 @@ Attribute | Type | Default | Help
560560
`_view_module` | string | `'@jupyter-widgets/controls'` |
561561
`_view_module_version` | string | `'2.0.0'` |
562562
`_view_name` | string | `'FloatRangeSliderView'` |
563-
`behaviour` | string (one of `'drag-tap'`, `'drag-snap'`, `'tap'`, `'drag'`, `'snap'`) | `'drag-tap'` | Slider dragging behaviour.
563+
`behavior` | string (one of `'drag-tap'`, `'drag-snap'`, `'tap'`, `'drag'`, `'snap'`) | `'drag-tap'` | Slider dragging behavior.
564564
`continuous_update` | boolean | `true` | Update the value of the widget as the user is sliding the slider.
565565
`description` | string | `''` | Description of the control.
566566
`description_allow_html` | boolean | `false` | Accept HTML in the description.
@@ -588,7 +588,7 @@ Attribute | Type | Default | Help
588588
`_view_module` | string | `'@jupyter-widgets/controls'` |
589589
`_view_module_version` | string | `'2.0.0'` |
590590
`_view_name` | string | `'FloatSliderView'` |
591-
`behaviour` | string (one of `'drag-tap'`, `'drag-snap'`, `'tap'`, `'drag'`, `'snap'`) | `'drag-tap'` | Slider dragging behaviour.
591+
`behavior` | string (one of `'drag-tap'`, `'drag-snap'`, `'tap'`, `'drag'`, `'snap'`) | `'drag-tap'` | Slider dragging behavior.
592592
`continuous_update` | boolean | `true` | Update the value of the widget as the user is holding the slider.
593593
`description` | string | `''` | Description of the control.
594594
`description_allow_html` | boolean | `false` | Accept HTML in the description.
@@ -810,7 +810,7 @@ Attribute | Type | Default | Help
810810
`_view_module` | string | `'@jupyter-widgets/controls'` |
811811
`_view_module_version` | string | `'2.0.0'` |
812812
`_view_name` | string | `'IntRangeSliderView'` |
813-
`behaviour` | string (one of `'drag-tap'`, `'drag-snap'`, `'tap'`, `'drag'`, `'snap'`) | `'drag-tap'` | Slider dragging behaviour.
813+
`behavior` | string (one of `'drag-tap'`, `'drag-snap'`, `'tap'`, `'drag'`, `'snap'`) | `'drag-tap'` | Slider dragging behavior.
814814
`continuous_update` | boolean | `true` | Update the value of the widget as the user is sliding the slider.
815815
`description` | string | `''` | Description of the control.
816816
`description_allow_html` | boolean | `false` | Accept HTML in the description.
@@ -838,7 +838,7 @@ Attribute | Type | Default | Help
838838
`_view_module` | string | `'@jupyter-widgets/controls'` |
839839
`_view_module_version` | string | `'2.0.0'` |
840840
`_view_name` | string | `'IntSliderView'` |
841-
`behaviour` | string (one of `'drag-tap'`, `'drag-snap'`, `'tap'`, `'drag'`, `'snap'`) | `'drag-tap'` | Slider dragging behaviour.
841+
`behavior` | string (one of `'drag-tap'`, `'drag-snap'`, `'tap'`, `'drag'`, `'snap'`) | `'drag-tap'` | Slider dragging behavior.
842842
`continuous_update` | boolean | `true` | Update the value of the widget as the user is holding the slider.
843843
`description` | string | `''` | Description of the control.
844844
`description_allow_html` | boolean | `false` | Accept HTML in the description.
@@ -1117,7 +1117,7 @@ Attribute | Type | Default | Help
11171117
`_view_module` | string | `'@jupyter-widgets/controls'` |
11181118
`_view_module_version` | string | `'2.0.0'` |
11191119
`_view_name` | string | `'SelectionRangeSliderView'` |
1120-
`behaviour` | string (one of `'drag-tap'`, `'drag-snap'`, `'tap'`, `'drag'`, `'snap'`) | `'drag-tap'` | Slider dragging behaviour.
1120+
`behavior` | string (one of `'drag-tap'`, `'drag-snap'`, `'tap'`, `'drag'`, `'snap'`) | `'drag-tap'` | Slider dragging behavior.
11211121
`continuous_update` | boolean | `true` | Update the value of the widget as the user is holding the slider.
11221122
`description` | string | `''` | Description of the control.
11231123
`description_allow_html` | boolean | `false` | Accept HTML in the description.
@@ -1142,7 +1142,7 @@ Attribute | Type | Default | Help
11421142
`_view_module` | string | `'@jupyter-widgets/controls'` |
11431143
`_view_module_version` | string | `'2.0.0'` |
11441144
`_view_name` | string | `'SelectionSliderView'` |
1145-
`behaviour` | string (one of `'drag-tap'`, `'drag-snap'`, `'tap'`, `'drag'`, `'snap'`) | `'drag-tap'` | Slider dragging behaviour.
1145+
`behavior` | string (one of `'drag-tap'`, `'drag-snap'`, `'tap'`, `'drag'`, `'snap'`) | `'drag-tap'` | Slider dragging behavior.
11461146
`continuous_update` | boolean | `true` | Update the value of the widget as the user is holding the slider.
11471147
`description` | string | `''` | Description of the control.
11481148
`description_allow_html` | boolean | `false` | Accept HTML in the description.

0 commit comments

Comments
 (0)