-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dark daily chart #152
Dark daily chart #152
Conversation
Personally a "dark" theme to me is mostly black, white, and grey, so I don't think having reds and pinks would fit. |
…213/BirdNET-Pi into dark_daily_chart_file_based
@alexbelgium , @Hiemstra87 does this match the rest of the dark 'colour' scheme, or are there some tweaks needed? |
what do you think of a slightly darker background to make it less luminous ? |
I very much like the proposed one - I think it highlights in a nice fashion the birds graphs. It is easier in my opinion to read it Thanks for checking that ! |
Ready to merge for me! Thanks @Emmo213 |
Not sure what the linter is unhappy about. Let me install it locally to verify. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally got some time to look into this, thanks for your patience!
.github/workflows/python-ci.yml
Outdated
@@ -17,7 +17,7 @@ jobs: | |||
- name: Setup Python | |||
uses: actions/setup-python@v3 | |||
with: | |||
python-version: '3.9.x' | |||
python-version: '3.11.x' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to stay on 3.9: people that migrated their installation in place from the original BirdNET-Pi are still on 3.9.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3.9 is about 4 years old. When can we move to a more up to date version? Should updating Python and/or other dependencies be part of the update script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What Nachtzuster means (I think) is that birdnet pi has an incremental auto update feature. So if we change the dependency to a newer version of python incremental update won't work and it will break functionality for older users - to avoid needing to change the update logic he therefore prefers to avoid breaking changes such as this one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just think at some point we're going to want to have an update, if not for better Python features than to avoid any potential security issues. It doesn't need to be bleeding edge but generally speaking staying back leveled isn't ideal.
Edit: while my points are still valid I'll back level my code for the sake of back leveling my code.
scripts/daily_plot.py
Outdated
@@ -43,7 +45,11 @@ def show_values_on_bars(ax, label): | |||
# Species Count Total | |||
value = '{:n}'.format(p.get_width()) | |||
bbox = {'facecolor': 'lightgrey', 'edgecolor': 'none', 'pad': 1.0} | |||
ax.text(x, y, value, bbox=bbox, ha='center', va='center', size=9, color='darkgreen') | |||
match conf['COLOR_SCHEME']: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Match was only introduced with Python 3.10; this was giving the syntax error earlier. Could you change to a if/else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, which is why I moved the version to 3.11.
If we're not updating the Python version I can change this to an if/else - it's just a less elegant solution.
@@ -180,6 +180,7 @@ fi | |||
if [ -L /usr/local/bin/analyze.py ];then | |||
rm -f /usr/local/bin/analyze.py | |||
fi | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't do changes in unrelated files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scripts/daily_plot.py
Outdated
f, axs = plt.subplots(1, 2, figsize=(10, height), gridspec_kw=dict(width_ratios=[3, 6]), facecolor='#77C487') | ||
match conf['COLOR_SCHEME']: | ||
case "dark": | ||
f, axs = plt.subplots(1, 2, figsize=(10, height), gridspec_kw=dict(width_ratios=[3, 6]), facecolor='darkgrey') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you move f, axs = ...
out the case and only assign facecolor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Back leveled to Python 3.9. |
scripts/daily_plot.py
Outdated
if conf['COLOR_SCHEME'] == "dark": | ||
f, axs = plt.subplots(1, 2, figsize=(10, height), gridspec_kw=dict(width_ratios=[3, 6]), facecolor='darkgrey') | ||
else: | ||
f, axs = plt.subplots(1, 2, figsize=(10, height), gridspec_kw=dict(width_ratios=[3, 6]), facecolor='none') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if conf['COLOR_SCHEME'] == "dark": | |
f, axs = plt.subplots(1, 2, figsize=(10, height), gridspec_kw=dict(width_ratios=[3, 6]), facecolor='darkgrey') | |
else: | |
f, axs = plt.subplots(1, 2, figsize=(10, height), gridspec_kw=dict(width_ratios=[3, 6]), facecolor='none') | |
if conf['COLOR_SCHEME'] == "dark": | |
facecolor='darkgrey' | |
else: | |
facecolor='none' | |
f, axs = plt.subplots(1, 2, figsize=(10, height), gridspec_kw=dict(width_ratios=[3, 6]), facecolor='darkgrey') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change made using variable instead of hardcoded color
Co-authored-by: Nachtzuster <[email protected]>
Sweetness. Thank you! |
Updated the daily chart to support only the light/dark themes based on the settings file.