label holding pattern in Traffic
junzis opened this issue · comments
Junzi Sun commented
Add a new function for traffic that labels the holding pattern, example code follows:
def label_holding(flight):
flight = flight.assign(holding=False)
hold = flight.holding_pattern().all()
if hold:
flight.data.loc[hold.data.index, "holding"] = True
return flight
Xavier Olive commented
I am thinking of something along the following interface on FlightIterator
:
.label(holding=True)
.label(index="{i}") # will apply a format with index=i, f=self
.label(start="start", altitude_max="{f.altitude_max}") # string will call for attribute
then on Flight
:
.label("holding_pattern", **kwargs)
.label("aligned_on_ils('LFBO')", **kwargs)
This will induce some refactoring for more elegant output in:
all
remains awkward in the way:- it creates a new index,
- it concatenates non consecutive segments;
so the method could disappear? or become an alias forlabel
.
aligned_on_ils
with theILS
argument- same with
takeoff_runway
andaligned_on_runway
Junzi Sun commented
yes. looks quite nice for me, let's do that.
Xavier Olive commented
After a closer look, it has to work only on Flight
because we lose reference to the original flight when in FlightIterator