dfm / george

Fast and flexible Gaussian Process regression in Python
http://george.readthedocs.io
MIT License
450 stars 128 forks source link

quiet keyword in Model class #123

Open gds38 opened 4 years ago

gds38 commented 4 years ago

Should it be possible to set "quiet" as a kwarg in the Model class? I'd like to change it from the default False. The last piece of code in the init function makes it look like it's possible:

    # Check the initial prior value
    quiet = kwargs.get("quiet", False)
    if not quiet and not np.isfinite(self.log_prior()):
        raise ValueError("non-finite log prior value") 

...but the preceding section (if len(kwargs:) raises the ValueError if you have set quiet as a kwarg:

    else:
        # Loop over the kwargs and set the parameter values
        params = []
        for k in self.parameter_names:
            v = kwargs.pop(k, None)
            if v is None:
                raise ValueError("missing parameter '{0}'".format(k))
            params.append(v)
        self.parameter_vector = params

        if len(kwargs):
            raise ValueError("unrecognized parameter(s) '{0}'"
                             .format(list(kwargs.keys())))