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

MAINT: Wave cleanup #5996

Merged
merged 6 commits into from
Mar 25, 2016
Merged

MAINT: Wave cleanup #5996

merged 6 commits into from
Mar 25, 2016

Conversation

endolith
Copy link
Member

@endolith endolith commented Mar 24, 2016

I started to look into supporting 24-bit WAV files, but decided I don't care enough now that I know about PySoundFile. :)

Here are some changes I made in the process of reading through the code. Just changed an error message, added comments, renamed a variable, and got rid of an unnecessary if/else.

@codecov-io
Copy link

@@            master   #5996   diff @@
======================================
  Files          238     238       
  Stmts        43768   43803    +35
  Branches      8221    8211    -10
  Methods          0       0       
======================================
+ Hit          34199   34230    +31
- Partial       2601    2603     +2
- Missed        6968    6970     +2

Review entire Coverage Diff as of abe67a5

Powered by Codecov. Updated on successful CI builds.

@larsoner
Copy link
Member

LGTM. Ready for merge from your end?

@endolith
Copy link
Member Author

yes, if you think they're all good changes.

@larsoner
Copy link
Member

Yeah, it makes the code look cleaner and read a bit better. I'll merge in a couple of days if nobody else has comments.

size = struct.unpack(fmt, fid.read(4))[0]

# Number of bytes per sample
bytes = bits//8
Copy link
Member

Choose a reason for hiding this comment

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

It might be worth renaming this variable to something like bytes_per_sample, while we're doing maintenance, to avoid shadowing the builtin name.

@perimosocordiae
Copy link
Member

I made one comment inline, but I think some of the places where comments were added might be better served by just giving the variable(s) a better name.

That said, this is a good change regardless, so I'm +1 with or without better variable names.

@endolith
Copy link
Member Author

some of the places where comments were added might be better served by just giving the variable(s) a better name.

That's what I was going to do, but then thought maybe it was important to keep the original names, since they're also argument names. I'll change them if you think it's a good idea.

@larsoner
Copy link
Member

Making the names more readable makes sense to me

move comments about meanings into docstring
@endolith
Copy link
Member Author

ok I did that

@@ -170,7 +195,7 @@ def read(filename, mmap=False):

Returns
-------
rate : int
fs : int
Sample rate of wav file as a Python integer.
Copy link
Member

Choose a reason for hiding this comment

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

don't need as a Python integer

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, just moved it from the notes section

@endolith
Copy link
Member Author

Ok changed

@larsoner
Copy link
Member

LGTM. @perimosocordiae you happy now?

@perimosocordiae perimosocordiae merged commit efa4f84 into scipy:master Mar 25, 2016
@perimosocordiae
Copy link
Member

LGTM, merged. Thanks, @endolith!

@endolith endolith deleted the wave_cleanup branch March 25, 2016 22:41
@ev-br ev-br added this to the 0.18.0 milestone Mar 26, 2016
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.

None yet

5 participants