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

feat: adding TwoEventsWashover base class and was modified validate c… #167

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Manhe-dev
Copy link
Collaborator

base class and was modified validate columns

@Manhe-dev Manhe-dev linked an issue Mar 9, 2024 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Mar 9, 2024

Codecov Report

Attention: Patch coverage is 15.38462% with 22 lines in your changes are missing coverage. Please review.

Project coverage is 94.71%. Comparing base (414133a) to head (c45c6c6).

Files Patch % Lines
cluster_experiments/washover.py 15.38% 22 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #167      +/-   ##
==========================================
- Coverage   97.00%   94.71%   -2.29%     
==========================================
  Files           9        9              
  Lines         902      928      +26     
==========================================
+ Hits          875      879       +4     
- Misses         27       49      +22     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Owner

@david26694 david26694 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing an (unsolicited) review, since I saw you started working on it and I'm going on holidays 🏖️

f"{end_time_column = } is not in the record dataframe columns and/or not specified as an input."
)

def washover(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd try to maintain the signature of the abstract washover class, if not it's very hard to put it into power analysis:

    @abstractmethod
    def washover(
        self,
        df: pd.DataFrame,
        truncated_time_col: str,
        treatment_col: str,
        cluster_cols: List[str],
        original_time_col: Optional[str] = None,
    ) -> pd.DataFrame:
        """Abstract method to add washvover to the dataframe."""

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this reason, I'd send start and end columns to the init method


def __init__(
self,
calendar_df: pd.DataFrame,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd try to avoid do to init with a calendar df, we've tried to keep constructors only based on very simple types like str, int and float. I'd assume the user already has the calendar in the record df, so you don't need to do a join, and it works like other washover classes

Copy link
Collaborator Author

@Manhe-dev Manhe-dev Mar 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okis, fixing in the next commit.

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

Successfully merging this pull request may close these issues.

Implement washover based on two events
3 participants