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

Fix metadata iteration bug in FeatherPulsar class #414

Merged
merged 2 commits into from
Mar 18, 2025

Conversation

Wang-weiYu
Copy link

@Wang-weiYu Wang-weiYu commented Mar 18, 2025

This PR fixes a bug in metadata iteration in save_feather function of class FeatherPulsar.

The original code:

meta = {}
for attr in Pulsar.metadata:
    if hasattr(self, attr):
        meta[attr] = Pulsar.to_list(getattr(self, attr))
    else:
        print(f"Pulsar.save_feather: cannot find {attr} in Pulsar {self.name}.")

was changed to

meta = {}
for attr in FeatherPulsar.metadata:
    if hasattr(self, attr):
        meta[attr] = FeatherPulsar.to_list(getattr(self, attr))
    else:
        print(f"FeatherPulsar.save_feather: cannot find {attr} in Pulsar {self.name}.")

The message in read_feather function:

print(f"Pulsar.read_feather: cannot find {attr} in feather file {filename}.")

was also changed to

print(f"FeatherPulsar.read_feather: cannot find {attr} in feather file {filename}.")

@Wang-weiYu Wang-weiYu marked this pull request as draft March 18, 2025 16:34
@Wang-weiYu Wang-weiYu marked this pull request as ready for review March 18, 2025 16:37
Copy link

codecov bot commented Mar 18, 2025

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 71.55%. Comparing base (dfe99d1) to head (a62c100).
Report is 19 commits behind head on dev.

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

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #414      +/-   ##
==========================================
+ Coverage   71.52%   71.55%   +0.03%     
==========================================
  Files          13       13              
  Lines        3245     3245              
==========================================
+ Hits         2321     2322       +1     
+ Misses        924      923       -1     
Files with missing lines Coverage Δ
enterprise/pulsar.py 28.62% <0.00%> (ø)

Continue to review full report in Codecov by Sentry.

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

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

@vhaasteren
Copy link
Member

Code not covered was a pre-existing non-coverage from earlier. I'll approve and merge the PR, this was an obvious bug.

@vhaasteren vhaasteren changed the base branch from master to dev March 18, 2025 18:48
@vhaasteren vhaasteren merged commit 08a9e11 into nanograv:dev Mar 18, 2025
14 of 15 checks 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.

2 participants