Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Chris Jewell
covid19uk
Commits
5d267412
Commit
5d267412
authored
Oct 03, 2020
by
Chris Jewell
Browse files
Switched to `argparse` library from deprecated `optparse`
parent
a57e2519
Changes
1
Hide whitespace changes
Inline
Side-by-side
inference.py
View file @
5d267412
"""MCMC Test Rig for COVID-19 UK model"""
import
opt
parse
import
arg
parse
import
os
from
time
import
perf_counter
...
...
@@ -36,18 +36,14 @@ DTYPE = config.floatX
if
__name__
==
"__main__"
:
# Read in settings
parser
=
optparse
.
OptionParser
()
parser
.
add_option
(
"--config"
,
"-c"
,
dest
=
"config"
,
default
=
"example_config.yaml"
,
help
=
"configuration file"
,
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"-c"
,
"--config"
,
default
=
"example_config.yaml"
,
help
=
"configuration file"
,
)
options
,
cmd_
args
=
parser
.
parse_args
()
print
(
"Loading config file:"
,
option
s
.
config
)
args
=
parser
.
parse_args
()
print
(
"Loading config file:"
,
arg
s
.
config
)
with
open
(
option
s
.
config
,
"r"
)
as
f
:
with
open
(
arg
s
.
config
,
"r"
)
as
f
:
config
=
yaml
.
load
(
f
,
Loader
=
yaml
.
FullLoader
)
covar_data
=
model_spec
.
read_covariates
(
config
[
"data"
])
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment