-
Notifications
You must be signed in to change notification settings - Fork 24
Feature: Properties for global fields #116
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
base: main
Are you sure you want to change the base?
Conversation
| return self.get_global_field(self.NUM_CHANNELS_KEY, 1) | ||
| """Return integer number of channels.""" | ||
| warnings.warn( | ||
| "get_num_channels() is deprecated and will be removed in a future version of sigmf. " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be worth informing the user what version the feature will removed, such as sigmf-python v2.0+
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about this, but we have neither a timeline nor a reason beside cleanliness to remove for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough - also with regards to using __getattr__ and __setattr__ it involves less code writing, but I'd still argue that the @property approach is more readable, faster and better for long-term code maintainability. But that may just be my preferred style.
* created new get/set dynamic interface for global fields * fixed bug where (data_doi, meta_doi) was incorrectly (data-doi, meta_doi) * increment API version * Thanks to @gregparkes for base implementation * add documentation * add tests
7df3ae0 to
885dee5
Compare
get_num_channelsSimilar to #115 but does more. Closes #102.
edit: rebased to
main