Open HeJunhong1107 opened 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.
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.
Damn it someone was already answering.
@hsorby : ) , Thanks a lot for your kind reply!
@nickerso I got it, thanks a lot~
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
Could you please help me with the weird phenomenon?