flake8 fixes
This commit is contained in:
@@ -170,6 +170,7 @@ top_N_species = (df5.value_counts()[:top_N])
|
|||||||
|
|
||||||
font_size = 15
|
font_size = 15
|
||||||
|
|
||||||
|
|
||||||
def sunrise_sunset_scatter(num_days_to_display):
|
def sunrise_sunset_scatter(num_days_to_display):
|
||||||
latitude = df['Lat'][0]
|
latitude = df['Lat'][0]
|
||||||
longitude = df['Lon'][0]
|
longitude = df['Lon'][0]
|
||||||
@@ -209,12 +210,13 @@ def sunrise_sunset_scatter(num_days_to_display):
|
|||||||
sunrise_week_list.append(None)
|
sunrise_week_list.append(None)
|
||||||
sunrise_list.append(None)
|
sunrise_list.append(None)
|
||||||
sunrise_text_list.append(None)
|
sunrise_text_list.append(None)
|
||||||
sun_list = sunrise_list.extend(sunset_list)
|
sunrise_list.extend(sunset_list)
|
||||||
sun_week_list = sunrise_week_list.extend(sunset_week_list)
|
sunrise_week_list.extend(sunset_week_list)
|
||||||
sunrise_text_list.extend(sunset_text_list)
|
sunrise_text_list.extend(sunset_text_list)
|
||||||
|
|
||||||
return sunrise_week_list, sunrise_list, sunrise_text_list
|
return sunrise_week_list, sunrise_list, sunrise_text_list
|
||||||
|
|
||||||
|
|
||||||
def hms_to_dec(t):
|
def hms_to_dec(t):
|
||||||
# (h, m, s) = t.split(':')
|
# (h, m, s) = t.split(':')
|
||||||
h = t.hour
|
h = t.hour
|
||||||
@@ -223,6 +225,7 @@ def hms_to_dec(t):
|
|||||||
result = h + m + s
|
result = h + m + s
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
def hms_to_str(t):
|
def hms_to_str(t):
|
||||||
# (h, m, s) = t.split(':')
|
# (h, m, s) = t.split(':')
|
||||||
h = t.hour
|
h = t.hour
|
||||||
@@ -470,10 +473,10 @@ if daily is False:
|
|||||||
y_downscale_factor = int(len(saved_time_labels) / number_of_y_ticks)
|
y_downscale_factor = int(len(saved_time_labels) / number_of_y_ticks)
|
||||||
fig.update_layout(
|
fig.update_layout(
|
||||||
yaxis=dict(
|
yaxis=dict(
|
||||||
tickmode = 'array',
|
tickmode='array',
|
||||||
tickvals = day_hour_freq.columns[::y_downscale_factor],
|
tickvals=day_hour_freq.columns[::y_downscale_factor],
|
||||||
ticktext = saved_time_labels[::y_downscale_factor],
|
ticktext=saved_time_labels[::y_downscale_factor],
|
||||||
nticks = 6
|
nticks=6
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
st.plotly_chart(fig, use_container_width=True) # , config=config)
|
st.plotly_chart(fig, use_container_width=True) # , config=config)
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ def sendAppriseNotifications(species, confidence, confidencepct, path,
|
|||||||
if APPRISE_ONLY_NOTIFY_SPECIES_NAMES is not None and APPRISE_ONLY_NOTIFY_SPECIES_NAMES.strip() != "":
|
if APPRISE_ONLY_NOTIFY_SPECIES_NAMES is not None and APPRISE_ONLY_NOTIFY_SPECIES_NAMES.strip() != "":
|
||||||
if any(bird.lower().replace(" ", "") in comName.lower().replace(" ", "") for bird in APPRISE_ONLY_NOTIFY_SPECIES_NAMES.split(",")):
|
if any(bird.lower().replace(" ", "") in comName.lower().replace(" ", "") for bird in APPRISE_ONLY_NOTIFY_SPECIES_NAMES.split(",")):
|
||||||
return
|
return
|
||||||
|
|
||||||
APPRISE_ONLY_NOTIFY_SPECIES_NAMES_2 = settings_dict.get('APPRISE_ONLY_NOTIFY_SPECIES_NAMES_2')
|
APPRISE_ONLY_NOTIFY_SPECIES_NAMES_2 = settings_dict.get('APPRISE_ONLY_NOTIFY_SPECIES_NAMES_2')
|
||||||
if APPRISE_ONLY_NOTIFY_SPECIES_NAMES_2 is not None and APPRISE_ONLY_NOTIFY_SPECIES_NAMES_2.strip() != "":
|
if APPRISE_ONLY_NOTIFY_SPECIES_NAMES_2 is not None and APPRISE_ONLY_NOTIFY_SPECIES_NAMES_2.strip() != "":
|
||||||
if not any(bird.lower().replace(" ", "") in comName.lower().replace(" ", "") for bird in APPRISE_ONLY_NOTIFY_SPECIES_NAMES_2.split(",")):
|
if not any(bird.lower().replace(" ", "") in comName.lower().replace(" ", "") for bird in APPRISE_ONLY_NOTIFY_SPECIES_NAMES_2.split(",")):
|
||||||
@@ -86,9 +86,10 @@ def sendAppriseNotifications(species, confidence, confidencepct, path,
|
|||||||
try:
|
try:
|
||||||
# TODO: Make this work with non-english comnames. Implement the "// convert sci name to English name" logic from overview.php here
|
# TODO: Make this work with non-english comnames. Implement the "// convert sci name to English name" logic from overview.php here
|
||||||
headers = {'User-Agent': 'Python_Flickr/1.0'}
|
headers = {'User-Agent': 'Python_Flickr/1.0'}
|
||||||
url = 'https://www.flickr.com/services/rest/?method=flickr.photos.search&api_key='+str(settings_dict.get('FLICKR_API_KEY'))+'&text='+str(comName)+' bird&sort=relevance&per_page=5&media=photos&format=json&license=2%2C3%2C4%2C5%2C6%2C9&nojsoncallback=1'
|
url = ('https://www.flickr.com/services/rest/?method=flickr.photos.search&api_key=' + str(settings_dict.get('FLICKR_API_KEY')) +
|
||||||
|
'&text=' + str(comName) + ' bird&sort=relevance&per_page=5&media=photos&format=json&license=2%2C3%2C4%2C5%2C6%2C9&nojsoncallback=1')
|
||||||
resp = requests.get(url=url, headers=headers)
|
resp = requests.get(url=url, headers=headers)
|
||||||
|
|
||||||
resp.encoding = "utf-8"
|
resp.encoding = "utf-8"
|
||||||
data = resp.json()["photos"]["photo"][0]
|
data = resp.json()["photos"]["photo"][0]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user