Skip to content

Commit 575fe22

Browse files
[pre-commit.ci] pre-commit autoupdate (#40)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/pycqa/flake8: 7.1.2 → 7.2.0](PyCQA/flake8@7.1.2...7.2.0) - [github.com/astral-sh/ruff-pre-commit: v0.9.9 → v0.11.4](astral-sh/ruff-pre-commit@v0.9.9...v0.11.4) * Bump deps --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: S. Co1 <[email protected]>
1 parent e5a6af5 commit 575fe22

9 files changed

Lines changed: 317 additions & 309 deletions

File tree

.github/workflows/lint_test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: actions/checkout@v4
1717

1818
- name: Install uv
19-
uses: astral-sh/setup-uv@v3
19+
uses: astral-sh/setup-uv@v5
2020
with:
2121
version: "0.6.x"
2222
enable-cache: true
@@ -45,7 +45,7 @@ jobs:
4545
- uses: actions/checkout@v4
4646

4747
- name: Install uv
48-
uses: astral-sh/setup-uv@v3
48+
uses: astral-sh/setup-uv@v5
4949
with:
5050
version: "0.6.x"
5151
enable-cache: true
@@ -58,7 +58,7 @@ jobs:
5858
python-version: ${{ matrix.python-version }}
5959

6060
- name: Set up (deadsnakes) Python ${{ matrix.python-version }}
61-
uses: deadsnakes/action@v3.1.0
61+
uses: deadsnakes/action@v3.2.0
6262
if: endsWith(matrix.python-version, '-dev')
6363
with:
6464
python-version: ${{ matrix.python-version }}

.github/workflows/pypi_release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- uses: actions/checkout@v4
2020

2121
- name: Install uv
22-
uses: astral-sh/setup-uv@v3
22+
uses: astral-sh/setup-uv@v5
2323
with:
2424
version: "0.6.x"
2525
enable-cache: true
@@ -34,7 +34,7 @@ jobs:
3434
run: uv build
3535

3636
- name: Publish to PyPI
37-
uses: pypa/gh-action-pypi-publish@release/v1.10
37+
uses: pypa/gh-action-pypi-publish@release/v1.12
3838
with:
3939
print-hash: true
4040

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ repos:
1212
- id: isort
1313
name: isort
1414
- repo: https://github.com/pycqa/flake8
15-
rev: 7.1.2
15+
rev: 7.2.0
1616
hooks:
1717
- id: flake8
1818
additional_dependencies:
@@ -35,6 +35,6 @@ repos:
3535
- id: python-check-blanket-type-ignore
3636
- id: python-use-type-annotations
3737
- repo: https://github.com/astral-sh/ruff-pre-commit
38-
rev: v0.9.9
38+
rev: v0.11.4
3939
hooks:
4040
- id: ruff

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
[![PyPI](https://img.shields.io/pypi/v/ppg-log?logo=Python&logoColor=FFD43B)](https://pypi.org/project/ppg-log/)
44
[![PyPI - License](https://img.shields.io/pypi/l/ppg-log?color=magenta)](https://github.com/sco1/ppg-log/blob/main/LICENSE)
55
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/sco1/ppg-log/main.svg)](https://results.pre-commit.ci/latest/github/sco1/ppg-log/main)
6-
[![Code style: black](https://img.shields.io/badge/code%20style-black-black)](https://github.com/psf/black)
7-
[![Open in Visual Studio Code](https://img.shields.io/badge/Open%20in-VSCode.dev-blue)](https://vscode.dev/github.com/sco1/ppg-log)
86

97
Helper Tools for PPG FlySight Flight Log Management
108

@@ -97,10 +95,10 @@ Save the db address to a local `.env` file.
9795

9896
## Contributing
9997
### Development Environment
100-
This project uses [Poetry](https://python-poetry.org/) to manage dependencies. With your fork cloned to your local machine, you can install the project and its dependencies to create a development environment using:
98+
This project uses [uv](https://docs.astral.sh/uv/) to manage dependencies. With your fork cloned to your local machine, you can install the project and its dependencies to create a development environment using:
10199

102100
```bash
103-
$ poetry install
101+
$ uv sync
104102
```
105103

106104
A [pre-commit](https://pre-commit.com) configuration is also provided to create a pre-commit hook so linting errors aren't committed:

ppg_log/metrics.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,9 @@ def _segment_flights(
265265
# Calculate time delta between flight segments, then reshape into nx2 for segment indices
266266
next_segment_delta = []
267267
for current_end, next_start in zip(
268-
elapsed_time.iloc[flights[1:-1:2]], elapsed_time.iloc[flights[2::2]]
268+
elapsed_time.iloc[flights[1:-1:2]],
269+
elapsed_time.iloc[flights[2::2]],
270+
strict=False,
269271
):
270272
next_segment_delta.append(next_start - current_end)
271273

pyproject.toml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22
name = "PPG-Log"
33
version = "0.1.0"
44
description = "Helper Tools for PPG FlySight Flight Log Management"
5+
license = "MIT"
6+
license-files = ["LICENSE"]
57
authors = [
68
{name = "sco1", email = "[email protected]"}
79
]
8-
maintainers = [
9-
{name = "sco1", email = "[email protected]"}
10-
]
10+
1111

1212
readme = "README.md"
1313
classifiers = [
1414
"Development Status :: 3 - Alpha",
1515
"Intended Audience :: Developers",
16-
"License :: OSI Approved :: MIT License",
1716
"Operating System :: OS Independent",
1817
"Programming Language :: Python :: 3 :: Only",
1918
"Programming Language :: Python :: 3.10",
@@ -48,12 +47,12 @@ ppglog = "ppg_log.cli:ppglog_cli"
4847

4948
[tool.uv]
5049
dev-dependencies = [
51-
"black~=24.8",
50+
"black~=25.0",
5251
"bump2version~=1.0",
5352
"cogapp~=3.3",
5453
"flake8~=7.1",
5554
"flake8-annotations~=3.1",
56-
"isort~=5.13",
55+
"isort~=6.0",
5756
"mypy~=1.11",
5857
"pre-commit~=4.0",
5958
"pytest~=8.3",

tests/checks.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
from ppg_log import metrics
1111

1212

13-
@check_func # type: ignore[misc] # fine with this untyped decorator
13+
@check_func
1414
def is_col(df: pd.DataFrame, col_name: str) -> None:
1515
assert col_name in df.columns
1616

1717

18-
@check_func # type: ignore[misc] # fine with this untyped decorator
18+
@check_func
1919
def is_dtype(df: pd.DataFrame, col_name: str, type_check: t.Callable) -> None:
2020
"""
2121
Check that the query dataframe matches the correct type.
@@ -26,7 +26,7 @@ def is_dtype(df: pd.DataFrame, col_name: str, type_check: t.Callable) -> None:
2626
assert type_check(df[col_name])
2727

2828

29-
@check_func # type: ignore[misc] # fine with this untyped decorator
29+
@check_func
3030
def segment_isclose(
3131
flight: metrics.FlightSegment,
3232
truth: metrics.FlightSegment,

tests/test_flight_mode.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class DataTruthMap(t.NamedTuple):
3636

3737

3838
DURATION_TOL = dt.timedelta(seconds=1)
39-
IDX_TOL = DURATION_TOL.total_seconds() // 0.2 # Sample rate assumed to be 5 Hz
39+
IDX_TOL = int(DURATION_TOL.total_seconds() // 0.2) # Sample rate assumed to be 5 Hz
4040

4141
PARTIAL_LOG = partial(
4242
metrics.FlightLog, metadata=metrics.LogMetadata(log_date="2022-04-20", log_time="04-20-00")
@@ -126,7 +126,9 @@ def test_flight_classification(data_mapping: DataTruthMap) -> None:
126126
# For mypy: ignore the case of optional flight segments, they're present in this block
127127
assert len(flight_log.metadata.flight_segments) == len(data_mapping.flight_segments) # type: ignore[arg-type] # noqa: E501
128128
for flight_segment, truth_segment in zip(
129-
flight_log.metadata.flight_segments, data_mapping.flight_segments # type: ignore[arg-type]
129+
flight_log.metadata.flight_segments, # type: ignore[arg-type]
130+
data_mapping.flight_segments,
131+
strict=False,
130132
):
131133
checks.segment_isclose(
132134
flight_segment, truth_segment, idx_tol=IDX_TOL, duration_tol=DURATION_TOL

0 commit comments

Comments
 (0)