From 3fbddfced35fe3f22066571d6a70c3445a90d61f Mon Sep 17 00:00:00 2001
From: Xavier Robin <xavalias-github@xavier.robin.name>
Date: Mon, 24 Jul 2023 18:07:51 +0200
Subject: [PATCH] fix: InChI code includes the InChI= part

---
 modules/conop/doc/compoundlib.rst     | 6 +++---
 modules/io/src/mol/chemdict_parser.cc | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/conop/doc/compoundlib.rst b/modules/conop/doc/compoundlib.rst
index 018946c42..d211f631e 100644
--- a/modules/conop/doc/compoundlib.rst
+++ b/modules/conop/doc/compoundlib.rst
@@ -156,14 +156,14 @@ build the compound library manually.
     
   .. attribute:: inchi
   
-    The InChI code of this compound, without the 'InChI=' part, e.g 
-    '1S/H2O/h1H2' for water. Read-only.
+    The InChI code of this compound, e.g  '1S/H2O/h1H2' for water.
+    Read-only.
     
     :type: :class:`str`
     
   .. attribute:: inchi_key
   
-    The InChIKey of this compound without the 'InChIKey=' part, e.g.
+    The InChIKey of this compound, e.g.
     'XLYOFNOQVPJJNP-UHFFFAOYSA-N' for water. Read-only.
     
     :type: :class:`str`
diff --git a/modules/io/src/mol/chemdict_parser.cc b/modules/io/src/mol/chemdict_parser.cc
index 5e138f03d..5bdd156ed 100644
--- a/modules/io/src/mol/chemdict_parser.cc
+++ b/modules/io/src/mol/chemdict_parser.cc
@@ -85,7 +85,7 @@ void ChemdictParser::OnDataRow(const StarLoopDesc& header,
                      "'InChI=' prefix." << std::endl;
         return;
       }
-      compound_->SetInchi(columns[indices_[DESC]].substr(6).str());
+      compound_->SetInchi(columns[indices_[DESC]].str());
     } else if (columns[indices_[DESC_TYPE]] == StringRef("InChIKey", 8)) {
       compound_->SetInchiKey(columns[indices_[DESC]].str());
     } else if (columns[indices_[DESC_TYPE]] == StringRef("SMILES_CANONICAL", 16) &&
-- 
GitLab