From e56aecc92fc73a0174717ff92c24053006cf7b4b Mon Sep 17 00:00:00 2001 From: esoteric-ephemera Date: Tue, 17 Dec 2024 11:28:24 -0800 Subject: [PATCH 1/2] Change default behavior of update_metadata callback_filter --- src/jobflow/core/flow.py | 4 ++-- src/jobflow/core/job.py | 4 ++-- src/jobflow/utils/uuid.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/jobflow/core/flow.py b/src/jobflow/core/flow.py index 168ca8fb..7d3c1899 100644 --- a/src/jobflow/core/flow.py +++ b/src/jobflow/core/flow.py @@ -617,7 +617,7 @@ def update_metadata( function_filter: Callable = None, dict_mod: bool = False, dynamic: bool = True, - callback_filter: Callable[[Flow | Job], bool] = lambda _: True, + callback_filter: Callable[[Flow | Job], bool] | None = None, ): """ Update the metadata of the Flow and/or its Jobs. @@ -681,7 +681,7 @@ def update_metadata( callback_filter=callback_filter, ) - if callback_filter(self) is False: + if callback_filter is not None and callback_filter(self) is False: return if dict_mod: diff --git a/src/jobflow/core/job.py b/src/jobflow/core/job.py index f18eea63..be630627 100644 --- a/src/jobflow/core/job.py +++ b/src/jobflow/core/job.py @@ -926,7 +926,7 @@ def update_metadata( function_filter: Callable = None, dict_mod: bool = False, dynamic: bool = True, - callback_filter: Callable[[jobflow.Flow | Job], bool] = lambda _: True, + callback_filter: Callable[[jobflow.Flow | Job], bool] | None = None, ): """ Update the metadata of the job. @@ -1006,7 +1006,7 @@ def update_metadata( ): return - if callback_filter(self) is False: + if callback_filter is not None and callback_filter(self) is False: return # if we get to here then we pass all the filters diff --git a/src/jobflow/utils/uuid.py b/src/jobflow/utils/uuid.py index f822d932..ec6c1650 100644 --- a/src/jobflow/utils/uuid.py +++ b/src/jobflow/utils/uuid.py @@ -4,7 +4,7 @@ @deprecated( - message="The UUID system will be replace with UID that contains both UUID and ULID." + message="The UUID system will be replaced with a UID that contains both the UUID and ULID." ) def suuid() -> str: """ From 35aee12b06f6c2921a6899e11ecc169b5b8ce76f Mon Sep 17 00:00:00 2001 From: esoteric-ephemera Date: Tue, 17 Dec 2024 11:36:00 -0800 Subject: [PATCH 2/2] precommit --- src/jobflow/utils/uuid.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/jobflow/utils/uuid.py b/src/jobflow/utils/uuid.py index ec6c1650..93c5ecf3 100644 --- a/src/jobflow/utils/uuid.py +++ b/src/jobflow/utils/uuid.py @@ -4,7 +4,10 @@ @deprecated( - message="The UUID system will be replaced with a UID that contains both the UUID and ULID." + message=( + "The UUID system will be replaced with a UID that " + "contains both the UUID and ULID." + ) ) def suuid() -> str: """