Skip to content

In batch search, spaces are converted to "%20" and yield no match #8

Description

@flo-schu

Minimal reproducible example:

import ctxpy
chem = ctxpy.Chemical()

batch search fails, with search value potassium%20bicarbonate

>>> chem.search(by="batch", query=["potassium bicarbonate"])

[{'dtxsid': None, 'dtxcid': None, 'casrn': None, 'smiles': None, 'preferredName': None, 'searchName': None, 'searchValue': 'potassium%20bicarbonate', 'rank': None, 'hasStructureImage': None, 'isMarkush': None, 'searchMsgs': [...], 'suggestions': [...], 'isDuplicate': False}]

exact search works

>>> chem.search(by="equals", query="potassium bicarbonate")

[{'hasStructureImage': 1, 'smiles': '[K+].OC([O-])=O', 'isMarkush': False, 'dtxsid': 'DTXSID0021177', 'dtxcid': 'DTXCID201177', 'casrn': '298-14-6', 'preferredName': 'Potassium bicarbonate', 'searchName': 'Approved Name', 'searchValue': 'Potassium bicarbonate', 'rank': 9}]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions