Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ repos:
language: python
name: Check licenses of Python dependencies
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: 3.6.0
rev: 3.6.1
hooks:
- id: editorconfig-checker
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.35.0
rev: 0.37.2
hooks:
- id: check-github-workflows
- id: check-github-actions
Expand All @@ -54,41 +54,41 @@ repos:
- flake8-docstrings-complete
- flake8-pyproject
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.8
rev: v0.15.12
hooks:
- id: ruff-check
name: Linting Python code (ruff)
args: [--fix]
- id: ruff-format
name: Formatting Python code (ruff)
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
rev: v2.4.2
hooks:
- id: codespell
name: Fixing common spelling mistakes
args:
- --write-changes
exclude: uv.lock
- repo: https://github.com/PyCQA/docformatter
rev: v1.7.7
rev: v1.7.8
hooks:
- id: docformatter
name: Fixing docstring formatting
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.46.0
rev: v0.48.0
hooks:
- id: markdownlint
name: Fixing markdown linting errors
args: [--disable, MD013, MD033, --fix]
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.15.0
rev: v2.16.0
hooks:
- id: pretty-format-yaml
args: [--autofix, --indent, "2", --offset, "2", --preserve-quotes]
- id: pretty-format-toml
args: [--autofix]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.19.0
rev: v2.0.0
hooks:
- id: mypy
name: Static typechecking (mypy)
Expand Down
54 changes: 28 additions & 26 deletions src/pycasx/acas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,15 +450,16 @@ class APIVCASStateVariables:

@dataclass
class AutoavoidInfo: # pylint: disable=too-many-instance-attributes
"""An extended aircraft representation incl. the current timestamp.

Attributes:
active (bool): Whether autoavoid is active.
mode (Optional[Literal["hcas", "vcas"]]): The autoavoid mode to
use.
action (Optional[float]): The action to take.
command (Optional[float]): The command issued to FlightGear.
timestamp (float): The timestamp of the information.
"""An extended aircraft representation incl.

the current timestamp.
Attributes:
active (bool): Whether autoavoid is active.
mode (Optional[Literal["hcas", "vcas"]]): The autoavoid mode to
use.
action (Optional[float]): The action to take.
command (Optional[float]): The command issued to FlightGear.
timestamp (float): The timestamp of the information.
"""

active: bool
Expand All @@ -470,23 +471,24 @@ class AutoavoidInfo: # pylint: disable=too-many-instance-attributes

@dataclass
class ExtendedAircraft: # pylint: disable=too-many-instance-attributes
"""An extended aircraft representation incl. the current timestamp.

Attributes:
call_sign (str): The call_sign of the aircraft.
altitude (float): The aircraft's current altitude, measured
in feet.
vertical_speed (float): The aircraft's current vertical
speed, measured in feet per second.
true_airspeed (float): The aircraft's current true airspeed,
measured in knots.
heading (float): The aircraft's current heading, measured in
degrees.
latitude (float): The aircraft's current latitude, measured
in degrees.
longitude (float): The aircraft's current longitude, measured
in degrees.
timestamp (float): The timestamp of the information.
"""An extended aircraft representation incl.

the current timestamp.
Attributes:
call_sign (str): The call_sign of the aircraft.
altitude (float): The aircraft's current altitude, measured
in feet.
vertical_speed (float): The aircraft's current vertical
speed, measured in feet per second.
true_airspeed (float): The aircraft's current true airspeed,
measured in knots.
heading (float): The aircraft's current heading, measured in
degrees.
latitude (float): The aircraft's current latitude, measured
in degrees.
longitude (float): The aircraft's current longitude, measured
in degrees.
timestamp (float): The timestamp of the information.
"""

call_sign: str
Expand Down
6 changes: 3 additions & 3 deletions src/pycasx/scenario/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,18 @@ class GeographicCoordinates:


@overload
def convert(value: int | float) -> float: ...
def convert(value: float) -> float: ...


@overload
def convert(value: int | float, unit: str) -> float: ...
def convert(value: float, unit: str) -> float: ...


@overload
def convert(value: str, unit: str) -> float: ...


def convert(value: int | float | str, unit: str = "") -> float:
def convert(value: float | str, unit: str = "") -> float:
"""Convert a value to a specific unit.

This function takes a value and a unit and converts the value to the
Expand Down
1 change: 0 additions & 1 deletion tests/test_scenario_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ def line_intersection(
tuple[float, float] | None: The intersection point (lon, lat)
if the lines intersect, else None
"""

# Define the coordinate system
crs = pyproj.CRS("WGS84")

Expand Down
Loading
Loading