I'm adding result data from an upstream workitem to a new workitem I have just created.
The Python reference - https://www.sidefx.com/docs/houdini/tops/pdg/WorkItem.html [www.sidefx.com] - tells me there's a function for this: addResultData(result, tag, checksum, own=True)
So I go ahead and write:
workitem.addResultData(resultData, resultData, resultData, own=False)
To my surprise, this produces a TypeError! It took me far too long going through the error result to finally figure out the issue - given that the resultData I'm feeding in, I'm passing directly from the resultData of a different workitem and is definitely the correct type.
Instead, it seems like the 4-argument version of the function is overloaded and does not actually support being specified with a keyword argument. The correct form is:
workitem.addResultData(resultData, resultData, resultData, False)
Is this a case of the Python reference being out of date, or is this just a peculiarity of the API? I've checked both 17.5.173 and 17.5.347 and the discrepancy exists in both.
On a similar note, I've noticed a few classes/functions that don't seem to be documented at all. For example, if you create a Python Partitioner node and switch to the Partition by Index example, it does this:
# Partition by Index for work_item in work_items: partition_holder.addItemToPartition(work_item, work_item.index)
But I can't find anywhere documentation for the PartitionHolder class, what exactly addItemToPartition is doing, and what other functions I could call on partition_holder, short of literally printing them out through Python and guessing what they do.