|
From: | George Edwards |
Subject: | Re: Problem writing OOT yml file for variable number of inputs |
Date: | Tue, 9 Feb 2021 07:48:53 -0600 |
Glad it worked.On Tue, Feb 9, 2021 at 8:28 AM George Edwards <gedwards.eng@gmail.com> wrote:Hi Jeff,Thanks again! The link you sent had the solution. The thing is, I have looked at the link time and time again even before you sent it to me and the problem lies in reading between the lines because the documentation is not very clear. It would be nice if there were examples given inside the link. I knew from experience that doing multiplicity: '4' works, if I desired 4 inputs for example, but this was static and I wanted it to be flexible, so one could set that value inside the GRC block. From the documentation: multiplicity: ${ .... }, I thought ${...} was just a placeholder for me to replace it with the number I wanted ('4' in example above). Now, I understand how to use ${ .... } to pass in parameter values. I used multiplicity: ${n_inputs} and it worked beautifully!Thanks again for the help!Regards,GeorgeOn Mon, Feb 8, 2021 at 7:19 PM Jeff Long <willcode4@gmail.com> wrote:Also, take a look at yml files for existing blocks that have a variable number of inputs. For example, the Add block.On Mon, Feb 8, 2021 at 8:09 PM George Edwards <gedwards.eng@gmail.com> wrote:Hello,I have a problem writing the yml file for a variable number of inputs to my GRC block. In the OOT Python file, a parameter called n_input is passed into the GRC block and I was hoping it would be accessible in the yml file. In the yml file I wrote:parameters:- id: n_inputslabel: Number of Inputsdtype: intdefault: 3inputs:- domain: streamdtype: complexmultiplicity: n_inputsThe program fails with message: invalid literal for int() with base 10. Then, I tried multiplicity with: int(n_inputs) and 'n_input' which all failed. How can I fix this, because if I were to specify a static value for example: multiplicity: '5', it works and provides a block with 5 inputs.I will appreciate any help offered!Thank you!George
[Prev in Thread] | Current Thread | [Next in Thread] |