Rename DeviceInfo to DeviceMetadata - #132
Merged
Merged
Conversation
The deserialized device.yml root is now DeviceMetadata, agreeing with the name it already carries everywhere else: the reader, the serializer pair, every parameter in the generators, and the object each of the nine templates binds. The sibling RegisterInfo, BitMaskInfo, GroupMaskInfo, PayloadMemberInfo and PortPinInfo keep their names, following the shape reflection uses where the entry point carries no suffix and the elements within it do. Generated output is unchanged for every target. Closes harp-tech#128
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The deserialized
device.ymlroot is nowDeviceMetadata. That is the name the codebase already gives it everywhere else: the reader isReadDeviceMetadata, the round-trip pair isMetadataDeserializerandMetadataSerializer, every generator parameter isdeviceMetadata, and all nine T4 templates bind the object asDeviceMetadata. One concept now travels under one word.The sibling types keep their names.
RegisterInfo,BitMaskInfo,GroupMaskInfo,PayloadMemberInfoandPortPinInfoare unchanged, following the shape reflection uses, where the entry point isTypewith no suffix while the elements within it arePropertyInfo,FieldInfoandMethodInfo. The document root and the nodes inside it play different roles and read better under different names.Breaking change
DeviceInfois a public type, so anything naming it needs updating. The rename is whole-word and total: no member, overload or file name changes with it, and the YAML contract is untouched, since deserialization maps on property names rather than on the root type name.Notes for review
Generated output is unchanged for every target. No expected output file moves, which is the check that the rename stays inside the model and never reaches emitted code.
Nine templates now read
<#@ parameter name="DeviceMetadata" type="DeviceMetadata" #>, so the generated template property shares its type name. That is the "color color" case, which C# permits, and it compiles.GetMemberAnnotationinsrc/Python.csis deleted in passing. It forwarded toGetMemberNumpyTypeand was called from nowhere.Closes #128