diff --git a/pyproject.toml b/pyproject.toml index ec1303d..1d034d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,7 +31,6 @@ dependencies = [ "sparse>=0.15.4", "statsmodels>=0.14.0", "tqdm>=4.66.1", - "typer>=0.12.3", "cyclopts", "vegafusion[embed]>=1.6.5", "xarray", diff --git a/src/depiction_targeted_preproc/workflow/exp/compare_cluster_stats.py b/src/depiction_targeted_preproc/workflow/exp/compare_cluster_stats.py index 7a73225..2ed230c 100644 --- a/src/depiction_targeted_preproc/workflow/exp/compare_cluster_stats.py +++ b/src/depiction_targeted_preproc/workflow/exp/compare_cluster_stats.py @@ -1,9 +1,7 @@ import altair as alt +import cyclopts import polars as pl -import typer from pathlib import Path -from typer import Option -from typing import Annotated def load_data(csv_paths: list[Path]) -> pl.DataFrame: @@ -14,13 +12,15 @@ def load_data(csv_paths: list[Path]) -> pl.DataFrame: return pl.concat(collect) -def compare_cluster_stats(input_csv_path: list[Path], output_pdf: Annotated[Path, Option()]) -> None: +app = cyclopts.App() + + +@app.default +def compare_cluster_stats(input_csv_path: list[Path], output_pdf: Path) -> None: data = load_data(input_csv_path) chart = alt.Chart(data).mark_bar().encode(x="label", y="value", column="metric").resolve_scale(y="independent") chart.save(output_pdf) if __name__ == "__main__": - typer.run(compare_cluster_stats) - -# print(sys.argv) + app() diff --git a/src/depiction_targeted_preproc/workflow/exp/plot_compare_peak_density.py b/src/depiction_targeted_preproc/workflow/exp/plot_compare_peak_density.py index 5f3b665..121491a 100644 --- a/src/depiction_targeted_preproc/workflow/exp/plot_compare_peak_density.py +++ b/src/depiction_targeted_preproc/workflow/exp/plot_compare_peak_density.py @@ -1,18 +1,18 @@ -from pathlib import Path -from typing import Annotated - +import cyclopts import polars as pl -import typer import vegafusion -from typer import Option, Argument +from pathlib import Path from depiction_targeted_preproc.workflow.qc.plot_peak_density import plot_density_combined_full +app = cyclopts.App() + +@app.default def exp_plot_compare_peak_density( - tables_marker_distances_calib: Annotated[list[Path], Argument()], - table_marker_distance_uncalib: Annotated[Path, Option()], - output_pdf: Annotated[Path, Option()], + tables_marker_distances_calib: list[Path], + table_marker_distance_uncalib: Path, + output_pdf: Path, ) -> None: vegafusion.enable() @@ -28,4 +28,4 @@ def exp_plot_compare_peak_density( if __name__ == "__main__": - typer.run(exp_plot_compare_peak_density) + app() diff --git a/src/depiction_targeted_preproc/workflow/exp/plot_map_comparison.py b/src/depiction_targeted_preproc/workflow/exp/plot_map_comparison.py index b2db6e2..fedd7dd 100644 --- a/src/depiction_targeted_preproc/workflow/exp/plot_map_comparison.py +++ b/src/depiction_targeted_preproc/workflow/exp/plot_map_comparison.py @@ -1,14 +1,15 @@ -import typer +import cyclopts import xarray from matplotlib import pyplot as plt from pathlib import Path -from typing import Annotated + +app = cyclopts.App() @app.default def exp_plot_map_comparison( - input_mass_shift_paths: Annotated[list[Path], typer.Argument()], - output_pdf_path: Annotated[Path, typer.Option()], + input_mass_shift_paths: list[Path], + output_pdf_path: Path, ) -> None: # load all the inputs mass_shifts = [xarray.open_dataarray(path) for path in input_mass_shift_paths] @@ -25,4 +26,4 @@ def exp_plot_map_comparison( if __name__ == "__main__": - typer.run(exp_plot_map_comparison) + app()