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

Address warnings + remove warning suppression #69

Merged
merged 4 commits into from
May 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions tutorials/SIR/workflow_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
from pySODM.optimization.mcmc import perturbate_theta, run_EnsembleSampler, emcee_sampler_to_dictionary
from pySODM.optimization.objective_functions import log_posterior_probability, ll_negative_binomial

# Suppress warnings
import warnings
warnings.filterwarnings("ignore")

######################################################
## Generate a synthetic dataset with overdispersion ##
######################################################
Expand Down Expand Up @@ -107,7 +103,7 @@ def integrate(t, S, I, R, beta, gamma):
# Calibated parameters and bounds
pars = ['beta',]
labels = ['$\\beta$',]
bounds = [(1e-6,1),]
bounds = [(0,10),]
# Setup objective function (no priors --> uniform priors based on bounds)
objective_function = log_posterior_probability(model, pars, bounds, data, states, log_likelihood_fnc, log_likelihood_fnc_args, labels=labels)
# Extract start- and enddate
Expand Down
4 changes: 0 additions & 4 deletions tutorials/SIR_SI/calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
from pySODM.optimization.mcmc import perturbate_theta, run_EnsembleSampler, emcee_sampler_to_dictionary
from pySODM.optimization.objective_functions import log_posterior_probability, ll_negative_binomial, ll_poisson

# Suppress warnings
import warnings
warnings.filterwarnings("ignore")

##################
## Define model ##
##################
Expand Down
7 changes: 2 additions & 5 deletions tutorials/influenza_1718/calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
from pySODM.optimization.objective_functions import log_posterior_probability, ll_negative_binomial
# pySODM dependecies
import corner
# Suppress warnings
import warnings
warnings.filterwarnings("ignore")

##############
## Settings ##
Expand All @@ -52,10 +49,10 @@
###############

# Load case data
data = pd.read_csv(os.path.join(os.path.dirname(__file__),'data/interim/data_influenza_1718_format.csv'), index_col=[0,1], parse_dates=True)
data = pd.read_csv(os.path.join(os.path.dirname(__file__),'data/interim/data_influenza_1718_format.csv'), index_col=[0,1], parse_dates=True, date_format='%Y-%m-%d')
data = data.squeeze()
# Load case data per 100K
data_100K = pd.read_csv(os.path.join(os.path.dirname(__file__),'data/interim/data_influenza_1718_format_100K.csv'), index_col=[0,1], parse_dates=True)
data_100K = pd.read_csv(os.path.join(os.path.dirname(__file__),'data/interim/data_influenza_1718_format_100K.csv'), index_col=[0,1], parse_dates=True, date_format='%Y-%m-%d')
data_100K = data_100K.squeeze()
# Re-insert pd.IntervalIndex (pd.IntervalIndex is always loaded as a string..)
age_groups = pd.IntervalIndex.from_tuples([(0,5),(5,15),(15,65),(65,120)], closed='left')
Expand Down
Loading