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

Cleanup LogicArray interface #3792

Merged
merged 4 commits into from Apr 7, 2024
Merged

Conversation

ktbarrett
Copy link
Member

@ktbarrett ktbarrett commented Mar 19, 2024

Closes #3660. Closes #3418.

  • Deprecate LogicArray.integer, .signed_integer, and .binstr
  • Deprecate constructing LogicArray from ints.
  • Introduce LogicArray.from_unsigned, .from_signed, .to_signed, and .to_unsigned to replace what was deprecated.

If we need other kinds of construction/conversion, we can add them later.

  • Add newsfragment.

@ktbarrett ktbarrett force-pushed the logic-array-iface branch 4 times, most recently from a1c2f6a to a5b36c4 Compare March 20, 2024 05:21
@ktbarrett ktbarrett marked this pull request as ready for review March 20, 2024 05:21
Copy link

codecov bot commented Mar 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.61%. Comparing base (53a5f5e) to head (316b801).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3792      +/-   ##
==========================================
+ Coverage   73.54%   73.61%   +0.07%     
==========================================
  Files          49       49              
  Lines        7916     7941      +25     
  Branches     2195     2215      +20     
==========================================
+ Hits         5822     5846      +24     
- Misses       1581     1591      +10     
+ Partials      513      504       -9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

docs/source/newsfragments/3792.feature.rst Outdated Show resolved Hide resolved
docs/source/newsfragments/3792.removal.1.rst Outdated Show resolved Hide resolved
docs/source/newsfragments/3792.removal.2.rst Outdated Show resolved Hide resolved
docs/source/newsfragments/3792.removal.3.rst Outdated Show resolved Hide resolved
docs/source/writing_testbenches.rst Outdated Show resolved Hide resolved
src/cocotb/types/logic_array.py Outdated Show resolved Hide resolved
src/cocotb/types/logic_array.py Outdated Show resolved Hide resolved
src/cocotb/types/logic_array.py Outdated Show resolved Hide resolved
src/cocotb/types/logic_array.py Outdated Show resolved Hide resolved
src/cocotb/types/logic_array.py Outdated Show resolved Hide resolved
src/cocotb/types/logic_array.py Outdated Show resolved Hide resolved
src/cocotb/types/logic_array.py Outdated Show resolved Hide resolved
Copy link
Member

@imphil imphil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice improvement to the API, thanks for all the doc and test updates as well!

src/cocotb/types/logic_array.py Outdated Show resolved Hide resolved
src/cocotb/types/logic_array.py Outdated Show resolved Hide resolved
* Deprecate LogicArray.integer, .signed_integer, and .binstr
* Deprecate constructing LogicArray from ints.
* Introduce LogicArray.from_unsigned, from_signed, to_signed, and
  to_unsigned to replace what was deprecated.
@ktbarrett ktbarrett merged commit e7e4d43 into cocotb:master Apr 7, 2024
28 of 29 checks passed
@ktbarrett ktbarrett deleted the logic-array-iface branch April 7, 2024 18:20
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.

Deprecate and provide better name for LogicArray.integer LogicArray: Make type conversions more explicit
4 participants