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 lombscargle.py #828

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hamzaallen
Copy link

Define two functions that calculate the rms and rms error of the spectrum over a specific range of frequencies.

Relevant Issue(s)/PR(s)

Provide an overview of the implemented solution or the fix and elaborate on the modifications.

Is there a new dependency introduced by your contribution? If so, please specify.

Any other comments?

Define two functions that calculate the rms and rms error of the spectrum over a specific range of frequencies.
@pep8speaks
Copy link

Hello @hamzaallen! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 390:1: W293 blank line contains whitespace
Line 394:1: W293 blank line contains whitespace
Line 395:1: W293 blank line contains whitespace
Line 396:1: W293 blank line contains whitespace
Line 397:5: E303 too many blank lines (4)
Line 400:1: W293 blank line contains whitespace
Line 401:9: E303 too many blank lines (3)
Line 430:1: W293 blank line contains whitespace
Line 431:1: W293 blank line contains whitespace
Line 432:5: E303 too many blank lines (2)
Line 470:1: W293 blank line contains whitespace

Copy link
Member

@matteobachetti matteobachetti left a comment

Choose a reason for hiding this comment

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

Thanks @hamzaallen! A very useful addition to Stingray!

To verify that the code works, it would be good to have one or more tests added to test_lombscargle.py.
In test_powerspectrum.py we have a few tests for the equivalent function in Powerspectrum and AveragedPowerspectrum, you can use those as templates.

Also, compute_rms does not have a docstring and we require all user-facing methods to be properly documented




def compute_rms(self, min_freq, max_freq, poisson_noise_level=None):

Copy link
Member

Choose a reason for hiding this comment

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

Please add a docstring to the function

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