Skip to content

Minor Python 2 to Python 3 changes#387

Merged
bmcfee merged 7 commits intomir-evaluation:mainfrom
carlthome:pyupgrade
Dec 6, 2024
Merged

Minor Python 2 to Python 3 changes#387
bmcfee merged 7 commits intomir-evaluation:mainfrom
carlthome:pyupgrade

Conversation

@carlthome
Copy link
Copy Markdown
Contributor

Very minor nitpicks but perhaps nice to keep the syntax fresh since Python 3.8 is now the latest non-EOL version.

  1. Drop utf-8 encoding header
  2. Use f-strings
  3. Use set comprehension, set literals, dict comprehensions, instead of converting lists

Nothing major and not urgent to fix. And TBH arguably not worth merging in case this breaks unexpected monkey patches in the wild. This is just me sitting at an airport with a coffee and reading the source. 😄

@carlthome
Copy link
Copy Markdown
Contributor Author

Ah, so black is enforced on the source code now too? That's nice!

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Aug 18, 2024

Codecov Report

Attention: Patch coverage is 94.44444% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
mir_eval/display.py 75.00% 1 Missing ⚠️
Flag Coverage Δ
unittests 85.46% <94.44%> (-10.28%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
mir_eval/chord.py 99.20% <100.00%> (ø)
mir_eval/hierarchy.py 100.00% <ø> (ø)
mir_eval/io.py 91.95% <100.00%> (-4.03%) ⬇️
mir_eval/key.py 97.67% <ø> (ø)
mir_eval/pattern.py 98.69% <100.00%> (ø)
mir_eval/segment.py 98.00% <ø> (ø)
mir_eval/separation.py 9.49% <ø> (-89.83%) ⬇️
mir_eval/tempo.py 100.00% <100.00%> (ø)
mir_eval/util.py 98.01% <100.00%> (-0.76%) ⬇️
mir_eval/display.py 77.05% <75.00%> (-8.58%) ⬇️

Copy link
Copy Markdown
Collaborator

@bmcfee bmcfee left a comment

Choose a reason for hiding this comment

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

All looks good to me, thanks!

@bmcfee bmcfee added this to the 0.8 milestone Aug 18, 2024
@bmcfee bmcfee merged commit 935451d into mir-evaluation:main Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants