Example #1
0
    def get_can_provide_methods(self):
        """
        Get a dictionary of quantities X that can be retrieved using get_X methods.

        :return: dictionary of the form {X: get_X method}
        """
        return get_class_methods(self.get_provider().__class__, not_base=Theory)
Example #2
0
 def get_can_provide_params(self):
     # possible derived parameters for derived_extra, excluding things that are
     # only input parameters.
     params_derived = list(get_class_methods(self.camb.CAMBparams))
     params_derived.remove("custom_source_names")
     fields = []
     for f, tp in self.camb.CAMBparams._fields_:
         if tp is ctypes.c_double and 'max_eta_k' not in f \
                 and f not in ['Alens', 'num_nu_massless']:
             fields.append(f)
     fields += ['omega_de', 'sigma8']  # only parameters from CAMBdata
     properties = get_properties(self.camb.CAMBparams)
     names = self.camb.model.derived_names + properties + fields + params_derived
     for name, mapped in self.renames.items():
         if mapped in names:
             names.append(name)
     # remove any parameters explicitly tagged as input requirements
     return set(names).difference(
         set(self._transfer_requires).union(set(self.requires)))