<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def diagnostics(self):
 """Dictionary access to all diagnostic variables :type: dict """

        diag_dict = {}
        for key in self._diag_vars:
            try:
                #diag_dict[key] = getattr(self,key)
                #  using self.__dict__ doesn't count diagnostics defined as properties
                diag_dict[key] = self.__dict__[key]
            except:
                pass
        return diag_dict