Skip to content
Snippets Groups Projects
Verified Commit 131d149a authored by Xavier Robin's avatar Xavier Robin
Browse files

feat: report possible compatibiltiy issues

parent 812e856c
Branches
Tags
No related merge requests found
...@@ -397,7 +397,6 @@ CompoundLibPtr CompoundLib::Load(const String& database, bool readonly) ...@@ -397,7 +397,6 @@ CompoundLibPtr CompoundLib::Load(const String& database, bool readonly)
} }
String aq; String aq;
sqlite3_stmt* stmt; sqlite3_stmt* stmt;
std::stringstream ss;
// check if SMILES are available // check if SMILES are available
aq="SELECT smiles FROM chem_compounds LIMIT 1"; aq="SELECT smiles FROM chem_compounds LIMIT 1";
retval=sqlite3_prepare_v2(lib->db_->ptr, aq.c_str(), retval=sqlite3_prepare_v2(lib->db_->ptr, aq.c_str(),
...@@ -417,12 +416,24 @@ CompoundLibPtr CompoundLib::Load(const String& database, bool readonly) ...@@ -417,12 +416,24 @@ CompoundLibPtr CompoundLib::Load(const String& database, bool readonly)
lib->creation_date_ = lib->GetCreationDate(); lib->creation_date_ = lib->GetCreationDate();
lib->ost_version_used_ = lib->GetOSTVersionUsed(); lib->ost_version_used_ = lib->GetOSTVersionUsed();
// Report compatibility issues
if (lib->ost_version_used_.compare(COMPAT_VERSION) < 0) { if (lib->ost_version_used_.compare(COMPAT_VERSION) < 0) {
std::stringstream ss;
ss << "Compound lib was created with an unsupported version of OST: " ss << "Compound lib was created with an unsupported version of OST: "
<< lib->ost_version_used_ << lib->ost_version_used_
<< ". Please update your compound library."; << ". Please update your compound library.";
throw ost::Error(ss.str()); throw ost::Error(ss.str());
} }
if (!lib->smiles_available_) {
LOG_WARNING("SMILES not available in compound library v."
<< lib->ost_version_used_
<< ". Only empty strings will be returned.");
}
if (!lib->charges_available_) {
LOG_WARNING("Charges not available in compound library v."
<< lib->ost_version_used_
<< ". All charges will be 0.");
}
return lib; return lib;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment