Skip to content

Commit 244c972

Browse files
committed
remove time_errors
1 parent 3cd6f3f commit 244c972

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

waveform_editor/tendencies/base.py

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,6 @@ class BaseTendency(param.Parameterized):
7474
default=0, doc="Line number of the tendency in the YAML file"
7575
)
7676

77-
time_error = param.ClassSelector(
78-
class_=Exception,
79-
default=None,
80-
doc="Error that occurred when processing user inputs.",
81-
)
82-
8377
def __init__(self, **kwargs):
8478
self.annotations = Annotations()
8579
self.line_number = kwargs.pop("user_line_number")
@@ -182,12 +176,10 @@ def _calc_times(self):
182176

183177
try:
184178
values = solve_with_constraints(inputs, constraint_matrix)
185-
self.time_error = None
186179
except InconsistentInputsError:
187180
# Set error and make duration = 1:
188-
self.time_error = ValueError(
189-
"Inputs are inconsistent: start + duration != end"
190-
)
181+
error_msg = "Inputs are inconsistent: start + duration != end"
182+
self.annotations.add(self.line_number, error_msg)
191183
if self.prev_tendency is None:
192184
values = (0, 1, 1)
193185
else:
@@ -200,9 +192,8 @@ def _calc_times(self):
200192
self.times_changed = True
201193

202194
if self.duration <= 0:
203-
self.time_error = ValueError(
204-
"Tendency end time must be greater than its start time."
205-
)
195+
error_msg = "Tendency end time must be greater than its start time."
196+
self.annotations.add(self.line_number, error_msg)
206197

207198
def _check_for_unknown_kwargs(self, kwargs):
208199
"""Identifies and removes unrecognized keyword arguments, suggesting

0 commit comments

Comments
 (0)