Fix issues identified by Codacy
https://app.codacy.com/manual/kgordon/beast/dashboard
There are a lot of style issues marked as "unidiomatic-typecheck" issues, e.g.,
type(sedgrid) == str should be isinstance(sedgrid, str), or type(lamb) in basestring should be isinstance(lamb, basestring). Note that the latter example will only work if basestring is a type or a tuple of types.
The other common issue (considered a security issue) is the use of assert. When compiled to bytecode, all statements such as assert (f1 >= 0) and (f2 >= 0) and (f1 <= 1) and (f2 <= 1) will be removed. The recommended way instead is:
if not (f1 >= 0) and (f2 >= 0) and (f1 <= 1) and (f2 <= 1):
raise AssertionError()
https://app.codacy.com/gh/BEAST-Fitting/beast/dashboard