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

reading for nothing #1262

Closed
HeJunhong1107 opened this issue Oct 22, 2024 · 6 comments
Closed

reading for nothing #1262

HeJunhong1107 opened this issue Oct 22, 2024 · 6 comments

Comments

@HeJunhong1107
Copy link

I have finished the tourial in User document, and sucessful reading tutorial1.cellml by python。

But when I try to read the any cellml models,which were downloaded on https://models.physiomeproject.org, the loaded model was empty. for example:Weinstein_2000_AE1.zip

image

Could you please help me with the weird phenomenon?

@nickerso
Copy link
Contributor

most of the CellML models in the repository are going to be CellML 1.0 or 1.1 - you will need to parse them in "non strict" mode for libCellML to be able to load them. For example, in Python, use parser = Parser(false). If you inspect the errors and warnings logged by the parser in your example, you'd find that it likely failed due to the input model not being CellML 2.0. In non strict mode, the parser will try its best to import CellML 1.x models.

@hsorby
Copy link
Contributor

hsorby commented Oct 22, 2024

The models on PMR are typically version 1.0 CellML models or version 1.1 CellML models. LibCellML deals with version 2.0 CellML models.

To work with version 1.0 or version 1.1 models the parser needs to be in permissive mode, this is done by setting the parser to not be strict when parsing models.

parser->setStrict(False)

If you end up needing to read a model with imports the importer also needs to be in permissive mode.

@hsorby
Copy link
Contributor

hsorby commented Oct 22, 2024

Damn it someone was already answering.

@HeJunhong1107
Copy link
Author

@hsorby
: ) , Thanks a lot for your kind reply!

@HeJunhong1107
Copy link
Author

@nickerso
I got it, thanks a lot~

@nickerso
Copy link
Contributor

thanks @HeJunhong1107 - I'll close this issue now but feel free to re-open if needed. I've also added #1265 to help us remember to surface some documentation that will guide libCellML users in using CellML 1.x models.

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