Right now, when you specify the interface in a worker, the interface is rendered with the interface elements in alphabetical order. Sometimes, however, it would be good to organize the interface options in non-alphabetical order. Is there a good way to do that? One option I was thinking was to add an "_order" key that specifies the ordering. Like '_order': 1, etc. If some item is missing that key, then it shows at the end of the list in alphabetical order as before. Would that work?
def interface(image, apiUrl, token):
client = workers.UPennContrastWorkerPreviewClient(apiUrl=apiUrl, token=token)
# Available types: number, text, tags, layer
interface = {
'Channel': {
'type': 'channel'
},
'Radius': {
'type': 'number',
'min': 0.5,
'max': 10,
'default': 1,
},
}
# Send the interface object to the server
client.setWorkerImageInterface(image, interface)
Right now, when you specify the interface in a worker, the interface is rendered with the interface elements in alphabetical order. Sometimes, however, it would be good to organize the interface options in non-alphabetical order. Is there a good way to do that? One option I was thinking was to add an "_order" key that specifies the ordering. Like
'_order': 1
, etc. If some item is missing that key, then it shows at the end of the list in alphabetical order as before. Would that work?