def __init__(self, *args, **kwargs): super(ExactName, self).__init__(*args, **kwargs) try: from mol_name import get_exact_name spacer = get_exact_name(self.log.name, spacers=True) self.value = spacer.replace('*', '') except Exception as e: self.value = None self.done = False
def get_exact_name(self, spacers=False): if self._exact_name is None: try: self._exact_name = get_exact_name(self.name, spacers=True) except Exception as e: self._name_error = str(e) self._exact_name = '' if spacers: return self._exact_name else: return self._exact_name.replace('*', '')
def __init__(self, *args, **kwargs): super(Features, self).__init__(*args, **kwargs) try: from mol_name import get_exact_name from ml import get_decay_distance_correction_feature_vector, \ get_binary_feature_vector, get_decay_feature_vector spacer, _ = get_exact_name(self.log.name, spacers=True) #exactname = spacer.replace('*', '') self.value = '"' + str([ get_binary_feature_vector(spacer), get_decay_feature_vector(spacer), get_decay_distance_correction_feature_vector(spacer), ]) + '"' except: self.value = "[]" self.done = True