maxfordham/ipyautoui

instantiate only `AutoUi` with `schema`

Closed this issue · 2 comments

currently everything must be instantiated with schema which doesn't make much sense...
e.g.

  • AutoArray must be an array:
  • EditGrid must be an array
  • AutoObject must be an object
    .. etc. so they should be instantiated with what makes sense for the them -
    ie..
  • AutoArray- items
  • EditGrid - items
  • AutoObject - properties

AutoUi is the top level - in doesn't care what it generates, so this should still be instantiated with schema.
probably makes sense to add a .from_schema method to the other objects to ease transition...

instead of instantiating with schema use AutoArray (**kwargs) and ensure that the class has the correct traits
i.e.

  • AutoObject requires properties trait
  • AutoArray requires items trait

merged to main in this PR #199