cellml / libcellml

Repository for libCellML development.
https://libcellml.org
Apache License 2.0
17 stars 21 forks source link

reading for nothing #1262

Open HeJunhong1107 opened 2 hours ago

HeJunhong1107 commented 2 hours ago

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 commented 2 hours ago

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 commented 2 hours ago

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 commented 2 hours ago

Damn it someone was already answering.

HeJunhong1107 commented 33 minutes ago

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

HeJunhong1107 commented 33 minutes ago

@nickerso I got it, thanks a lot~