vivarium-collective / process-bigraph

Apache License 2.0
2 stars 1 forks source link

Support array type of unknown size? #66

Open prismofeverything opened 1 month ago

prismofeverything commented 1 month ago

Are lists sufficient here?

If arrays are different shapes in general they are not compatible - but there are use cases where the process could accept an array of any size or output an array of any size

prismofeverything commented 1 month ago

This could warrant a different type, vector which allows adjustable arrays.

Also, we could implement as config "references", ie:

class ArrayProcess(Process):
    config = {
        'shape': 'list[integer]',
        'array': 'array[float,{shape}]',
    }

def instantiate(config):
    composite = {
        '_type': 'process',
        'address': 'ArrayProcess',
        'config': {
            'shape': (3, 5, 2),
            'array': reference_to_some_array,
        },
    }