Open MarcSkovMadsen opened 2 years ago
Do you mean converting between Pydantic(BasePane) and Param(BasePane) in panel or are you talking about converting the actual BaseModel classes to param.Parameterized classes like you do in your POC?
The latter. Like I do in my POC.
I dont see how one would benefit from that. My first attempt was designed this way but I quickly realized that I am not gaining anything from the conversion. I have all the code for such games, similar to what you did with some extra syncing and validation tricks but in the end it felt very unnatural and unnecessarily complex.
pydantic is very class-oriented, where param is very instance oriented. I dont think their features really map on to each other.
Currently the scope is Panel and the
Pydantic
pane. That might be all that is needed.Theoretically though, I believe the "right" thing to do would be to implement conversions from Pydantic to Param models and back. That would enable Param/ HoloViz users to tap broader into the Pydantic ecosystem and Pydantic users to tap more into the wider HoloViz ecosystem. But it is a larger task and might also be harder to document and support.
A proof of concept can be found here https://github.com/MarcSkovMadsen/paithon/pull/1
I believe the current api could be extended to support the wider scope some day when and if. But the
pydantic-panel
name would maybe not be the right name?