[main] adding logging

This commit is contained in:
wendtalexander 2025-10-19 10:09:00 +02:00
parent 2e86edd639
commit 2c5deb17f1

View File

@ -1,5 +1,6 @@
import logging
from pathlib import Path
from typing import Annotated
import nixio
import typer
@ -12,7 +13,6 @@ from oephys2nix.tonix import RawToNix
app = typer.Typer()
log = logging.getLogger(__name__)
setup_logging(log, level="DEBUG")
console = Console()
@ -30,8 +30,11 @@ def main(
ttl: bool = typer.Option(default=True, help="For recordings that did not have a ttl pulse"),
overwrite: bool = typer.Option(default=True, help="Overwrites nix file"),
debug: bool = typer.Option(default=True, help="Shows more information and plots the results"),
verbose: Annotated[int, typer.Option("--verbose", "-v", count=True)] = 0,
) -> None:
"""Combines open ephys data with relacs data from data_path to a new nix file."""
setup_logging(logging.getLogger("oephys2nix"), verbosity=verbose)
log.info(f"Selected data_path is {data_path}")
open_ephys_data_paths = list(Path(data_path).rglob("*open-ephys"))
relacs_data_paths = list(Path(data_path).rglob("*relacs/*.nix"))
@ -88,10 +91,10 @@ def main(
stim = StimulusToNix(open_ephys, str(relacs), str(nix_path))
stim.create_repros_automatically()
stim.print_table()
stim.checks()
# stim.checks()
if debug:
stim.plot_stimulus()
# if debug:
# stim.plot_stimulus()
if __name__ == "__main__":