Skip to content

Commit

Permalink
pyarrow fixes + typing for lazy.py
Browse files Browse the repository at this point in the history
remove libarchive and so6
from_file and indexation do not return None anymore
remove sample_so6
silent tqdm for datasets
  • Loading branch information
xoolive committed Nov 2, 2024
1 parent 47e6bed commit 2d942f4
Show file tree
Hide file tree
Showing 32 changed files with 1,983 additions and 2,866 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,14 @@ jobs:
- name: Ubuntu system dependencies
run: |
sudo apt update
sudo apt install -y libgdal-dev libgeos-dev libproj-dev proj-bin proj-data libarchive-dev
# Weird issue with libarchive-dev
sudo ln -s -f /usr/lib/x86_64-linux-gnu/libarchive.a /usr/lib/x86_64-linux-gnu/liblibarchive.a
sudo apt install -y libgdal-dev libgeos-dev libproj-dev proj-bin proj-data
- name: Dynamic versioning
run: poetry self add "poetry-dynamic-versioning[plugin]" || true

- name: Install dependencies
run: |
poetry install -E full -E libarchive
poetry install -E full
- name: Style checking
run: |
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ repos:
- id: ruff-format
args: [--check]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
rev: v1.13.0
hooks:
- id: mypy
exclude: ^docs/conf.py
Expand Down
76 changes: 0 additions & 76 deletions docs/airac_usage.rst

This file was deleted.

8 changes: 0 additions & 8 deletions docs/data_sources/flightplans.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@ A :class:`~traffic.core.flightplan.FlightPlan` is a structure designed to parse
flight plans in the ICAO format. Access to such field may be complicated for non
operational fellows, who may have access to different sources of data.

EUROCONTROL DDR SO6 files
-------------------------

.. automodule:: traffic.data.eurocontrol.ddr.so6
:members: SO6, SO6Flight
:no-undoc-members:
:show-inheritance:

EUROCONTROL B2B web services
----------------------------

Expand Down
8 changes: 6 additions & 2 deletions docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,8 @@ colour based on the vertical rate average value.
fig, ax = plt.subplots(subplot_kw=dict(projection=Lambert93()))

for flight in quickstart:
if pd.isna(flight.vertical_rate_mean):
continue
if flight.vertical_rate_mean < -500:
flight.plot(ax, color="#4c78a8", alpha=0.5) # blue
elif flight.vertical_rate_mean > 1000:
Expand All @@ -426,6 +428,8 @@ intersects the shape of the airport.
fig, ax = plt.subplots(subplot_kw=dict(projection=Lambert93()))

for flight in quickstart:
if pd.isna(flight.vertical_rate_mean):
continue
if flight.vertical_rate_mean < -500:
if flight.last("5 min").intersects(airports["LFPO"]):
flight.plot(ax, color="#4c78a8", alpha=0.5)
Expand Down Expand Up @@ -547,7 +551,7 @@ an additional landmark:
seine_river = (
Nominatim.search("Seine river, France")
.shape.intersection(
paris_area.unary_union.buffer(0.1)
paris_area.union_all().buffer(0.1)
)
)

Expand Down Expand Up @@ -638,7 +642,7 @@ There are several ways to collect trajectories:
def select_landing(airport: "Airport"):
for flight in quickstart:
if low_alt := flight.query("altitude < 3000"): # Flight -> None or Flight
if low_alt.vertical_rate_mean < -500: # Flight -> bool
if not pd.isna(v_mean := low_alt.vertical_rate_mean) and v_mean < -500: # Flight -> bool
if low_alt.intersects(airport): # Flight -> bool
if low_alt.aligned_on_ils(airport).has(): # Flight -> bool
yield low_alt.last("10 min") # Flight -> None or Flight
Expand Down
10 changes: 9 additions & 1 deletion docs/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,15 @@ We can also estimate the total fuel consumed:

.. jupyter-execute::

g.emission().fuel_max
g.between(takeoff_time, landing_time).emission().fuel_max

.. warning::

Note that it is not reasonable to consider these models on the ground and that it can result to big discrepancies.

.. jupyter-execute::

g.emission().fuel_max

.. hint::

Expand Down
2 changes: 1 addition & 1 deletion docs/user_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ Navigation events
:maxdepth: 1

navigation/flight_phases
airac_usage
navigation/go_around
navigation/runway_changes
navigation/holding_pattern
navigation/top_of_climb
navigation/flight_plan
navigation/fuel_burn
Expand Down
Loading

0 comments on commit 2d942f4

Please sign in to comment.