def get_percentile(self, provider, interaction, raw_value): percentile_list_dict = self.get_percentile_lookup_list(provider, interaction) if not percentile_list_dict or not percentile_list_dict["percentile_list"]: return None percentile = 0 for p in percentile_list_dict["percentile_list"].percentiles: percentile += 1 if p >= raw_value: break if percentile >= 100: percentile = 99 lookup_mendeley_discipline = percentile_list_dict["mendeley_discipline"] if not lookup_mendeley_discipline or lookup_mendeley_discipline==u'ALL': lookup_mendeley_discipline = "" response = { "value": percentile, "mendeley_discipline_str": lookup_mendeley_discipline, "genre_plural": get_genre_config(self.genre)["plural_name"] } return response
def fulltext_cta(self): return get_genre_config(self.genre)["fulltext_cta"]
def genre_url_key(self): return get_genre_config(self.genre)["url_representation"]
def display_genre_plural(self): return get_genre_config(self.genre)["plural_name"]
def icon(self): return get_genre_config(self.name)["icon"]
def url_representation(self): return get_genre_config(self.name)["url_representation"]
def plural_name(self): return get_genre_config(self.name)["plural_name"]