Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_parray_none():
assert mu.parray('None') is None
def test_parray_empty():
np.testing.assert_equal(mu.parray(''), np.array([]))
def test_parray_numbers():
np.testing.assert_equal(mu.parray('1 2 3'),
np.array([1.0, 2.0, 3.0], np.double))
def test_parray_strings():
assert mu.parray("a b\nc") == ["a", "b", "c"]
group.add_argument("--savefile", dest="savefile", action="store",
type=str, default=None,
help="Output npz filename to store the parameter posterior "
"distributions [default: %(default)s]")
group.add_argument("-r", "--resume", dest="resume", action="store_true",
default=False,
help="If set, resume a previous run (load output).")
group.add_argument("--rms", dest="rms", action="store",
type=eval, default=False,
help="If True, calculate RMS-vs-binsize of data--bestmodel residuals "
"[default: %(default)s]")
group.add_argument("--log", dest="log", action="store",
type=str, default=None,
help="Output log filename.")
group.add_argument("--pnames", dest="pnames", action="store",
type=mu.parray, default=None,
help="List of parameter names for screen output (and figures if "
"texnames is not defined). If pnames is not defined, default "
"to texnames.")
group.add_argument("--texnames", dest="texnames", action="store",
type=mu.parray, default=None,
help="List of parameter names for figures (may use latex syntax). "
"[default: None]")
# Fitting-parameter Options:
group = parser.add_argument_group("Fitting-function Options")
group.add_argument("--func", dest="func", action="store",
type=mu.parray, default=None,
help="List of strings with the function name, module "
"name, and path-to-module [required]")
group.add_argument("--params", dest="params", action="store",
type=mu.parray, default=None,
help="Filename or list of initial-guess model-fitting "
group.add_argument("--prior", dest="prior", action="store",
type=mu.parray, default=None,
help="Filename or array with parameter prior estimates "
"[default: %(default)s]")
group.add_argument("--priorlow", dest="priorlow", action="store",
type=mu.parray, default=None,
help="Filename or array with prior lower uncertainties "
"[default: %(default)s]")
group.add_argument("--priorup", dest="priorup", action="store",
type=mu.parray, default=None,
help="Filename or array with prior upper uncertainties "
"[default: %(default)s]")
# Deprecated
group = parser.add_argument_group("Deprecated Options")
group.add_argument("--parname", dest="parname", action="store",
type=mu.parray, default=None,
help="Deprecated, use pnames instead.")
group.add_argument("--nproc", dest="nproc", action="store",
type=int, default=None,
help="Deprecated, use ncpu instead.")
group.add_argument("--stepsize", dest="stepsize", action="store",
type=mu.parray, default=None,
help="Deprecated, use pstep instead.")
group.add_argument("--chireturn", dest="chireturn", action="store",
default=None, help="Deprecated.")
group.add_argument("--full_output", dest="full_output", action="store",
default=None, help="Deprecated.")
group.add_argument("--lm", dest="lm", action="store",
default=None, help='Deprecated. See leastsq new usage.')
return parser