Skip to content

Fix: use duck-typing in Pulsar() to determine whether we have a libstempo or PINT object#425

Merged
vhaasteren merged 6 commits into
nanograv:devfrom
vhaasteren:ducktypepulsar
Mar 20, 2026
Merged

Fix: use duck-typing in Pulsar() to determine whether we have a libstempo or PINT object#425
vhaasteren merged 6 commits into
nanograv:devfrom
vhaasteren:ducktypepulsar

Conversation

@vhaasteren

Copy link
Copy Markdown
Member

When packages write tests in their test suite, sometimes Mock objects are used instead of libstempo/PINT pulsars. Or perhaps there are other reasons to not pass a libstempo/PINT object. Then Enterprise could still make a PintPulsar or a Tempo2Pulsar object if we were to use duck-typing. See #424

This PR updates it. No functionality is changed. Just a change from 'isinstance' to a duck-typing indicator function

@vhaasteren vhaasteren self-assigned this Oct 21, 2025
@vhaasteren vhaasteren changed the base branch from master to dev October 21, 2025 12:10
@vhaasteren vhaasteren marked this pull request as draft October 21, 2025 12:10
@codecov

codecov Bot commented Oct 21, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 63.63636% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.59%. Comparing base (be58281) to head (742ee45).
⚠️ Report is 10 commits behind head on dev.

Files with missing lines Patch % Lines
enterprise/pulsar.py 63.63% 4 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #425      +/-   ##
==========================================
+ Coverage   72.52%   72.59%   +0.07%     
==========================================
  Files          13       13              
  Lines        3472     3478       +6     
==========================================
+ Hits         2518     2525       +7     
+ Misses        954      953       -1     
Files with missing lines Coverage Δ
enterprise/pulsar.py 29.80% <63.63%> (+1.03%) ⬆️

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2aa3af1...742ee45. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vhaasteren vhaasteren marked this pull request as ready for review October 21, 2025 15:31
@vhaasteren vhaasteren linked an issue Oct 21, 2025 that may be closed by this pull request
@vhaasteren vhaasteren merged commit 480afd6 into nanograv:dev Mar 20, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No duck-typing to determine pulsar object

1 participant