Skip to content

Conversation

@Teque5
Copy link
Collaborator

@Teque5 Teque5 commented Dec 16, 2025

  • 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 related tests
  • Add documentation
  • Add deprecation warning to get_num_channels

Similar to #115 but does more. Closes #102.

* 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
@Teque5 Teque5 requested a review from 777arc December 16, 2025 00:49
@Teque5 Teque5 self-assigned this Dec 16, 2025
@Teque5 Teque5 added the enhancement New feature or request label Dec 16, 2025
@Teque5 Teque5 changed the title Feature/attributes Feature: Properties for global fields Dec 16, 2025
@Teque5 Teque5 requested a review from gmabey December 16, 2025 17:03
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. "
Copy link
Contributor

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+

Copy link
Collaborator Author

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.

Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Useful Properties, Deprecate getters

3 participants