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

Fix/enum representation types #184

Merged
merged 13 commits into from
Feb 16, 2024

Conversation

JackNWhite
Copy link
Contributor

@JackNWhite JackNWhite commented Dec 11, 2023

Originating Project/Creator Jack White
Affected Component EnumType, type_exceptions
Related Issue(s) #17
Has Unit Tests (y/n) n
Documentation Included (y/n) Comments

Change Description

  • Added the representation/serialization type to the type constructor (construct_type()) for EnumType
  • Added appropriate invalidation exceptions for checking the serialization type in the above
  • Added a Python module for F' basic-type range info

Rationale

Required to support GDS (de)serialisation of enums represented by other types than I32.

Accompanying PRs

Copy link
Collaborator

@LeStarch LeStarch 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! We should carry forward the following actions:

  1. Add "Endian" to spelling file
  2. Fix broken UTs and QL allerts
  3. Rub the formatter

Let me know if you need any assistance with, or wish to hand-off, any of these steps!

@JackNWhite
Copy link
Contributor Author

I fixed the spelling and the formatting. I also added a default argument rep_type="I32" for EnumType.construct_type(), which I think should fix the unit tests. I would understand if you want to add some new tests, but I would be grateful if someone who already understands the existing tests could add them.

@LeStarch
Copy link
Collaborator

It appears the tests are still failing. I will see if I can get it to work!

@LeStarch LeStarch closed this Dec 20, 2023
@LeStarch LeStarch reopened this Dec 20, 2023
@LeStarch
Copy link
Collaborator

@JackNWhite can you give maintainers allowances to update this PR? I have a fix for the UTs.

@JackNWhite
Copy link
Contributor Author

@LeStarch, I'm terribly sorry for not responding over Christmas - I was almost computer-free. I will try to make your update this afternoon, but I have also given the maintainer access as requested.

@LeStarch
Copy link
Collaborator

LeStarch commented Jan 4, 2024

I was almost computer-free.

I can respect that. I do hope you enjoyed your time away from the computer! No rush on the updates, but I will keep my hands-off while you make the changes. Let me know if/when I should jump back in!

@JackNWhite
Copy link
Contributor Author

JackNWhite commented Feb 15, 2024

@LeStarch, hi, is it possible to move this forward? I saw that @thomas-bc has opened a request for a release merge on fprime itself. If possible, I would like to get this into the wider package, because it has been open for some time.

The related GDS PR is still open, but my understanding is that it was waiting on an alpha release of fprime-tools, which appears to be part of the fprime update.

@LeStarch
Copy link
Collaborator

@JackNWhite thanks for pinging me. We are in the process of releasing and did want to get this in.

I made a slight change to use the constant data out of the numerical_types classes instead of a second set of constant data to reduce redundancy. Tested it, works as expected. Thank you!

@LeStarch LeStarch merged commit 3efb736 into nasa:devel Feb 16, 2024
29 checks passed
@JackNWhite JackNWhite deleted the fix/enum_representation_types branch February 16, 2024 08:51
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.

None yet

3 participants