I think we might be able to simplify the process of pairing internal schema names to the formatted postera names by using aliases in pydantic. See the class here for example, to work out what the the postera name is for the variable szybki_global_strain we have to check the function here then we have to map the enum name here. Using an alias would allow this to all be defined in a single place like so
from pydantic import BaseModel, Field
class SzybkiFreeformResult(BaseModel):
"""
Class for storing the results of a Szybki Freeform conformer analysis run.
"""
ligand_id: str = Field(..., serialization_alias="ligand_id")
szybki_global_strain: float = Field(..., serialization_alias="ligand-global-strain-szybki-kcal-mol")
c = SzybkiFreeformResult(ligand_id="id_number1", szybki_global_strain="4")
print(c.model_dump(by_alias=True))
Yes please! This is a great idea. We will need to update the renaming methods in postera.manifold_data_validationto take a schema but I think this is a good change.
I think we might be able to simplify the process of pairing internal schema names to the formatted postera names by using aliases in pydantic. See the class here for example, to work out what the the postera name is for the variable
szybki_global_strain
we have to check the function here then we have to map the enum name here. Using an alias would allow this to all be defined in a single place like socc @hmacdope