Open hongyi-zhao opened 1 week ago
Thanks very much for the suggestion. I wonder whether an alternative option is to allow a filter function. This could the be extremely flexible about how the filtering is performed.
For example:
# Match jobs containing either "relax" or "static"
flow.update_maker_kwargs(settings, filter_func=lambda job: job.name in ["relax", "static"])
# Match jobs that don't contain "relax"
flow.update_maker_kwargs(settings, filter_func=lambda job: "relax" not in job.name)
What do you think?
@utf Your idea is much better than mine, it is extremely flexible and powerful.
Current Behavior
The
name_filter
parameter currently only supports simple string matching:This basic matching is implemented using string containment (
name_filter in job.name
), which limits filtering capabilities to substring matching only.Proposed Enhancement
Extend the
name_filter
functionality to support:List-based filtering for multiple patterns:
Negative filtering (exclusion):
Implementation Suggestion
Benefits
Questions for Discussion
!pattern
)exclude=True
)Related Work
jobflow/core/job.py
Let me know your thoughts on the proposed enhancements and implementation approach.