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

Changing Model.sample To Model.model #248

Merged
merged 5 commits into from
Jul 8, 2024

Conversation

AFg6K7h4fhy2
Copy link
Collaborator

This PR exists to change the following, within metaclass.py

self.kernel = NUTS(
    model=self.sample,
    **nuts_args,
)

to the following:

self.kernel = NUTS(
    model=self.model,
    **nuts_args,
)

This change is due given consensus that model is clearer than sample in the context above.

@AFg6K7h4fhy2 AFg6K7h4fhy2 linked an issue Jul 5, 2024 that may be closed by this pull request
@AFg6K7h4fhy2 AFg6K7h4fhy2 self-assigned this Jul 5, 2024
@AFg6K7h4fhy2 AFg6K7h4fhy2 added the clean up Good code that could be better label Jul 5, 2024
@AFg6K7h4fhy2 AFg6K7h4fhy2 added this to the N Sprint milestone Jul 5, 2024
Copy link

codecov bot commented Jul 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.71%. Comparing base (c347ba3) to head (e5ceb5c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #248      +/-   ##
==========================================
+ Coverage   92.69%   92.71%   +0.01%     
==========================================
  Files          40       40              
  Lines         904      906       +2     
==========================================
+ Hits          838      840       +2     
  Misses         66       66              
Flag Coverage Δ
unittests 92.71% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@AFg6K7h4fhy2 AFg6K7h4fhy2 changed the title Changing sample To model Changing Model.sample To Model.model Jul 5, 2024
@AFg6K7h4fhy2 AFg6K7h4fhy2 marked this pull request as ready for review July 8, 2024 17:17
model/src/pyrenew/metaclass.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@damonbayer damonbayer left a comment

Choose a reason for hiding this comment

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

Please also change in the Predictive calls for prior and posterior prediction.

@damonbayer damonbayer self-requested a review July 8, 2024 18:33
Copy link
Collaborator

@damonbayer damonbayer left a comment

Choose a reason for hiding this comment

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

Thanks!

@damonbayer damonbayer merged commit 7822c37 into main Jul 8, 2024
8 checks passed
@damonbayer damonbayer deleted the 225-UPX3-rename-modelsample-to-modelmodel branch July 8, 2024 18:33
gvegayon added a commit that referenced this pull request Jul 10, 2024
* Fix docstring for compute_infections_from_rt_with_feedback() (#246)

* Update actions/upload-artifact version in website.yaml (#247)

* Rename `SeedInfectionsExponential` For Clarity (#251)

* name change SeedInfectionsExponential to SeedInfectionsViaExpGrowth

* last changed name in __init__ in latent

* rename

* Changing `Model.sample` To `Model.model` (#248)

* initial changes for purposes of creating PR

* alias for sample for use in NUTS kernel

* change back pyproject.toml file

* remove placeholder text

* predictive call changed from sample to model

* Pyrenew tutorial review (#191)

* test commit

* add prereq and install instructions, rename hospital_admissions_model

* add an example showing sample extraction in the basic model

* refer tutorials in getting started

* remove link from code

* add new/changed tutorials to index

* clarify python version req

* review suggestion

* consistent capitalization

* re-arranging tutorial

* title change

---------

Co-authored-by: damonbayer <xum8@cdc.gov>

* Add RST to makefile (#250)

* Add RST to makefile

* fix make for .py tutorials

* fix make for ipynb

* use python script for post-processing rst files

* use python script for post processing rst in github action

* fix for numpydoc with post_process_rst

* numpydocs post_process_rst

* error if not rst file

* correct path for post_process_rst

* add arviz plot for posterior predictive (#234)

* add arviz plot for posterior predictive

* add ppc_plot to hosp_model

* test prior/posterior_predictive plots

* Damon check in

* add plot_ppc, plot_lm

* fix tests

* formatting

* more formatting

* fix plot_lm output issue

* suggestion from code review

Co-authored-by: Damon Bayer <xum8@cdc.gov>

* Update example_with_datasets.qmd

* change plot_lm kwargs

* add details on plot_ppc, fig labels and titles

* add figure descriptions

* code review suggestions

Co-authored-by: Damon Bayer <xum8@cdc.gov>

* remove link from code

* formatting

* add prior predictive plot, sample without warning

* add prior predictive plot

* fix typo

* change order of prior/posterior pred distributions

---------

Co-authored-by: damonbayer <xum8@cdc.gov>

---------

Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com>
Co-authored-by: upx3—TM (CFA) <127630341+AFg6K7h4fhy2@users.noreply.github.com>
Co-authored-by: Subekshya Bidari <37636707+sbidari@users.noreply.github.com>
Co-authored-by: damonbayer <xum8@cdc.gov>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clean up Good code that could be better
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename Model.sample to Model.model
2 participants