mulch-environment / mulch

mulch environment for structural biology
0 stars 0 forks source link

Collection::getCountPids returns unusual values #14

Closed helenginn closed 1 year ago

helenginn commented 1 year ago
    mulch::Collection *c = mulch::Collection::createCollection();

    c->addModel(Atomic, "3dpw.pdb");
    c->addModel(Atomic, "3dpz.pdb");

    c->persist();
    int id = c->getPrimaryId();

    std::cout << "ID to save: " << id << std::endl;

From this I can get a primary ID (e.g. 1) where I have inserted two Models.

Next, on a separate run (fresh memory allocation):

    int id = 1;
    std::cout << "Fetching information for ID: " << id << std::endl;

    mulch::Collection *c = mulch::Collection::collectionByPrimaryId(id);

    int num = c->getCountPids();
    std::cout << "Total ModelDataPairs: " << num << std::endl;

This gives me the output:

Fetching information for ID: 2
Database has 26 number of tables.
collection_id
SELECT * FROM Collection WHERE collection_id = 2;
collection_id
Database has 26 number of tables.
Total ModelDataPairs: 6

I'm not sure what is being counted but it's not the number I am expecting. It goes up whenever I add another Collection as in the first code block.

virginia4 commented 1 year ago

Waiting on feedback to close the issue.

helenginn commented 1 year ago

This appears to work well for me now, perfect!