-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or requestquestionFurther information is requestedFurther information is requested
Description
Because of the for loop in the __post_init__, it shows the error message but does not show which validation function check that it fails. (I only know one of the methods in the list of self._validate_functions fails.)
Signal-System/src/ss/utility/assertion/validator.py
Lines 36 to 43 in 7f9ad43
| class Validator(metaclass=ValidatorMeta): | |
| def __init__(self) -> None: | |
| self._errors: List[str] = [] | |
| self._validate_functions: List[Callable[[], bool]] = [] | |
| def __post_init__(self) -> None: | |
| for validate in self._validate_functions: | |
| assert validate(), self._errors |
The current error message looks like something as the following:
File "Signal-System/src/ss/utility/callback.py", line 61, in save
filepath = FilePathValidator(filename, ".hdf5").get_filepath()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "Signal-System/src/ss/utility/assertion/validator.py", line 32, in __call__
instance.__post_init__()
File "Signal-System/src/ss/utility/assertion/validator.py", line 43, in __post_init__
assert validate(), self._errors
^^^^^^^^^^
AssertionError: ['some error message']It will be better to show more than just validate() has error.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestquestionFurther information is requestedFurther information is requested