diff --git a/src/traffic/algorithms/cpa.py b/src/traffic/algorithms/cpa.py index e800fc6d..0f91f4f4 100644 --- a/src/traffic/algorithms/cpa.py +++ b/src/traffic/algorithms/cpa.py @@ -35,12 +35,12 @@ def combinations( continue clipped = t_.query( - f'x >= {flight.min("x")} - {lateral_separation} and ' - f'x <= {flight.max("x")} + {lateral_separation} and ' - f'y >= {flight.min("y")} - {lateral_separation} and ' - f'y <= {flight.max("y")} + {lateral_separation} and ' - f'altitude >= {flight.min("altitude")} - {vertical_separation} and ' - f'altitude <= {flight.max("altitude")} + {vertical_separation} and ' + f"x >= {flight.min('x')} - {lateral_separation} and " + f"x <= {flight.max('x')} + {lateral_separation} and " + f"y >= {flight.min('y')} - {lateral_separation} and " + f"y <= {flight.max('y')} + {lateral_separation} and " + f"altitude >= {flight.min('altitude')} - {vertical_separation} and " + f"altitude <= {flight.max('altitude')} + {vertical_separation} and " f'timestamp <= "{flight.stop}" and ' f'timestamp >= "{flight.start}" ' ) diff --git a/src/traffic/algorithms/generation.py b/src/traffic/algorithms/generation.py index 7f2a15b5..6ed17347 100644 --- a/src/traffic/algorithms/generation.py +++ b/src/traffic/algorithms/generation.py @@ -197,9 +197,9 @@ def build_traffic( return Traffic(df).compute_latlon_from_xy(projection) # df = compute_latlon_from_xy(df, projection=projection) if set(["track", "groundspeed"]).issubset(set(self.features)): - assert ( - coordinates is not None - ), "coordinates attribute shouldn't be None" + assert coordinates is not None, ( + "coordinates attribute shouldn't be None" + ) # integrate lat/lon in df df = compute_latlon_from_trackgs( df, n_samples, n_obs, coordinates, forward=forward diff --git a/src/traffic/core/distance.py b/src/traffic/core/distance.py index d580aca0..8d128e8e 100644 --- a/src/traffic/core/distance.py +++ b/src/traffic/core/distance.py @@ -80,7 +80,7 @@ def guess_airport( if warning_distance is not None and airport.distance > warning_distance: _log.warning( - f"Closest airport is more than {warning_distance*1e-3}km away " + f"Closest airport is more than {warning_distance * 1e-3}km away " f" (distance={airport.distance})" ) return airport diff --git a/src/traffic/core/flight.py b/src/traffic/core/flight.py index 0a55ef25..38b40029 100644 --- a/src/traffic/core/flight.py +++ b/src/traffic/core/flight.py @@ -2776,8 +2776,7 @@ def fail_silent() -> Flight: else: df = data if isinstance(data, pd.DataFrame) else data.data df = df.query( - "icao24 == @self.icao24 and " - "@self.start < mintime < @self.stop" + "icao24 == @self.icao24 and @self.start < mintime < @self.stop" ) if df is None or df.shape[0] == 0: diff --git a/src/traffic/core/iterator.py b/src/traffic/core/iterator.py index 829f5123..6b48e3b0 100644 --- a/src/traffic/core/iterator.py +++ b/src/traffic/core/iterator.py @@ -284,7 +284,7 @@ def flight_iterator( msg = ( "The @flight_iterator decorator can only be set on methods " ' annotated with an Iterator["Flight"] return type.' - f' Got {fun.__annotations__["return"]}' + f" Got {fun.__annotations__['return']}" ) if not ( fun.__annotations__["return"] == Iterator["Flight"] diff --git a/src/traffic/core/structure.py b/src/traffic/core/structure.py index 75279107..2e0723a8 100644 --- a/src/traffic/core/structure.py +++ b/src/traffic/core/structure.py @@ -313,7 +313,7 @@ def __rich_repr__(self) -> rich.repr.Result: yield "description", self.description yield ( "frequency", - f"{self.frequency}{'kHz' if self.type=='NDB' else 'MHz'}", + f"{self.frequency}{'kHz' if self.type == 'NDB' else 'MHz'}", ) def __repr__(self) -> str: @@ -326,7 +326,7 @@ def __repr__(self) -> str: f"{self.name} ({self.type}): {self.latitude} {self.longitude}" f" {self.altitude:.0f} " f"{self.description if self.description is not None else ''}" - f" {self.frequency}{'kHz' if self.type=='NDB' else 'MHz'}" + f" {self.frequency}{'kHz' if self.type == 'NDB' else 'MHz'}" ) diff --git a/src/traffic/core/traffic.py b/src/traffic/core/traffic.py index d98569fb..7f3bb609 100644 --- a/src/traffic/core/traffic.py +++ b/src/traffic/core/traffic.py @@ -1175,8 +1175,7 @@ def agg_latlon( See how to make `flight density heatmaps `_ """ warnings.warn( - "agg_latlon will disappear in future versions. " - "Use agg_xy instead", + "agg_latlon will disappear in future versions. Use agg_xy instead", DeprecationWarning, ) diff --git a/src/traffic/data/eurocontrol/aixm/navpoints.py b/src/traffic/data/eurocontrol/aixm/navpoints.py index 6ae0d7cc..4e8084a3 100644 --- a/src/traffic/data/eurocontrol/aixm/navpoints.py +++ b/src/traffic/data/eurocontrol/aixm/navpoints.py @@ -158,8 +158,7 @@ def parse_data(self) -> None: } extension = point.find( - "aixm:timeSlice/aixm:DesignatedPointTimeSlice/" - "aixm:extension", + "aixm:timeSlice/aixm:DesignatedPointTimeSlice/aixm:extension", ns, ) if extension is not None: @@ -231,8 +230,7 @@ def parse_data(self) -> None: } extension = point.find( - "aixm:timeSlice/aixm:DesignatedPointTimeSlice/" - "aixm:extension", + "aixm:timeSlice/aixm:DesignatedPointTimeSlice/aixm:extension", ns, ) if extension is not None: