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

Update spectrogram.py #2034

Closed
wants to merge 9 commits into from
Closed

Conversation

prateekiiest
Copy link
Contributor

Formatted some attributes under class Spectogram

@pep8speaks
Copy link

pep8speaks commented Mar 10, 2017

Hello @prateekiiest! Thanks for updating the PR.

Line 763:39: E261 at least two spaces before inline comment
Line 765:62: E261 at least two spaces before inline comment
Line 766:48: E261 at least two spaces before inline comment
Line 789:32: E261 at least two spaces before inline comment
Line 791:64: E261 at least two spaces before inline comment
Line 902:9: E128 continuation line under-indented for visual indent
Line 903:9: E125 continuation line with same indent as next logical line
Line 903:9: E128 continuation line under-indented for visual indent
Line 956:59: E261 at least two spaces before inline comment
Line 957:70: E261 at least two spaces before inline comment
Line 974:9: E125 continuation line with same indent as next logical line
Line 974:9: E128 continuation line under-indented for visual indent
Line 1127:41: E261 at least two spaces before inline comment
Line 1229:101: E501 line too long (105 > 100 characters)
Line 1233:101: E501 line too long (103 > 100 characters)

Comment last updated on April 13, 2017 at 07:41 Hours UTC

Copy link
Contributor Author

@prateekiiest prateekiiest left a comment

Choose a reason for hiding this comment

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

Fixed Pep8 issues

@prateekiiest
Copy link
Contributor Author

issue #2033
ping @Cadair

@nitinkgp23
Copy link
Contributor

nitinkgp23 commented Mar 10, 2017

You should be checking for issues in your appveyor build. I guess, you have done a mistake in fixing pep8.

Copy link
Contributor Author

@prateekiiest prateekiiest left a comment

Choose a reason for hiding this comment

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

Pep8 fixed issues created issue.
Fixed it :)

@prateekiiest
Copy link
Contributor Author

Thanks @nitinkgp23 :)

Copy link
Contributor Author

@prateekiiest prateekiiest left a comment

Choose a reason for hiding this comment

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

Some remaining issues fixed.

@prateekiiest
Copy link
Contributor Author

I think this area is still under development as suggested by the docs. So an error is coming here.
In data = self.data[y_range, x_range] arguments should be of type int.

@Cadair
Copy link
Member

Cadair commented Mar 16, 2017

have you merged master in?

@prateekiiest
Copy link
Contributor Author

prateekiiest commented Mar 16, 2017

I didn't get you @Cadair

@nitinkgp23
Copy link
Contributor

@prateekiiest The master branch has been updated. Rebase your branch with master.

@prateekiiest
Copy link
Contributor Author

prateekiiest commented Mar 16, 2017

Ok,
so some issue was fixed regarding this file I guess, a day ago

Copy link
Contributor Author

@prateekiiest prateekiiest left a comment

Choose a reason for hiding this comment

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

Rebased branch

@@ -274,28 +274,28 @@ class Spectrogram(Parent):

Attributes
----------
data : `~numpy.ndarray`
`~data` : `~numpy.ndarray`
Copy link
Member

Choose a reason for hiding this comment

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

this needs updating. The following conventions should be followed for docstrings:

  1. Types (both built-in and things like numpy.ndarray) should be in single backticks and optionally have a ~ in front to only display the name of the class and not the whole thing, i.e ndarray over numpy.ndarray. (So built in types should not have a tilde).
  2. Variable names that are not importable (like arguments to functions) should be in double backticks i.e:
``data``

Copy link
Contributor Author

@prateekiiest prateekiiest left a comment

Choose a reason for hiding this comment

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

didnt give tilde as its optional

if start:
start = int(start)
if end:
end = int(end)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe I am confused, but instead of these if statements, would it not just be possible to int(start):int(end) on the return statement below?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nabobalis
I think start and end variables are updated in the if statement.
I am not sure much, I need to go through the code for this.

Copy link
Contributor

Choose a reason for hiding this comment

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

These need to be moved into lines 1249 and 1262. The whole if statement is not needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done @nabobalis
Why was it wrong in the previous case?

Copy link
Contributor Author

@prateekiiest prateekiiest left a comment

Choose a reason for hiding this comment

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

checked

if start:
start = int(start)
if end:
end = int(end)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nabobalis
I think start and end variables are updated in the if statement.
I am not sure much, I need to go through the code for this.

@prateekiiest
Copy link
Contributor Author

is it now ok @Cadair ?

@prateekiiest
Copy link
Contributor Author

should I rebase?

@nabobalis
Copy link
Contributor

This failure seems to be an online test issue. I will rekick travis for kicks.

@prateekiiest
Copy link
Contributor Author

Ok thanks :)

header for the image
instruments : str array
``instruments`` : `str array`
Copy link
Contributor

Choose a reason for hiding this comment

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

These changes to the documentation are incorrect, they would need to be reverted. The `` do not need be on the right hand side and on the left only for individual types.

@@ -274,28 +274,28 @@ class Spectrogram(Parent):

Attributes
----------
data : `~numpy.ndarray`
Copy link
Contributor

Choose a reason for hiding this comment

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

The ~ will be needed here. It hides certain parts when the documentation is built.

@@ -274,28 +274,28 @@ class Spectrogram(Parent):

Attributes
----------
data : `~numpy.ndarray`
Copy link
Contributor

Choose a reason for hiding this comment

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

The ~ will be needed here. It hides certain parts when the documentation is built.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it ok now?

if start:
start = int(start)
if end:
end = int(end)
Copy link
Contributor

Choose a reason for hiding this comment

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

These need to be moved into lines 1249 and 1262. The whole if statement is not needed.

Copy link
Contributor Author

@prateekiiest prateekiiest left a comment

Choose a reason for hiding this comment

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

Added ~ and removed backticks on right hand side in some cases.

Copy link
Contributor Author

@prateekiiest prateekiiest left a comment

Choose a reason for hiding this comment

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

If statement shifted to block 1243

@prateekiiest
Copy link
Contributor Author

@nabobalis failing due to if block shifting?
The argument for int() can not be datetime

@nabobalis
Copy link
Contributor

I wasn't clear in my comments. I didn't want to remove the code previous block of code. What needed to be moved was the int(start) and int(end) into the main if statement block for each. Otherwise, if start is None, int(None) will error.

So the changes to be made here would be:

start = self.time_to_x(start)
end = self.time_to_x(end)

would be

start = int(self.time_to_x(start))
end = int(self.time_to_x(end))

Also all the documentation changes made in the PR are wrong.

I would recommend starting again and just committing the spectrogram changes in a fresh PR.

@prateekiiest
Copy link
Contributor Author

prateekiiest commented Apr 13, 2017

OK, I will send a new PR regarding this.
But I'm really packed up right now due to my semester exams. So I will not be able to devote much time untill 28th April.
After that I will be addressing to the PRs opened by me (probably 3 here) and one PR under website repo :)

@Cadair Cadair closed this Apr 13, 2017
@prateekiiest prateekiiest deleted the patch-5 branch April 13, 2017 11:20
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