Skip to content

Commit

Permalink
remove remaining usage of typer
Browse files Browse the repository at this point in the history
  • Loading branch information
leoschwarz committed Oct 25, 2024
1 parent 5e9327a commit 714ca3c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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()
Original file line number Diff line number Diff line change
@@ -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()

Expand All @@ -28,4 +28,4 @@ def exp_plot_compare_peak_density(


if __name__ == "__main__":
typer.run(exp_plot_compare_peak_density)
app()
Original file line number Diff line number Diff line change
@@ -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]
Expand All @@ -25,4 +26,4 @@ def exp_plot_map_comparison(


if __name__ == "__main__":
typer.run(exp_plot_map_comparison)
app()

0 comments on commit 714ca3c

Please sign in to comment.