Skip to content

Commit

Permalink
Tryout Python 3.12 (#392)
Browse files Browse the repository at this point in the history
  • Loading branch information
twallema authored May 14, 2024
1 parent c1692cd commit ef6087f
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 21 deletions.
Binary file modified data/covid19_DTM/interim/sciensano/vacc_incidence_national.pkl
Binary file not shown.
Binary file modified data/covid19_DTM/interim/sciensano/vacc_incidence_prov.pkl
Binary file not shown.
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
- conda-forge
- defaults
dependencies:
- python=3.11.4
- python=3.12
- pandas
- numpy
- scipy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@
from pySODM.optimization.mcmc import perturbate_theta, run_EnsembleSampler, emcee_sampler_to_dictionary
from pySODM.optimization.objective_functions import log_posterior_probability, log_prior_uniform, ll_negative_binomial, ll_poisson

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

#############################
## Handle script arguments ##
#############################
Expand Down Expand Up @@ -192,7 +188,7 @@
pars = pars1 + pars2 + pars3 + pars4
bounds = bounds1 + bounds2 + bounds3 + bounds4
# Define labels
labels = ['$\Omega$', '$\Psi$', 'k', '$K_{inf, abc}$', '$K_{inf, \\delta}$', '$A$', '$f_h$']
labels = [r'$\Omega$', r'$\Psi$', r'k', r'$K_{inf, abc}$', r'$K_{inf, \delta}$', r'$A$', r'$f_h$']
# Setup objective function without priors and with negative weights
objective_function = log_posterior_probability(model,pars,bounds,data,states,log_likelihood_fnc,log_likelihood_fnc_args,labels=labels)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
from pySODM.optimization.mcmc import perturbate_theta, run_EnsembleSampler, emcee_sampler_to_dictionary
from pySODM.optimization.objective_functions import log_posterior_probability, log_prior_uniform, ll_poisson, ll_negative_binomial

import warnings
warnings.filterwarnings("ignore")

####################################
## Public or private spatial data ##
Expand Down Expand Up @@ -237,7 +235,7 @@
# Join them together
pars = pars1 + pars2 + pars3 + pars4
bounds = bounds1 + bounds2 + bounds3 + bounds4
labels = ['$\\Omega$', '$\Psi$', '$k$', '$\Psi_{F}$', '$\Psi_{W}$', '$\Psi_{B}$', '$K_{inf, abc}$', '$K_{inf,\\delta}$', '$A$', '$f_h$']
labels = [r'$\Omega$', r'$\Psi$', '$k$', r'$\Psi_{F}$', r'$\Psi_{W}$', r'$\Psi_{B}$', r'$K_{inf, abc}$', r'$K_{inf,\delta}$', '$A$', '$f_h$']
# Setup objective function with uniform priors
objective_function = log_posterior_probability(model,pars,bounds,data,states,log_likelihood_fnc,log_likelihood_fnc_args,labels=labels, aggregation_function=aggregate_Brussels_Brabant_DataArray)

Expand Down
10 changes: 2 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,9 @@
'numpy',
'scipy',
'pandas',
'xlrd',
'openpyxl',
'zarr',
'emcee',
'xarray',
'rbfopt',
'openpyxl',
'numba',
'SAlib',
'h5py'
'pySODM',
],
extras_require={
"develop": ["pytest",
Expand Down
8 changes: 4 additions & 4 deletions src/covid19_DTM/data/model_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,13 +464,13 @@ def get_COVID19_SEIQRD_VOC_parameters(VOCs=['WT', 'abc', 'delta', 'omicron'], pa
index=['WT', 'abc', 'delta', 'omicron'], columns=pd.MultiIndex.from_tuples(columns))

# Define logistic growth properties
VOC_parameters.loc['WT']['logistic_growth'] = [
VOC_parameters.loc['WT', 'logistic_growth'] = [
datetime(2019, 1, 1), datetime(2019, 2, 1), 0.20]
VOC_parameters.loc['abc']['logistic_growth'] = [
VOC_parameters.loc['abc', 'logistic_growth'] = [
datetime(2020, 12, 1), datetime(2021, 2, 14), 0.07]
VOC_parameters.loc['delta']['logistic_growth'] = [
VOC_parameters.loc['delta', 'logistic_growth'] = [
datetime(2021, 5, 1), datetime(2021, 6, 25), 0.11]
VOC_parameters.loc['omicron']['logistic_growth'] = [
VOC_parameters.loc['omicron', 'logistic_growth'] = [
datetime(2021, 11, 26), datetime(2021, 12, 24), 0.19]

# Define variant properties
Expand Down

0 comments on commit ef6087f

Please sign in to comment.