Correcting additional flake8 failures on plotly_streamlit.py
Corrected: F401 imported but unused E501 line too long
This commit is contained in:
@@ -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,7 +92,10 @@ 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(
|
||||||
|
'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]))
|
index=species.index(list(top_N_species.index)[0]))
|
||||||
|
|
||||||
|
|
||||||
@@ -109,7 +111,11 @@ 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=(
|
||||||
|
'<b>Top ' + str(top_N) +
|
||||||
|
' Species in Date Range ' + str(Date_Slider[0]) +
|
||||||
|
' to ' + str(Date_Slider[1]) +
|
||||||
|
'</b>',
|
||||||
'Total Detect:' + str('{:,}'.format(sum(df_counts.Time))) +
|
'Total Detect:' + str('{:,}'.format(sum(df_counts.Time))) +
|
||||||
' Confidence Max:' + str('{:.2f}%'.format(max(df2[df2['Com_Name'] == specie]['Confidence']) * 100)) +
|
' Confidence Max:' + str('{:.2f}%'.format(max(df2[df2['Com_Name'] == specie]['Confidence']) * 100)) +
|
||||||
' ' + ' Median:' +
|
' ' + ' Median:' +
|
||||||
@@ -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