|
14 | 14 | if str(SRC_PATH) not in sys.path: |
15 | 15 | sys.path.insert(0, str(SRC_PATH)) |
16 | 16 |
|
17 | | -from patchseq_pipeline.analysis.feature_selection import summarize_feature_importance |
18 | | -from patchseq_pipeline.config import load_config |
19 | | -from patchseq_pipeline.viz.figures import generate_all_figures |
| 17 | +# Project imports deferred into the CLI handler to avoid E402. |
20 | 18 |
|
21 | 19 | logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s %(message)s") |
22 | 20 |
|
|
26 | 24 | @app.command() |
27 | 25 | def run( |
28 | 26 | config_path: Path = typer.Option( |
29 | | - Path("config/config.yaml"), "--config", "-c", help="Path to config YAML." |
| 27 | + Path("config/config.yaml"), "--config", "-c", help="Path to config YAML." # noqa: B008 |
30 | 28 | ), |
31 | 29 | processed_path: Path = typer.Option( |
32 | | - Path("data/processed/patchseq_processed.h5ad"), |
| 30 | + Path("data/processed/patchseq_processed.h5ad"), # noqa: B008 |
33 | 31 | "--processed", |
34 | 32 | "-p", |
35 | 33 | help="Processed AnnData file.", |
36 | 34 | ), |
37 | 35 | models_dir: Path = typer.Option( |
38 | | - Path("results/models"), |
| 36 | + Path("results/models"), # noqa: B008 |
39 | 37 | "--models-dir", |
40 | 38 | "-m", |
41 | 39 | help="Directory containing trained models.", |
42 | 40 | ), |
43 | 41 | output_dir: Path = typer.Option( |
44 | | - Path("results/figures"), |
| 42 | + Path("results/figures"), # noqa: B008 |
45 | 43 | "--output-dir", |
46 | 44 | "-o", |
47 | 45 | help="Destination directory for figures.", |
48 | 46 | ), |
49 | 47 | ) -> None: |
50 | 48 | """Generate all figures and save them to the configured output directory.""" |
| 49 | + # Local imports to avoid module-level imports after top-level code |
| 50 | + from patchseq_pipeline.analysis.feature_selection import summarize_feature_importance |
| 51 | + from patchseq_pipeline.config import load_config |
| 52 | + from patchseq_pipeline.viz.figures import generate_all_figures |
| 53 | + |
51 | 54 | config = load_config(config_path) |
52 | 55 | config["figures"]["output_dir"] = str(output_dir) |
53 | 56 | summary_csv = summarize_feature_importance(models_dir, config, output_dir) |
|
0 commit comments