washingtonpost / elex-live-model

a model to generate estimates of the number of outstanding votes on an election night based on the current results of the race
48 stars 5 forks source link

some model parameters now also allow ints and not just floats #86

Closed lennybronner closed 1 year ago

lennybronner commented 1 year ago

Description

Some model parameters should be numeric but are currently only accepted as floats by the model. This is causing issues with hasura, which converts floats to ints if they have a trailing zero if you change the parameters directly in the database. So this updates the model to let the parameters be both floats and ints.

Jira Ticket

https://arcpublishing.atlassian.net/browse/ELEX-3460

Test Steps

The following is throwing an error in develop branch, but not in this branch:

elexmodel 2017-11-07_VA_G --estimands=margin --office_id=G --geographic_unit_type=precinct --pi_method=bootstrap --percent_reporting=10 --aggregates=postal_code --fixed_effects=county_classification --features=baseline_normalized_margin  --model_parameters='{"B": 10, "y_unobserved_upper_bound": 2}'
lennybronner commented 1 year ago

This looks good! Thanks for figuring this out! 🎉

Should we add a unit test? 🤔

Added unit tests!