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

Made conversion on enum fields to List[str] optional #58

Conversation

evalott100
Copy link
Contributor

@evalott100 evalott100 commented Oct 10, 2023

By default pandablocks-ioc will refer to enum values by their integer indices, with values being stored in a numpy.uint8.

Because of this, we make conversion to a List[str] of enum values optional in pandablocks client.

@codecov
Copy link

codecov bot commented Oct 10, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (3e086c9) 96.32% compared to head (659a25f) 96.32%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #58   +/-   ##
=======================================
  Coverage   96.32%   96.32%           
=======================================
  Files          12       12           
  Lines        1170     1170           
=======================================
  Hits         1127     1127           
  Misses         43       43           
Files Coverage Δ
pandablocks/utils.py 100.00% <100.00%> (ø)

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

Copy link
Contributor

@AlexanderWells-diamond AlexanderWells-diamond left a comment

Choose a reason for hiding this comment

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

Comments are mostly a few questions I'd like answers to before merging this. We also need at least one test where convert_enum_indices is False.

pandablocks/utils.py Outdated Show resolved Hide resolved
pandablocks/utils.py Outdated Show resolved Hide resolved
pandablocks/utils.py Outdated Show resolved Hide resolved
pandablocks/utils.py Outdated Show resolved Hide resolved
Copy link
Contributor

@AlexanderWells-diamond AlexanderWells-diamond left a comment

Choose a reason for hiding this comment

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

Type hints in tests need updating

tests/test_utils.py Outdated Show resolved Hide resolved
@evalott100 evalott100 force-pushed the make_conversion_to_string_enums_optional branch from 167fa62 to 738af76 Compare October 10, 2023 13:11
Copy link
Contributor

@AlexanderWells-diamond AlexanderWells-diamond left a comment

Choose a reason for hiding this comment

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

Looks good to me!

pandablocks/utils.py Outdated Show resolved Hide resolved
@evalott100 evalott100 merged commit 4cc1e30 into PandABlocks:master Oct 11, 2023
6 checks passed
@evalott100 evalott100 deleted the make_conversion_to_string_enums_optional branch October 11, 2023 13:10
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.

2 participants