vivarium-collective / bigraph-schema

compositional type schemas
Apache License 2.0
1 stars 1 forks source link

fixing fill_ports to get the expected results in bigraph-viz #49

Closed eagmon closed 7 months ago

eagmon commented 7 months ago

Running core.complete() on this was filling the projected chromosome and cytoplasm in the wrong location:

{ 'cell1': {
             'nucleus': { 'transcription': { '_type': 'process',
                                             'address': '',
                                             'config': {},
                                             'inputs': {'DNA': ['chromosome']},
                                             'interval': 0.0,
                                             'outputs': { 'RNA': [ '..',
                                                                   'cytoplasm']}}}},
}

This was the result:

{ 'cell1': { 'chromosome': {},
             'nucleus': { 'transcription': { '_type': 'process',
                                             'address': '',
                                             'config': {},
                                             'inputs': {'DNA': ['chromosome']},
                                             'interval': 0.0,
                                             'outputs': { 'RNA': [ '..',
                                                                   'cytoplasm']}}}},
  'cytoplasm': {}}

by adjusting these two lines in fill_ports, we now get the correct results:

{ 'cell1': {
             'cytoplasm': {},
             'nucleus': {  'chromosome': {},
                                  'transcription': { '_type': 'process',
                                             'address': '',
                                             'config': {},
                                             'inputs': {'DNA': ['chromosome']},
                                             'interval': 0.0,
                                             'outputs': { 'RNA': [ '..',
                                                                   'cytoplasm']}}}},
}