-
-
Notifications
You must be signed in to change notification settings - Fork 573
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
Update spectrogram.py #2034
Conversation
Hello @prateekiiest! Thanks for updating the PR.
Comment last updated on April 13, 2017 at 07:41 Hours UTC |
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.
Fixed Pep8 issues
You should be checking for issues in your appveyor build. I guess, you have done a mistake in fixing pep8. |
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.
Pep8 fixed issues created issue.
Fixed it :)
Thanks @nitinkgp23 :) |
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.
Some remaining issues fixed.
I think this area is still under development as suggested by the docs. So an error is coming here. |
have you merged master in? |
I didn't get you @Cadair |
@prateekiiest The master branch has been updated. Rebase your branch with master. |
Ok, |
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.
Rebased branch
sunpy/spectra/spectrogram.py
Outdated
@@ -274,28 +274,28 @@ class Spectrogram(Parent): | |||
|
|||
Attributes | |||
---------- | |||
data : `~numpy.ndarray` | |||
`~data` : `~numpy.ndarray` |
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 updating. The following conventions should be followed for docstrings:
- 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.endarray
overnumpy.ndarray
. (So built in types should not have a tilde). - Variable names that are not importable (like arguments to functions) should be in double backticks i.e:
``data``
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.
didnt give tilde as its optional
sunpy/spectra/spectrogram.py
Outdated
if start: | ||
start = int(start) | ||
if end: | ||
end = int(end) |
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.
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?
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.
@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.
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.
These need to be moved into lines 1249 and 1262. The whole if statement is not needed.
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 @nabobalis
Why was it wrong in the previous case?
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.
checked
sunpy/spectra/spectrogram.py
Outdated
if start: | ||
start = int(start) | ||
if end: | ||
end = int(end) |
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.
@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.
is it now ok @Cadair ? |
should I rebase? |
This failure seems to be an online test issue. I will rekick travis for kicks. |
Ok thanks :) |
sunpy/spectra/spectrogram.py
Outdated
header for the image | ||
instruments : str array | ||
``instruments`` : `str array` |
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.
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` |
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.
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` |
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.
The ~ will be needed here. It hides certain parts when the documentation is built.
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.
Is it ok now?
sunpy/spectra/spectrogram.py
Outdated
if start: | ||
start = int(start) | ||
if end: | ||
end = int(end) |
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.
These need to be moved into lines 1249 and 1262. The whole if statement is not needed.
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.
Added ~ and removed backticks on right hand side in some cases.
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 statement shifted to block 1243
@nabobalis failing due to if block shifting? |
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. |
OK, I will send a new PR regarding this. |
Formatted some attributes under class Spectogram