-
Notifications
You must be signed in to change notification settings - Fork 162
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
DAQmx code generator for error_codes.py and constants.py using scrapigen metadata #215
Conversation
…ate error_codes.py file
…p of enum_helpers and metadata
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went through constants.py. My general guidelines
- I'm fine breaking compatibility here, but lets be consistent moving forward.
- I prefer spelling out names, eg ONBOARD not ONBRD
- I prefer not repeating the name of the enum in the value. So ActiveLevel.ABOVE is better than ActiveLevel.ABOVE_LEVEL
- I don't think we can lead with numbers, eg 1_VALUE, so we try to spell out numbers. I think for consistency we should do that everywhere.
Before we hack on the generator / metadata, lets make sure @bkeryan and I agree with our guidelines.
EDIT: Oh, and these breaking changes are going to break many existing tests. We can't change them in this PR since we're building nidaqmx
out of source still, but we will need to update them at some point. Let's make sure we have that tracked in the Features/User Stories or something. I'll at least notice when we switch the pyproject.toml
to be from generated. I'll want to ensure all tests pass then.
There were no updates to |
I would be happy if we generated the same names as before, warts and all. I don't mind improving names that are bad, but there are so many differences and it's not as clear cut as with mangled attribute ids like Remember, the goal is to generate nidaqmx-python and nidaqmx.proto with the same metadata, so we don't need a ton of substitutions and special cases to map Python names to gRPC names. The goal isn't to fix all of the weird naming inconsistencies in nidaqmx-python (though that would be nice). |
I hadn't considered your second point about consistency between Python and gRPC. I think that is a really important observation. So I think my guidelines are now this in order of priority.
Not exactly black and white, but hopefully something like this can give some direction? |
Ok, that seems reasonable to me. |
…ers/vikram/generate-error-codes-py-file
30c27f4
to
53c3bf7
Compare
Please find the differences in generated
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The generated code changes look great, thanks for all the hard work there. Once Brad is happy with the generator changes, I'll be happy :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll merge once Brad gives his approval!
The newly added ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with suggestions.
@zhindes Brad has given his approval, can you please merge this PR? |
error_codes.py
andconstants.py
.mako
templates necessary for generatingerror_codes.py
andconstants.py
.error_codes.py
andconstants.py
replaces the files generated by native daqmx code generator (https://dev.azure.com/ni/DevCentral/_git/ni-central?path=/src/daqmx/api/nidaqmx_py/source/nidaqmx_codegen) which is currently residing in (https://github.com/ni/nidaqmx-python/tree/master/src/nidaqmx)