I found a similar solution in the meantime by manually adding an annotation using nd.Annotation and a formatted string, however your solution seems more robust and elegant.
I have one more question though, how would you pass down arguments that are not present in the blackbox (“hidden” from the user but necessary on my side), but needed in the pcell ? In the following example, I would like to pass down the “width_output” argument without the user having to interact with it :
def blackbox(width_wg, offset, radius):
# do things
def white_pcell(width_wg, offset, radius, width_output):
# do other things