From c9339856c194265d975f3784907798c568384ff1 Mon Sep 17 00:00:00 2001 From: YooSunyoung Date: Fri, 1 Nov 2024 10:55:07 +0100 Subject: [PATCH] Add comments. --- src/scicat_dataset.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/scicat_dataset.py b/src/scicat_dataset.py index 6f67b46..b10fad7 100644 --- a/src/scicat_dataset.py +++ b/src/scicat_dataset.py @@ -103,6 +103,13 @@ def convert_to_type(input_value: Any, dtype_desc: str) -> Any: ast.literal_eval(value) if isinstance(value, str) else value ), # "evaluate": lambda value: ast.literal_eval(value), + # We are not adding the evaluate function here since + # ``evaluate`` function should be avoided if possible. + # It might seem easy to use, but it is very easy to break + # when the input is not as expected. + # It is better to use the specific converters for the types. + # However, if it is the only way to go, you can add it here. + # Please add a comment to explain why it is needed. "filename": lambda value: os.path.basename(value), "dirname": lambda value: os.path.dirname(value), "dirname-2": lambda value: os.path.dirname(os.path.dirname(value)),