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

Methodtime jun22 #359

Merged
merged 54 commits into from
Jul 24, 2024
Merged

Methodtime jun22 #359

merged 54 commits into from
Jul 24, 2024

Conversation

robynstuart
Copy link
Collaborator

Brief description

Fixes bug to ensure that np.count_nonzero(ppl.method) == np.count_nonzero(ppl.on_contra==True)

Type(s) of change

  • Bugfix
  • Refactor
  • New feature
  • Other

Checklist

  • My code follows the style guide
    • Yes
    • N/A
  • I've commented my code
    • Yes
    • N/A
  • I've incremented the version number
    • Yes
    • N/A
  • I've updated the changelog
    • Yes
    • N/A
  • I've added tests and checked code coverage
    • Yes
    • N/A

@emilydriano
Copy link
Collaborator

The changes look good to me, but when I tried running my script I keep getting these errors that appear to pop up in the tests as well:

image

@robynstuart
Copy link
Collaborator Author

Hi @emilydriano, I fixed the error in the tests, but it was only happening when using the RandomChoice contraceptive module, so I'm not sure how it was coming up in your scripts. I couldn't replicate it when running calibrate_simple.py. Was there another script you were running that was leading to this?

@emilydriano
Copy link
Collaborator

Hi @emilydriano, I fixed the error in the tests, but it was only happening when using the RandomChoice contraceptive module, so I'm not sure how it was coming up in your scripts. I couldn't replicate it when running calibrate_simple.py. Was there another script you were running that was leading to this?

@robynstuart thank you! I tried re-running my script and it worked this time, so somehow the latest changes seem to have resolved the issue

@robynstuart
Copy link
Collaborator Author

@emilydriano i can't replicate that error... I tried:

m = fp.EmpoweredChoice(location='kenya')
s = fp.Sim(pars, contraception_module=m)
pars = fp.pars(location='kenya', n_agents=500, start_year=2000, end_year=2010)
s.run()

This runs without error. I still think we should add more checks, but perhaps we could merge this as is for now (into the methodtime feature branch) and make issues as they come up?

@emilydriano
Copy link
Collaborator

LGTM; ready for you @MObrien-IDM

@emilydriano emilydriano merged commit 4eb205e into methodtime Jul 24, 2024
2 checks passed
@emilydriano emilydriano deleted the methodtime-jun22 branch September 11, 2024 17:55
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.

3 participants