vivarium-collective / bigraph-schema

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

types access raises exception if type_key not found #45

Closed eagmon closed 9 months ago

prismofeverything commented 9 months ago

On further reflection I realized that access(schema) is for more than just a type key - it works for nested schemas and parsed type expressions, which we have no other way to discover than access(schema). Here I propose retrieve(schema) which is the alternative to access(schema), which does enforce the schema being present. We should use retrieve(schema) everywhere we want that behavior, and leave access to simply return None if nothing is found.