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
예제 #2
0
 def fulltext_cta(self):
     return get_genre_config(self.genre)["fulltext_cta"]
예제 #3
0
 def genre_url_key(self):
     return get_genre_config(self.genre)["url_representation"]
예제 #4
0
 def display_genre_plural(self):
     return get_genre_config(self.genre)["plural_name"]
예제 #5
0
 def icon(self):
     return get_genre_config(self.name)["icon"]
예제 #6
0
 def url_representation(self):
     return get_genre_config(self.name)["url_representation"]
예제 #7
0
 def plural_name(self):
     return get_genre_config(self.name)["plural_name"]