Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pydantic error #434

Closed
shoepfl opened this issue Aug 1, 2023 · 4 comments
Closed

pydantic error #434

shoepfl opened this issue Aug 1, 2023 · 4 comments

Comments

@shoepfl
Copy link

shoepfl commented Aug 1, 2023

Hi Matthias,

currently I get a pydantic error, when using sbmlutils 0.8.4:

UserWarning: Field "model_units" has conflict with protected namespace "model_".

You may be able to resolve this warning by setting model_config['protected_namespaces'] = ().
warnings.warn(
/home/basti/miniconda3/envs/sbmlutils/lib/python3.11/site-packages/pydantic/_internal/fields.py:127: UserWarning: Field "model_definitions" has conflict with protected namespace "model".

You may be able to resolve this warning by setting model_config['protected_namespaces'] = ().
warnings.warn(
───────────────────────────────────────────────────────────────────────────────────── Create SBML ──────────────────────────────────────────────────────────────────────────────────────
Traceback (most recent call last):
File "/mnt/c/Users/basti/Documents/Uni/11_Doktorarbeit/Python/BayModTS/test.py", line 74, in
results = create_model(
^^^^^^^^^^^^^
File "/home/basti/miniconda3/envs/sbmlutils/lib/python3.11/site-packages/sbmlutils/factory.py", line 3619, in create_model
m = Model.merge_models(model)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/basti/miniconda3/envs/sbmlutils/lib/python3.11/site-packages/sbmlutils/factory.py", line 3445, in merge_models
kind = m2._keys.get(key, None)
^^^^^^^^
File "/home/basti/miniconda3/envs/sbmlutils/lib/python3.11/site-packages/pydantic/main.py", line 711, in getattr
return self.pydantic_private[item] # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/basti/miniconda3/envs/sbmlutils/lib/python3.11/site-packages/pydantic/main.py", line 715, in getattr
pydantic_extra = object.getattribute(self, 'pydantic_extra')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Model' object has no attribute 'pydantic_extra'. Did you mean: 'pydantic_complete'?

The error occours now in the file I already sent you for the RTD function:
test.py.txt

for me this seems to be a problem with my dependencies - can you help me here?

Thanks, Sebastian

@matthiaskoenig
Copy link
Owner

Hi @shoepfl,
this is most likely due to the latest pydantic release. Downgrading pydantic to <2.0 should fix this.
I will provide a bugfix asap.
Best Matthias

@shoepfl
Copy link
Author

shoepfl commented Aug 2, 2023

Thanks @matthiaskoenig,

i succeeded with pydantic 1.10.2

Best,
Sebastian

@harveymannering
Copy link

We also had this issue, which was causing tests to fail. We fixed this by downgrading pydantic to <2.0.

@matthiaskoenig
Copy link
Owner

This is fixed in the latest version 0.8.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants