Skip to content

Commit 2928250

Browse files
committed
Revert "Enhance parameter defaults in various datasets (strict validation)"
This reverts commit 30fb9b6.
1 parent 0d3aea9 commit 2928250

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

plotpy/styles/image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ class MaskedImageParamMixin(DataSet):
433433
"""Mixin for masked image parameters."""
434434

435435
g_mask = BeginGroup(_("Mask"))
436-
filling_value = FloatItem(_("Filling value"), allow_none=True)
436+
filling_value = FloatItem(_("Filling value"))
437437
show_mask = BoolItem(_("Show image mask"), default=False)
438438
alpha_masked = FloatItem(_("Masked area alpha"), default=0.7, min=0, max=1)
439439
alpha_unmasked = FloatItem(_("Unmasked area alpha"), default=0.0, min=0, max=1)

plotpy/styles/label.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class LabelParam(DataSet):
4747
___cont = BeginGroup(_("Contents")).set_prop(
4848
"display", icon="label.png", hide=GetAttrProp("_no_contents")
4949
)
50-
contents = TextItem("", "").set_prop("display", hide=GetAttrProp("_no_contents"))
50+
contents = TextItem("").set_prop("display", hide=GetAttrProp("_no_contents"))
5151
___econt = EndGroup(_("Contents")).set_prop(
5252
"display", hide=GetAttrProp("_no_contents")
5353
)

plotpy/tools/image.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -447,11 +447,9 @@ def update_status(self, plot: BasePlot) -> None:
447447
class AspectRatioParam(DataSet):
448448
"""Dataset containing aspect ratio parameters."""
449449

450-
lock = BoolItem(_("Lock aspect ratio"), default=True)
451-
current = FloatItem(_("Current value"), default=1.0).set_prop(
452-
"display", active=False
453-
)
454-
ratio = FloatItem(_("Lock value"), min=1e-3, default=1.0)
450+
lock = BoolItem(_("Lock aspect ratio"))
451+
current = FloatItem(_("Current value")).set_prop("display", active=False)
452+
ratio = FloatItem(_("Lock value"), min=1e-3)
455453

456454

457455
class AspectRatioTool(CommandTool):

plotpy/widgets/fit.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@
8383
class AutoFitParam(DataSet):
8484
"""Automatic fit parameters"""
8585

86-
xmin = FloatItem("xmin", default=0.0)
87-
xmax = FloatItem("xmax", default=1.0)
86+
xmin = FloatItem("xmin")
87+
xmax = FloatItem("xmax")
8888
method = ChoiceItem(
8989
_("Method"),
9090
[
@@ -99,7 +99,7 @@ class AutoFitParam(DataSet):
9999
)
100100
err_norm = StringItem(
101101
"enorm",
102-
default="2.0",
102+
default=2.0,
103103
help=_("for simplex, powel, cg and bfgs norm used by the error function"),
104104
)
105105
xtol = FloatItem(
@@ -117,7 +117,7 @@ class AutoFitParam(DataSet):
117117
class FitParamDataSet(DataSet):
118118
"""Fit parameter dataset"""
119119

120-
name = StringItem(_("Name"), default="")
120+
name = StringItem(_("Name"))
121121
value = FloatItem(_("Value"), default=0.0)
122122
min = FloatItem(_("Min"), default=-1.0)
123123
max = FloatItem(_("Max"), default=1.0).set_pos(col=1)

0 commit comments

Comments
 (0)