Skip to content

Replace the interim Step adapter with real run() parameters #6

Description

@mikub97

The three built-in steps are currently wrapped by an adapter that sets sys.argv and calls the script's own main(). It works and is honest about being interim, but it means:

  • tuning still comes from module-level constants rather than ctx.params(), so it cannot vary per study without editing the source;
  • the step chdirs into the project directory, because the scripts resolve paths relative to the working directory;
  • --window / --step cannot be passed through.

Where

  • packages/dims-analysis/dims_analysis/steps/{rqa,crqa,crosswavelet}.py — the block marked Step contract adapter
  • Contract: docs/contracts/step.md

What to do

Give run(config, ctx) the real work: move the body of main() into it, take paths from ctx, take tuning from ctx.params(), and delete the argparse block and the adapter. Do one step at a time.

This pairs naturally with #5 (deduplicating the helpers), since both touch the same three files.

Acceptance

  • dims-analysis run produces byte-identical output to today for the same input.
  • No step calls os.chdir or reads sys.argv.
  • {"analysis": {"rqa": {"window": 5.0}}} in config.json changes the window.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:analysisPython analysis steps and pipelinereadySelf-contained: names files, links contract, states acceptancetype:choreMaintenance, infrastructure, housekeeping

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions