Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Recursive Error in cases where a BDF doesn't have a start and end simultaneously #169

Open
victorgarcia98 opened this issue Mar 7, 2024 · 0 comments

Comments

@victorgarcia98
Copy link
Contributor

Potential recursive error in case that the BeliefDataFrame doesn't have start and end. If start and end are not there, the following properties point to each other.

def event_starts(self) -> pd.DatetimeIndex:
if "event_start" in self.index.names:
return pd.DatetimeIndex(self.index.get_level_values("event_start"))
else:
return pd.DatetimeIndex(
self.event_ends.to_series(name="event_start").apply(
lambda event_end: event_end - self.event_resolution
)
)

def event_ends(self) -> pd.DatetimeIndex:
if "event_end" in self.index.names:
return pd.DatetimeIndex(self.index.get_level_values("event_end"))
else:
return pd.DatetimeIndex(
self.event_starts.to_series(name="event_end").apply(
lambda event_start: event_start + self.event_resolution
)
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant