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

Added the combination-window function #63

Merged
merged 16 commits into from
Oct 24, 2024
Merged

Added the combination-window function #63

merged 16 commits into from
Oct 24, 2024

Conversation

Jay-sanjay
Copy link
Member

@Jay-sanjay Jay-sanjay commented Aug 27, 2024

  • Added the actual function
  • Added the test suite
  • Added the doc-strings
  • Added the example in the doc-strings

Copy link

codecov bot commented Aug 27, 2024

Codecov Report

Attention: Patch coverage is 93.02326% with 3 lines in your changes missing coverage. Please review.

Project coverage is 96.73%. Comparing base (5bbd1e3) to head (40871f7).
Report is 18 commits behind head on dev.

Files with missing lines Patch % Lines
src/preprocessing.jl 93.02% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##               dev      #63      +/-   ##
===========================================
- Coverage   100.00%   96.73%   -3.27%     
===========================================
  Files            2        2              
  Lines           49       92      +43     
===========================================
+ Hits            49       89      +40     
- Misses           0        3       +3     

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

Copy link
Member

@TheCedarPrince TheCedarPrince left a comment

Choose a reason for hiding this comment

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

Nice work @Jay-sanjay ! This is one of the trickier parts of the implementation so I added a bunch of clarifying questions as I had a little bit of trouble following your implementations. Additionally, could you add docstrings to your functions here? I think that would be helpful to know what these functions are doing.

Thanks!

src/preprocessing.jl Outdated Show resolved Hide resolved
src/preprocessing.jl Outdated Show resolved Hide resolved
Comment on lines 276 to 279
overlap = shift(treatment_history.event_end_date, 1) .- treatment_history.event_start_date
# Correctly handle Missing values before calling Dates.value
overlap_days = [ismissing(o) ? 0 : Dates.value(o) for o in overlap]
selected_rows = findall(treatment_history.SELECTED_ROWS .== 1)
Copy link
Member

Choose a reason for hiding this comment

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

Could you explain to me exactly what these lines are doing? Could you give me as much details as possible and how this relates to the original implementation?

src/preprocessing.jl Outdated Show resolved Hide resolved
src/preprocessing.jl Outdated Show resolved Hide resolved
append!(treatment_history, DataFrame(new_row'))
else
# LRFS
treatment_history[i, :event_end_date] = treatment_history[i-1, :event_end_date]
Copy link
Member

Choose a reason for hiding this comment

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

I am not entirely sure this is right looking at the Reference R Code here: https://github.com/mi-erasmusmc/TreatmentPatterns/blob/171b60af7e76f63e09f2c2d48e2b811ce1dafff0/R/ConstructPathways.R#L350

Did you just dramatically simplify the implementation here? Or what did you do? I am having a little difficulty following your implementation versus the R version.

Copy link
Member

@TheCedarPrince TheCedarPrince left a comment

Choose a reason for hiding this comment

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

Hey @Jay-sanjay , I fixed things up here and this looks good to me to merge. Go for it!

@Jay-sanjay Jay-sanjay merged commit 99f5510 into dev Oct 24, 2024
12 of 14 checks passed
@Jay-sanjay Jay-sanjay deleted the combination-func branch October 24, 2024 10:49
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