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

Remove automatically_register_units #85

Merged
merged 4 commits into from
Dec 25, 2024
Merged

Remove automatically_register_units #85

merged 4 commits into from
Dec 25, 2024

Conversation

chaoming0625
Copy link
Member

@chaoming0625 chaoming0625 commented Dec 25, 2024

This pull request includes several changes to the brainunit package, focusing on version updates, string representation improvements, unit registration, and testing enhancements. The most important changes are summarized below:

Version update:

  • Updated the version of the brainunit package from 0.0.3 to 0.0.4 in brainunit/__init__.py.

String representation improvements:

  • Enhanced the __repr__ and __str__ methods in brainunit/_base.py to handle cases where scale is 0, improving the readability of unit representations. [1] [2]

Unit registration:

  • Removed the line that automatically registers units in brainunit/_unit_common.py and dev/units_template.py to prevent unintended unit registrations. [1] [2]

Class instantiation:

  • Modified the with_data method in brainunit/sparse/_csr.py to use self.__class__ for creating new instances, ensuring compatibility with subclasses.

Testing enhancements:

  • Added a new test case test_matvec_non_unit in brainunit/sparse/_csr_test.py to verify the correctness of matrix-vector multiplication for non-unit data.

@chaoming0625 chaoming0625 merged commit 2364b21 into main Dec 25, 2024
24 checks passed
@chaoming0625 chaoming0625 deleted the update branch December 25, 2024 03:39
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.

1 participant