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

Cervical cancer #1287

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

Cervical cancer #1287

wants to merge 250 commits into from

Conversation

andrew-phillips-1
Copy link
Collaborator

Here's a first draft of this module. I need to do another search to try to find additional data for calibration.

I couldn't upload the draft write as it was asking me to use the command line and Git LFS.

@tbhallett
Copy link
Collaborator

per @mmsuarezcosta, this is now ready for review.

.when(2, p['rr_hpv_vaccinated']),
Predictor('age_years', conditions_are_mutually_exclusive=True)
.when('.between(0,15)', 0.0)
.when('.between(50,110)', p['rr_hpv_age50plus']),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a reason why this was reverted to .when('.between(50,110)', p['rr_hpv_age50plus']),? It was suggested to have it as .when('>50'),p['rr_hpv_age50plus']) earlier over here

# Current counts, total
out.update({
f'total_{k}': v for k, v in df.loc[df.is_alive & (df['sex'] == 'F') &
(df['age_years'] > p['min_age_hpv'])].ce_hpv_cc_status.value_counts().items()})
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
(df['age_years'] > p['min_age_hpv'])].ce_hpv_cc_status.value_counts().items()})
df_alive_females = df.loc[df.is_alive & (df['sex'] == 'F') & (df['age_years'] > p['min_age_hpv'])]
out.update({f'total_{k}': v for k, v in df_alive_females.ce_hpv_cc_status.value_counts().items()})

There is a repetition of this line of code here df.loc[df.is_alive & (df['sex'] == 'F') & (df['age_years'] > p['min_age_hpv'])] as well as at lines 1581 and 1586. Would probably be more efficient if these conditions are not repeated

Copy link
Collaborator

@mnjowe mnjowe left a comment

Choose a reason for hiding this comment

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

Thanks @mmsuarezcosta and Andrew for this great work. Find below my comments for your consideration. I have only managed to look into cervical cancer main module. I hope to provide my feedback on the tests tomorrow. Thanks

Comment on lines +148 to +163
"prob_cure_stage1": Parameter(
Types.REAL,
"probability of cure if treated in stage 1 cervical cancer",
),
"prob_cure_stage2a": Parameter(
Types.REAL,
"probability of cure if treated in stage 1 cervical cancer",
),
"prob_cure_stage2b": Parameter(
Types.REAL,
"probability of cure if treated in stage 1 cervical cancer",
),
"prob_cure_stage3": Parameter(
Types.REAL,
"probability of cure if treated in stage 1 cervical cancer",
),
Copy link
Collaborator

Choose a reason for hiding this comment

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

description looks the same. should it be like that?

Types.DATE,
"date of first receiving palliative care (pd.NaT is never had palliative care)"
),
"ce_ever_diagnosed": Property(
Copy link
Collaborator

Choose a reason for hiding this comment

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

This has been used in the code as a bool. I suggest changing the TYPE here from date to Bool

Comment on lines +310 to +313
"ce_date_death": Property(
Types.DATE,
"date of cervical cancer death"
),
Copy link
Collaborator

Choose a reason for hiding this comment

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

we can remove this property here and capture date of death in demography.

df.loc[df.is_alive, "ce_selected_for_xpert_this_month"] = False
df.loc[df.is_alive, "ce_biopsy"] = False
df.loc[df.is_alive, "ce_ever_screened"] = False
df.loc[df.is_alive, "ce_ever_diagnosed"] = False
Copy link
Collaborator

@mnjowe mnjowe Feb 4, 2025

Choose a reason for hiding this comment

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

I also had a feeling that this should be a bool. Can you please update ce_ever_diagnosed in properties section?. It should be of type bool not date?

Comment on lines +413 to +414
# this was not assigned here at outset because baseline value of hv_inf was not accessible - it is assigned
# at start of main polling event below
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we still have this issue? Does adding as a dependency HIV module or initialising it before cervical cancer still not making available baseline value of hv_inf?

out.update({
'total_males': len(df[df.is_alive & (df['sex'] == 'M')])})
out.update({
'total_dead': len(df[df['is_alive'].eq(False)])})
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
'total_dead': len(df[df['is_alive'].eq(False)])})
'total_dead': len(~df['is_alive'])})


df['rounded_decimal_year'] = rounded_decimal_year

date_1_year_ago = self.sim.date - pd.DateOffset(days=365)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
date_1_year_ago = self.sim.date - pd.DateOffset(days=365)
date_1_year_ago = self.sim.date - pd.DateOffset(years=1)

I think years/months is better since it takes into account leap years?

out.update({"n_xpert_past_year": n_xpert_past_year})


pop = len(df[df.is_alive])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
pop = len(df[df.is_alive])
pop = len(df.is_alive)

Comment on lines +1783 to +1785
# todo:
# ? move to using the logger:
# i.e. logger.info(key='cervical_cancer_stats_every_month', description='XX', data=out)
Copy link
Collaborator

Choose a reason for hiding this comment

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

if this is done then the below commented code should be deleted?

Comment on lines +1904 to +1906
# selected_columns = ['sex', 'age_years', 'is_alive']
# pd.set_option('display.max_rows', None)
# print(df[selected_columns])
Copy link
Collaborator

Choose a reason for hiding this comment

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

delete this code if its not need anymore?

@mmsuarezcosta
Copy link
Collaborator

Thanks @mmsuarezcosta and Andrew for this great work. Find below my comments for your consideration. I have only managed to look into cervical cancer main module. I hope to provide my feedback on the tests tomorrow. Thanks

Thanks for the detailed look and feedback, will review and update

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.

6 participants