Completed
Pull Request — master (#881)
by
unknown
01:24
created

compute()   A

Complexity

Conditions 1

Size

Total Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 1
dl 0
loc 2
rs 10
1
"""
2
Filters for handling recent or upcoming events.
3
"""
4
from zipline.pipeline.data.earnings import EarningsCalendar
5
from .filter import CustomFilter
6
7
8
class HasEarningsToday(CustomFilter):
9
    """
10
    Filter indicating whether an asset has an earnings announcement on the
11
    current day.
12
    """
13
    inputs = [EarningsCalendar.next_announcement]
14
    window_length = 1
15
16
    def compute(self, today, assets, out, next_announce_date):
17
        out[:] = (today.value == next_announce_date)
18