pymodeler/parameter.py
def value(self):
        """Return the current value.

        This first checks if the value is cached (i.e., if
        `self.__value__` is not None)

        If it is not cached then it invokes the `loader` function to
        compute the value, and caches the computed value

        """

        if self.__value__ is None:
            try: 
                loader = self.__dict__['loader']
            except KeyError:
                raise AttributeError("Loader is not defined")

            # Try to run the loader.
            # Don't catch expections here, let the Model class figure it out
            val = loader()

            # Try to set the value
            try:
                self.set_value(val)
            except TypeError:
                msg = "Loader must return variable of type %s or None, got %s" % (self.__dict__['dtype'], type(val))
                raise TypeError(msg)
        return self.__value__
def value(self):
        """Return the current value.

        This first checks if the value is cached (i.e., if
        `self.__value__` is not None)

        If it is not cached then it invokes the `loader` function to
        compute the value, and caches the computed value

        """

        if self.__value__ is None:
            try: 
                loader = self.__dict__['loader']
            except KeyError:
                raise AttributeError("Loader is not defined")

            # Try to run the loader.
            # Don't catch expections here, let the Model class figure it out
            val = loader()

            # Try to set the value
            try:
                self.set_value(val)
            except TypeError:
                msg = "Loader must return variable of type %s or None, got %s" % (self.__dict__['dtype'], type(val))
                raise TypeError(msg)
        return self.__value__
Return the current value.

        This first checks if the value is cached (i.e., if
        `self.__value__` is not None)

        If it is not cached then it invokes the `loader` function to
        compute the value, and caches the computed value