-
Notifications
You must be signed in to change notification settings - Fork 7
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
Ins compatibility #121
Merged
Merged
Ins compatibility #121
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…d from uvdata has match_events attribute
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #121 +/- ##
===========================================
- Coverage 100.00% 99.66% -0.34%
===========================================
Files 8 8
Lines 881 908 +27
===========================================
+ Hits 881 905 +24
- Misses 0 3 +3
☔ View full report in Codecov by Sentry. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes a critical issue, which is that the
UVFlag
class frompyuvdata
has shifted enough that the child class,INS
is no longer compatible. In particular, theUVFlag
constructor call signature has 0 positional arguments, which is a major change compared to whenINS
was originally defined. This results in a complete inability to read objects, sinceUVFlag.read
callsUVFlag.init()
with an empty signature before reading. This basic functionality is restored, along with a significant but minor refactor.Description
The
INS
constructor had to be completely refactored. In particular, I have allowed for an empty call signature. What this does is preserves someINS
-specific attributes and then calls theUVFlag
constructor using the arguments that are passed. If the call signature is empty, this will empty the object except for theINS
-specific attributes that are required to properly calculate e.g. themetric_ms
attribute. This happens wheneverUVFlag.read
is called, in which case there is no way to preserve these attributes if read is called from a previously instantiated object. For this reason,SSINS
raise aNotImplementedError
if the user tries to callINS.read
from an object that is already full constructed.To handle a non-empty call signature, we overrode
read
andfrom_uvdata
. These basically start with some checks to establish whether these are safe calls by the user, call theUVFlag
method, and then do theINS
extras, preservingINS
-specific attributes where necessary. We made a few ("private") helper methods to make this type of thing a bit more modular.We also refactored the
SS
class a bit, mostly to keep up with some new required attributes inUVData
objects. Since it was related to I/O, I decided to include it in this PR even though it's a little out of scope technically.This all is API-preserving, although a particular version of
pyuvdata
will be required if reading files that were written without telescope names (mostly very old files).Checklist:
Main Code Body Checklist:
Scripts Checklist: