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

Add unit tests and run them in the CI action #25

Merged
merged 18 commits into from
Nov 14, 2024
Merged

Conversation

cpozogonzalez
Copy link
Collaborator

1- Add unit test. Using tutorial data.
2- Implement CI to run the test in commit stage.
3- Config ruff to autorun in pre-commit stage.
4- Apply all of the ruff linter changes.

@cpozogonzalez cpozogonzalez self-assigned this Oct 10, 2024
@cpozogonzalez cpozogonzalez linked an issue Oct 10, 2024 that may be closed by this pull request
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@morcuended morcuended changed the title 17 add unit tests Add unit tests and run them in the CI action Oct 10, 2024
ptiming_ana/_version.py Show resolved Hide resolved
tutorial/Tutorial_notebook.ipynb Show resolved Hide resolved
.gitignore Show resolved Hide resolved
ptiming_ana/cphase/add_pulsarphase.py Show resolved Hide resolved
ptiming_ana/phaseogram/periodicity_test.py Show resolved Hide resolved
ptiming_ana/phaseogram/ptime_analysis.py Show resolved Hide resolved
ptiming_ana/phaseogram/ptime_analysis.py Show resolved Hide resolved
Comment on lines +196 to +201
if P1_limits == "None":
P1_limits = None
if P2_limits == "None":
P2_limits = None
if P3_limits == "None":
P3_limits = None
Copy link
Member

Choose a reason for hiding this comment

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

For another PR, we should improve this None, "None" comparison. Right now it keeps the code as it was after the ruff formating.

ptiming_ana/phaseogram/pulsar_analysis.py Show resolved Hide resolved
tests/test_tutorial.py Show resolved Hide resolved
@morcuended
Copy link
Member

Thanks @cpozogonzalez for the implementation and changes. They look good overall. Just have a concern about the usage of unittest instead of pytest and some small comments and checks for you to perform.

Co-authored-by: Daniel Morcuende <[email protected]>
Copy link
Collaborator Author

@cpozogonzalez cpozogonzalez left a comment

Choose a reason for hiding this comment

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

All the changes proposed by @morcuended have been fixed. I will be create a new issue to review the exceptions and decide which is the error to catch.

.gitignore Show resolved Hide resolved
ptiming_ana/cphase/add_pulsarphase.py Show resolved Hide resolved
ptiming_ana/phaseogram/periodicity_test.py Show resolved Hide resolved
tests/test_tutorial.py Show resolved Hide resolved
tutorial/Tutorial_notebook.ipynb Show resolved Hide resolved
ptiming_ana/_version.py Show resolved Hide resolved
Copy link
Member

@morcuended morcuended left a comment

Choose a reason for hiding this comment

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

Thanks for the clarifications @cpozogonzalez. Looks good to me.

@morcuended morcuended merged commit 424d012 into main Nov 14, 2024
1 check passed
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.

Add unit tests
2 participants