Skip to content

Commit

Permalink
Merge pull request #20 from sco1/config-parser
Browse files Browse the repository at this point in the history
Add Flysight Configuration Generator
  • Loading branch information
sco1 authored Aug 2, 2024
2 parents 1e757be + afbaadb commit 55058ce
Show file tree
Hide file tree
Showing 15 changed files with 1,579 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import-order-style=pycharm
application-import-names=pyflysight,tests
extend-ignore=
# pycodestyle
E203,E226,
E203,E226,E701
# flake8-annotations
ANN002,ANN003,ANN101,ANN102,ANN204,ANN206,
extend-exclude=
Expand Down
4 changes: 4 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,12 @@ ignore = [

[lint.per-file-ignores]
"tests/test_*.py" = [
"D101",
"D103",
]
"pyflysight/config_params.py" = [
"D101",
]

[lint.flake8-bugbear]
extend-immutable-calls = [
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Versions follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html) (`<ma
* Add derived `total_accel` column to Flysight V2 IMU sensor dataframe, calculated as a vector sum of the `xyz` acceleration components
* Add `pyflysight.log_utils.locate_log_subdir` helper for resolving child log directory from a given top-level directory
* Add `pyflysight.log_utils.iter_log_dirs` helper for iterating through child log directories of a given top-level directory
* #19 Add `pyflysight.config_utils` for config file generation
* Add `pyflysight.flysight_utils` with helper utilities for working with connected FlySight devices

## [v0.3.0]
### Changed
Expand Down
100 changes: 57 additions & 43 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 5 additions & 13 deletions pyflysight/cli.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,27 @@
import os
from pathlib import Path

import typer
from dotenv import load_dotenv
from sco1_misc.prompts import prompt_for_dir, prompt_for_file

pyflysight_cli = typer.Typer(add_completion=False)

load_dotenv()
PROMPT_START_DIR = Path(os.environ.get("PROMPT_START_DIR", "."))


@pyflysight_cli.command()
def single(
log_filepath: Path = typer.Option(None, exists=True, file_okay=True, dir_okay=False),
) -> None:
"""Single flight log processing pipeline."""
raise NotImplementedError

if log_filepath is None:
log_filepath = prompt_for_file(
title="Select Flight Log",
start_dir=PROMPT_START_DIR,
filetypes=[
("FlySight Flight Log", "*.csv"),
("All Files", "*.*"),
],
)

raise NotImplementedError


@pyflysight_cli.command()
def batch(
Expand All @@ -36,13 +30,11 @@ def batch(
verbose: bool = typer.Option(True),
) -> None:
"""Batch flight log processing pipeline."""
if log_dir is None:
log_dir = prompt_for_dir(
title="Select directory for batch processing", start_dir=PROMPT_START_DIR
)

raise NotImplementedError

if log_dir is None:
log_dir = prompt_for_dir(title="Select directory for batch processing")


if __name__ == "__main__": # pragma: no cover
pyflysight_cli()
Loading

0 comments on commit 55058ce

Please sign in to comment.