Skip to content
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

Merged
merged 21 commits into from
Aug 5, 2024
Merged

Conversation

Emmo213
Copy link

@Emmo213 Emmo213 commented Jul 23, 2024

Updated the daily chart to support only the light/dark themes based on the settings file.

@alexbelgium
Copy link

Works nicely! It looks slightly dull though... What do you think of making the species colors shades of red instead of shades of gray? As this might then recall the colors of the logos ?

image

@Emmo213
Copy link
Author

Emmo213 commented Jul 25, 2024

Personally a "dark" theme to me is mostly black, white, and grey, so I don't think having reds and pinks would fit.

@Nachtzuster
Copy link
Owner

@alexbelgium , @Hiemstra87 does this match the rest of the dark 'colour' scheme, or are there some tweaks needed?

@alexbelgium
Copy link

alexbelgium commented Jul 30, 2024

what do you think of a slightly darker background to make it less luminous ?

@Emmo213
Copy link
Author

Emmo213 commented Jul 30, 2024

Sure, how does this look?

Current:
image

Proposed:
image

@alexbelgium
Copy link

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
It is also a color that seems very aligned with the rest of the theme

Thanks for checking that !

@Emmo213
Copy link
Author

Emmo213 commented Jul 30, 2024

Changes pushed. I actually used the "darkgrey" color that you suggested. With the darker background I was also able to make the current hour a different color again. 

image

@alexbelgium
Copy link

@alexbelgium , @Hiemstra87 does this match the rest of the dark 'colour' scheme, or are there some tweaks needed?

Ready to merge for me! Thanks @Emmo213

@Emmo213
Copy link
Author

Emmo213 commented Jul 30, 2024

Not sure what the linter is unhappy about. Let me install it locally to verify.

Copy link
Owner

@Nachtzuster Nachtzuster left a 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!

@@ -17,7 +17,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.9.x'
python-version: '3.11.x'
Copy link
Owner

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.

Copy link
Author

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.

Copy link

@alexbelgium alexbelgium Aug 3, 2024

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

Copy link
Author

@Emmo213 Emmo213 Aug 3, 2024

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.

@@ -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']:
Copy link
Owner

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?

Copy link
Author

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

Copy link
Owner

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When there is general code cleanup do you want that in a separate PR? In this case it's adding a blank line between two functions that didn't have the blank line and should have.

image

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')
Copy link
Owner

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?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

scripts/daily_plot.py Show resolved Hide resolved
@Emmo213
Copy link
Author

Emmo213 commented Aug 3, 2024

Back leveled to Python 3.9.

scripts/daily_plot.py Outdated Show resolved Hide resolved
Comment on lines 82 to 85
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')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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')

Copy link
Author

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

@Nachtzuster Nachtzuster merged commit 73d2ba5 into Nachtzuster:main Aug 5, 2024
1 check passed
@Emmo213 Emmo213 deleted the dark_daily_chart_file_based branch August 5, 2024 19:43
@Emmo213
Copy link
Author

Emmo213 commented Aug 5, 2024

Sweetness. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants