RascalSoftware / python-RAT

Python interface for RAT
1 stars 5 forks source link

`Project.model_dump()` produces a big warning #90

Open alexhroom opened 2 weeks ago

alexhroom commented 2 weeks ago
from RATapi import Project
p = Project()
p.model_dump()

produces the UserWarning

/home/rec93639/Code/RasCAL-2/.venv/lib/python3.12/site-packages/pydantic/main.py:390: UserWarning: Pydantic serializer warnings:
  Expected `list[definition-ref]` but got `ClassList` with value `[ProtectedParameter(name=...rm', mu=0.0, sigma=inf)]` - serialized value may not be as expected
  Expected `list[definition-ref]` but got `ClassList` with value `[Parameter(name='SLD Air'...rm', mu=0.0, sigma=inf)]` - serialized value may not be as expected
  Expected `list[definition-ref]` but got `ClassList` with value `[Parameter(name='SLD D2O'...rm', mu=0.0, sigma=inf)]` - serialized value may not be as expected
  Expected `list[definition-ref]` but got `ClassList` with value `[Parameter(name='Scalefac...rm', mu=0.0, sigma=inf)]` - serialized value may not be as expected
  Expected `list[definition-ref]` but got `ClassList` with value `[]` - serialized value may not be as expected
  Expected `list[definition-ref]` but got `ClassList` with value `[Parameter(name='Backgrou...rm', mu=0.0, sigma=inf)]` - serialized value may not be as expected
  Expected `list[Background]` but got `ClassList` with value `[Background(name='Backgro...value_4='', value_5='')]` - serialized value may not be as expected
  Expected `list[definition-ref]` but got `ClassList` with value `[Parameter(name='Resoluti...rm', mu=0.0, sigma=inf)]` - serialized value may not be as expected
  Expected `list[Resolution]` but got `ClassList` with value `[Resolution(name='Resolut...value_4='', value_5='')]` - serialized value may not be as expected
  Expected `list[CustomFile]` but got `ClassList` with value `[]` - serialized value may not be as expected
  Expected `list[Data]` but got `ClassList` with value `[Data(name='Simulation', ...ion_range=[0.005, 0.7])]` - serialized value may not be as expected
  PydanticSerializationUnexpectedValue: Expected `list[Layer]` but got `ClassList` with value `[]` - serialized value may not be as expected
  PydanticSerializationUnexpectedValue: Expected `list[AbsorptionLayer]` but got `ClassList` with value `[]` - serialized value may not be as expected
  Expected `list[DomainContrast]` but got `ClassList` with value `[]` - serialized value may not be as expected
  PydanticSerializationUnexpectedValue: Expected `list[Contrast]` but got `ClassList` with value `[]` - serialized value may not be as expected
  PydanticSerializationUnexpectedValue: Expected `list[ContrastWithRatio]` but got `ClassList` with value `[]` - serialized value may not be as expected
  return self.__pydantic_serializer__.to_python(

Investigate this and hopefully solve it.