Hi thanks Nathan for the suggestion. I wrote the python component with some arbitrary code as a placeholder to be substituted eventually. But I just want to clarify that an orange wire carrying no data will still cause a component (not just scripting components) it is connected to to expire solution and SolveInstance again?
I believe there will always be a solve instance, but it is up to the component to ensure no unnecessary calculations are performed. In general when something like this is set up you’ll find that downstream components all turn orange to show data is missing.
If you don’t want all the connected components down the line to thrown warnings, because they aren’t getting any data at relevant inputs, you could always define a default value that your component outputs when it has nothing else to compute.
if reset or 'ticks' not in globals():
ticks = 0 # default to zero
ticks += 1
a = ticks
Note how it’s not necessary to push a ticks value (e.g. 0) mapped to the key “ticks” into the globals() dictionary! This is because the latter is a global symbol table that is maintained by the compiler and keeps track of all information - including created variables - from the global scope.
You probably meant to put a = ticks in the if x block. Or not… don’t know. I suppose the default way for GH components is to not pass on any data when they haven’t received all the data they require for their computation.