Skip to content

Commit b5851fd

Browse files
committed
Disambiguate the FloatProgress and IntProgress widgets.
Fixes jupyter-widgets#1256.
1 parent d85f5a9 commit b5851fd

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

ipywidgets/widgets/widget_float.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ class FloatProgress(_BoundedFloat):
160160
colors are: 'success'-green, 'info'-light blue, 'warning'-orange, 'danger'-red
161161
"""
162162
_view_name = Unicode('ProgressView').tag(sync=True)
163-
_model_name = Unicode('ProgressModel').tag(sync=True)
163+
_model_name = Unicode('FloatProgressModel').tag(sync=True)
164164
orientation = CaselessStrEnum(values=['horizontal', 'vertical'],
165165
default_value='horizontal', help="Vertical or horizontal.").tag(sync=True)
166166

ipywidgets/widgets/widget_int.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ class IntProgress(_BoundedInt):
179179
"""Progress bar that represents an integer bounded from above and below.
180180
"""
181181
_view_name = Unicode('ProgressView').tag(sync=True)
182-
_model_name = Unicode('ProgressModel').tag(sync=True)
182+
_model_name = Unicode('IntProgressModel').tag(sync=True)
183183
orientation = CaselessStrEnum(values=['horizontal', 'vertical'],
184184
default_value='horizontal', help="Vertical or horizontal.").tag(sync=True)
185185

jupyter-js-widgets/src/widget_float.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class FloatTextModel extends FloatModel {
112112
}
113113

114114
export
115-
class BoundedFloatTextModel extends FloatTextModel {
115+
class BoundedFloatTextModel extends BoundedFloatModel {
116116
defaults() {
117117
return _.extend(super.defaults(), {
118118
_model_name: "BoundedFloatTextModel",
@@ -125,3 +125,16 @@ export
125125
class FloatTextView extends IntTextView {
126126
_parse_value = parseFloat;
127127
}
128+
129+
export
130+
class FloatProgressModel extends BoundedFloatModel {
131+
defaults() {
132+
return _.extend(super.defaults(), {
133+
_model_name: 'FloatProgressModel',
134+
_view_name: 'ProgressView',
135+
orientation: 'horizontal',
136+
bar_style: '',
137+
style: void 0
138+
});
139+
}
140+
}

jupyter-js-widgets/src/widget_int.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,10 +604,10 @@ class ProgressStyleModel extends StyleModel {
604604

605605

606606
export
607-
class ProgressModel extends BoundedIntModel {
607+
class IntProgressModel extends BoundedIntModel {
608608
defaults() {
609609
return _.extend(super.defaults(), {
610-
_model_name: 'ProgressModel',
610+
_model_name: 'IntProgressModel',
611611
_view_name: 'ProgressView',
612612
orientation: 'horizontal',
613613
bar_style: '',

0 commit comments

Comments
 (0)