コード例 #1
0
    def test_validate_model(self):
        import libcellml
        from libcellml import Validator

        # void validateModel(const ModelPtr &model)
        v = Validator()
        v.validateModel(libcellml.Model())
コード例 #2
0
    def test_create_destroy(self):
        import libcellml
        from libcellml import Model

        x = Model()
        del x

        y = Model('bob')
        self.assertEqual('bob', y.name())

        z = libcellml.Model()
        del z
コード例 #3
0
def convert_to_cellml_model(in_model):
    out_model = libcellml.Model()

    if in_model is not None:
        out_model.setName(in_model.name)
        out_model.setId(in_model.cellml_id)

        for c in in_model.all_components.all():
            component = convert_to_cellml_component(c)
            out_model.addComponent(component)

        for cu in in_model.compoundunits.all():
            units = convert_to_cellml_compoundunit(cu)
            out_model.addUnits(units)

        # todo convert_to_cellml_connections
        # todo convert_to_cellml_encapsulation

    return out_model