-
Notifications
You must be signed in to change notification settings - Fork 11
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
ENH: include type alias source pragmas in db generation #311
Conversation
Sorry, this definitely broke "something"- I should have slowed down before submitting. My new test passes but I forgot to check the rest of the long test suite. |
More detail: something I'm doing has managed to create unexpected bonus records. I'll dive deeper into it soon since this PR is definitely needed prior to deploying the ND motion thing.
|
What are the new records it finds? |
Seems like a bug - though I'm curious what our IOC databases will look like after this PR. Any change? |
Note that this test makes 3 new records only when allow_no_pragma=True, not for the normal case. Personally, my database didn't have any weird bonus records other than reinstating the PVs for DUT_MotionStage, etc. Two tests I want to run:
|
I did test 1 for all of the production beamline plcs that I could quickly remember, provided pytmc master branch ran without errors. This excludes lfe and kfe vac which do not build iocs right now- I will make an issue and investigate separately. For all the others, this did not change their record generation at all. (Note: no production plc is running the unreleased motion lib that turns DUT_MotionStage into an alias.) You can snoop on my results at |
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.
Based on the additional info, this seems good to me 👍
Test 2 had more mixed results. I created an AMSNETID instance in lcls-plc-example-motion and added a pragma (pcdshub/lcls-plc-example-motion@7638617) Building with pytmc master did not add any PVs pointing to this, which makes sense given what we see in the test suite.
My intuition based on the traceback is that the type alias handling I added for DUT_MotionStage actually needs to be done automatically by inspecting the BaseType flag to truly finish the work here. Maybe that belongs in a separate PR though. |
I think the "correct" behavior would be:
The bug here is that types aliased from basic types that were previously ignored by pytmc will now make errors instead, which is almost certainly a bug but doesn't seem fatal. |
I think in this specific case making So to that end I'm not sure we want "use the base type" behavior in general... My current feeling is that it's worth going with what you have for starters and revisiting. |
You're absolutely right, in this specific case the byte array would be unwieldy. |
I think what I want to do is:
|
Without this PR, type aliases don't "see" the pragmas from their type source.
This means the database is generated with large numbers of missing records if we keep using the old names (DUT_MotionStage, DUT_PositionState)
Database generation diff: pcdshub/lcls-plc-example-motion@6bbae6b