pymodeler/model.py
def set_attributes(self, **kwargs):
        """
        Set a group of attributes (parameters and members).  Calls
        `setp` directly, so kwargs can include more than just the
        parameter value (e.g., bounds, free, etc.).
        """
        self.clear_derived()
        kwargs = dict(kwargs)
        for name, value in kwargs.items():
            # Raise AttributeError if param not found
            try:
                self.getp(name)
            except KeyError:
                print ("Warning: %s does not have attribute %s" %
                       (type(self), name))
            # Set attributes
            try:
                self.setp(name, clear_derived=False, **value)
            except TypeError:
                try:
                    self.setp(name, clear_derived=False, *value)
                except (TypeError, KeyError):
                    try:
                        self.setp(name, clear_derived=False, value=value)
                    except (TypeError, KeyError):
                        self.__setattr__(name, value)
            # pop this attribued off the list of missing properties
            self._missing.pop(name, None)
        # Check to make sure we got all the required properties
        if self._missing:
            raise ValueError(
                "One or more required properties are missing ",
                self._missing.keys())
def set_attributes(self, **kwargs):
        """
        Set a group of attributes (parameters and members).  Calls
        `setp` directly, so kwargs can include more than just the
        parameter value (e.g., bounds, free, etc.).
        """
        self.clear_derived()
        kwargs = dict(kwargs)
        for name, value in kwargs.items():
            # Raise AttributeError if param not found
            try:
                self.getp(name)
            except KeyError:
                print ("Warning: %s does not have attribute %s" %
                       (type(self), name))
            # Set attributes
            try:
                self.setp(name, clear_derived=False, **value)
            except TypeError:
                try:
                    self.setp(name, clear_derived=False, *value)
                except (TypeError, KeyError):
                    try:
                        self.setp(name, clear_derived=False, value=value)
                    except (TypeError, KeyError):
                        self.__setattr__(name, value)
            # pop this attribued off the list of missing properties
            self._missing.pop(name, None)
        # Check to make sure we got all the required properties
        if self._missing:
            raise ValueError(
                "One or more required properties are missing ",
                self._missing.keys())
Set a group of attributes (parameters and members).  Calls
        `setp` directly, so kwargs can include more than just the
        parameter value (e.g., bounds, free, etc.).