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
Scans in Shared Python Scripts: Replace populate #5401
Comments
This is a hang over from VMS and not wanting to add quotes. I created global variables like this in Open GENIE for CSET and they were initialised when a user typed GETBLOCKS on the genie command line, they needed to type this for other reasons than just creating the variables. Whenever you modified blocks in SECI you were prompted to type "getblocks", if you changed config in SECI genie was killed so it would get reloaded too. In genie python we didn't implement the global variables, so you don't need to type get_blocks(), but must use quotes. Given removing populate() is a breaking change, we should make the case to the scientists - I think it is worth making that case though. |
@John-Holt-Tessella to change acceptance criteria to be implementation + tests |
Larmor, Inter and Polref instrument scineitst were happy to remove populate but wanted to keep a way of defining blocks without typing strings. (Some issues had been found with populate in the past) @FreddieAkeroyd has suggested that we create a "b." modules which lists all the blocks as member variables. This should be doable and may be useful for other beamline too. So I am changing the acceptance criteria for this ticket to include that and will get feedback from the IBEX team |
ISISNeutronMuon/InstrumentScripts#60
As a developer I would recommend getting rid of populate. It can cause really weird effects if a block is the same name as a module e.g. time
Instead replace with a module which has a class member variable for each active block. On most beam lines this is imported as
b.
.b.block_name
should return something that is interpreted as a string inscan(<motion>
andcset
andcget
. Ideally it should update itself when the blocknames change.Acceptance Criteria
b.
Notes
This is a breaking change so maybe we just shouldn't
Its purpose is to create variables which can be used instead of block names so that scan can be written: scan(block, ... instead of scan("block", .... But it comes with caveats that when the user changes config they must remember to rerun populate to get new blocks and it is different to the recommended way of running g.cset i.e. cset("block", value). However I do not know the history and so would like to understand its motivation.
interpreted as a string: could mean just a return a string but maybe there is a way of returning a more complicated object that will evaluate to a string but have more complicated properties like units etc. This might eventually allow us to do
b.blockname.scan(-0.5, 0.5, 1)
orb.blockname.cset(10)
or evenb.blockname = 10
.The text was updated successfully, but these errors were encountered: