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

Adding codes to help filter data before registration date and after study period/data ever recorded. #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

daimm2000
Copy link

No description provided.

@daimm2000 daimm2000 requested a review from biblicabeebli April 10, 2024 20:21
@biblicabeebli
Copy link
Member

biblicabeebli commented Apr 10, 2024

Items to change

  • Add a pandas dataframe type indicator on the df param
  • handle the case of end_date and not study_period_days and clean up and document the followup changes to those logic blocks.

@biblicabeebli
Copy link
Member

Checking in on this pull request, obscure python thing:

def filter_data(df: pd.DataFrame, study_period_days: int | None = None) -> pd.DataFrame:

The very convenient int | None syntax is not supported in python 3.8, it errors with
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

We will be moving probably to 3.11 Beiwe-wide soon, 3.8 goes out of support in October. If you think it matters that this code retains compatibility with 3.8 the equivalent gross yucky old-style is:

from typing import Optional
def filter_data(df: pd.DataFrame, study_period_days: Optional[int] = None) -> pd.DataFrame:

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.

2 participants