Skip to content

get_cid(name = x) errors for x = "Ethylformate", but works for x = "Ethyl formate" #23

@thomvet

Description

@thomvet

I am wondering whether something like this is fixable for convenience reasons?

Reproducer:

using PubChemCrawler
ans1 = get_cid(name = "Ethyl formate")
ans2 = get_cid(name = "Ethylformate")

Stacktrace:

ERROR: ArgumentError: extra characters after whitespace in "104745\n1032"
Stacktrace:
 [1] tryparse_internal(::Type{Int64}, s::SubString{String}, startpos::Int64, endpos::Int64, base_::Int64, raise::Bool)
   @ Base .\parse.jl:178
 [2] parse(::Type{Int64}, s::SubString{String}; base::Nothing)
   @ Base .\parse.jl:254
 [3] parse(::Type{Int64}, s::SubString{String})
   @ Base .\parse.jl:253
 [4] get_cid(; name::String, smiles::Nothing, kwargs::@Kwargs{})
   @ PubChemCrawler C:\Users\thvt\.julia\packages\PubChemCrawler\3RakX\src\query.jl:16
 [5] top-level scope
   @ REPL[19]:1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions