Skip to content

Improve readability of setting pipeflow options #713

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

dad616610
Copy link

Improve readability and maintainability of pipeflow_setup

This PR simplifies the pipeflow initialization logic by:

  1. Making deepcopy operations explicit and singular

    • Replaces hidden deepcopies in _iteration_check and _check_mode
    • Eliminates duplicate copying by centralizing the operation
  2. Clarifying option precedence

    • Uses explicit {**a, **b} syntax for option merging
    • Clearly defines overwrite order
  3. Removing redundant parameters

    • Deletes unused default parameters from pipeflow function definition
    • (Parameters were always overwritten by locals())
  4. Applying DRY principle

    • Replaces repetitive branching in _iteration_check with loop logic
    • Reduces code duplication across mode checks

Additional improvements:

  • Added tests for _iteration_check functionality

Planned follow-up work (separate PRs):

  1. Replace logging.* calls with warnings.warn for:

    • More appropriate user notifications
    • Single-session message suppression
    • Standard Python warning controls
  2. Add parameter validation in init_options to:

    • Surface incorrect values earlier
    • Provide precise error location
    • Improve debugging feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant