Skip to content

Commit

Permalink
Merge pull request #1 from ChrisgKent/dev
Browse files Browse the repository at this point in the history
Improved output file error handling
  • Loading branch information
ChrisgKent authored Nov 6, 2024
2 parents def5135 + 35be880 commit 41d279e
Show file tree
Hide file tree
Showing 5 changed files with 577 additions and 416 deletions.
16 changes: 16 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.4.1
hooks:
# Run the linter.
- id: ruff
args: [--fix, --show-fixes]
# Run the formatter.
- id: ruff-format
- repo: https://github.com/python-poetry/poetry
rev: "1.8.3" # add version here
hooks:
- id: poetry-check
- id: poetry-lock
- id: poetry-install
2 changes: 1 addition & 1 deletion bed2idt/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.2.0"
__version__ = "1.2.1"
16 changes: 10 additions & 6 deletions bed2idt/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
from bed2idt.config import PlateFillBy, PlateSplitBy, TubePurification, TubeScale

# Create the typer app
app = typer.Typer(name="bed2idt", no_args_is_help=True)
app = typer.Typer(
name="bed2idt", no_args_is_help=True, pretty_exceptions_show_locals=False
)


def chunks(lst, n):
Expand Down Expand Up @@ -91,7 +93,7 @@ def plates_go(
# If only one pool complain
if len(all_refs) <= 1:
raise typer.BadParameter(
"To few referances to split by. Please use other --splitby option"
"To few references to split by. Please use other --splitby option"
)

plates = [[] for _ in all_refs]
Expand Down Expand Up @@ -186,7 +188,7 @@ def common(
pass


@app.command()
@app.command(no_args_is_help=True)
def plates(
bedfile: Annotated[
pathlib.Path,
Expand All @@ -198,11 +200,12 @@ def plates(
help="The output location of the file. Defaults to output.xlsx",
writable=True,
callback=append_xlsx,
dir_okay=False,
),
] = pathlib.Path("output.xlsx"),
splitby: Annotated[
PlateSplitBy,
typer.Option(help="Should the primers be split across differant plate"),
typer.Option(help="Should the primers be split across different plate"),
] = PlateSplitBy.POOL.value, # type: ignore
fillby: Annotated[
PlateFillBy, typer.Option(help="How should the plate be filled")
Expand Down Expand Up @@ -235,7 +238,7 @@ def plates(
plates_go(primer_list, workbook, splitby, fillby, plateprefix, randomise)


@app.command()
@app.command(no_args_is_help=True)
def tubes(
bedfile: Annotated[
pathlib.Path, typer.Argument(help="The path to the bed file", readable=True)
Expand All @@ -246,10 +249,11 @@ def tubes(
help="The output location of the file. Defaults to output.xlsx",
writable=True,
callback=append_xlsx,
dir_okay=False,
),
] = pathlib.Path("output.xlsx"),
scale: Annotated[
TubeScale, typer.Option(help="The conc of the primers")
TubeScale, typer.Option(help="The concentration of the primers")
] = TubeScale.NM25.value, # type: ignore
purification: Annotated[
TubePurification, typer.Option(help="The purification of the primers")
Expand Down
Loading

0 comments on commit 41d279e

Please sign in to comment.