Correcting additional flake8 failures on plotly_streamlit.py
Corrected: F401 imported but unused E501 line too long
This commit is contained in:
+17
-11
@@ -4,8 +4,7 @@ import pandas as pd
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import plotly.graph_objects as go
|
import plotly.graph_objects as go
|
||||||
from plotly.subplots import make_subplots
|
from plotly.subplots import make_subplots
|
||||||
from datetime import timedelta, datetime
|
from datetime import timedelta
|
||||||
from pathlib import Path
|
|
||||||
import sqlite3
|
import sqlite3
|
||||||
from sqlite3 import Connection
|
from sqlite3 import Connection
|
||||||
|
|
||||||
@@ -93,8 +92,11 @@ top_N = cols1.slider(
|
|||||||
top_N_species = (df2['Com_Name'].value_counts()[:top_N])
|
top_N_species = (df2['Com_Name'].value_counts()[:top_N])
|
||||||
|
|
||||||
|
|
||||||
specie = cols2.selectbox('Which bird would you like to explore for the dates ' + str(Date_Slider[0]) + ' to ' + str(Date_Slider[1]) + '?', species,
|
specie = cols2.selectbox(
|
||||||
index=species.index(list(top_N_species.index)[0]))
|
'Which bird would you like to explore for the dates ' +
|
||||||
|
str(Date_Slider[0]) + ' to ' + str(Date_Slider[1]) + '?',
|
||||||
|
species,
|
||||||
|
index=species.index(list(top_N_species.index)[0]))
|
||||||
|
|
||||||
|
|
||||||
font_size = 15
|
font_size = 15
|
||||||
@@ -109,12 +111,16 @@ fig = make_subplots(
|
|||||||
rows=3, cols=2,
|
rows=3, cols=2,
|
||||||
specs=[[{"type": "xy", "rowspan": 3}, {"type": "polar", "rowspan": 2}], [
|
specs=[[{"type": "xy", "rowspan": 3}, {"type": "polar", "rowspan": 2}], [
|
||||||
{"rowspan": 1}, {"rowspan": 1}], [None, {"type": "xy", "rowspan": 1}]],
|
{"rowspan": 1}, {"rowspan": 1}], [None, {"type": "xy", "rowspan": 1}]],
|
||||||
subplot_titles=('<b>Top ' + str(top_N) + ' Species in Date Range ' + str(Date_Slider[0]) + ' to ' + str(Date_Slider[1]) + '</b>',
|
subplot_titles=(
|
||||||
'Total Detect:' + str('{:,}'.format(sum(df_counts.Time))) +
|
'<b>Top ' + str(top_N) +
|
||||||
' Confidence Max:' + str('{:.2f}%'.format(max(df2[df2['Com_Name'] == specie]['Confidence']) * 100)) +
|
' Species in Date Range ' + str(Date_Slider[0]) +
|
||||||
' ' + ' Median:' +
|
' to ' + str(Date_Slider[1]) +
|
||||||
str('{:.2f}%'.format(np.median(df2[df2['Com_Name'] == specie]['Confidence']) * 100))
|
'</b>',
|
||||||
)
|
'Total Detect:' + str('{:,}'.format(sum(df_counts.Time))) +
|
||||||
|
' Confidence Max:' + str('{:.2f}%'.format(max(df2[df2['Com_Name'] == specie]['Confidence']) * 100)) +
|
||||||
|
' ' + ' Median:' +
|
||||||
|
str('{:.2f}%'.format(np.median(df2[df2['Com_Name'] == specie]['Confidence']) * 100))
|
||||||
|
)
|
||||||
)
|
)
|
||||||
fig.layout.annotations[1].update(x=0.7, y=0.25, font_size=15)
|
fig.layout.annotations[1].update(x=0.7, y=0.25, font_size=15)
|
||||||
|
|
||||||
@@ -170,6 +176,6 @@ st.plotly_chart(fig, use_container_width=True) # , config=config)
|
|||||||
#
|
#
|
||||||
# extract_date=Date_Slider
|
# extract_date=Date_Slider
|
||||||
#
|
#
|
||||||
# audio_file = open('/home/*/BirdSongs/Extracted/By_Date/2022-03-22/Yellow-streaked_Greenbul/Yellow-streaked_Greenbul-77-2022-03-22-birdnet-15:04:28.mp3', 'rb')
|
# audio_file = open('/home/*/BirdSongs/Extracted/By_Date/2022-03-22/Yellow-streaked_Greenbul/Yellow-streaked_Greenbul-77-2022-03-22-birdnet-15:04:28.mp3', 'rb') # noqa: E501
|
||||||
# audio_bytes = audio_file.read()
|
# audio_bytes = audio_file.read()
|
||||||
# cols4.audio(audio_bytes, format='audio/mp3')
|
# cols4.audio(audio_bytes, format='audio/mp3')
|
||||||
|
|||||||
Reference in New Issue
Block a user