Skip to content

ValueError: unknown enum label "NAME" #2

Description

@nhadler

Following the tutorial

>>> python surf2ord.py data/surf_template.txt data/surf_template.pbtxt --username "Alex Mueller" --email "alex.mueller@roche.com"  

This error occurs:

Transforming SURF to ORD... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━   0% -:--:--
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /Users/nhadler/Desktop/surf/surf2ord.py:112 in surf2ord                                          │
│                                                                                                  │
│   109 │   │   │   logger.error(f"Reaction ID missing! Can't process reaction {idx}")             │
│   110 │   │   │   continue                                                                       │
│   111 │   │   else:                                                                              │
│ ❱ 112 │   │   │   reaction.identifiers.add(type="NAME", value=row.rxn_id)                        │
│   113 │   │                                                                                      │
│   114 │   │   # add further identifiers                                                          │
│   115 │   │   rxn_name = [row[n] for n in row.keys() if n in ("rxn_name", "rxn_tech", "rxn_typ   │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │            delimiter = '\t'                                                                  │ │
│ │                   df = │   │   │     rxn_id                    source_id  source_type  ...   │ │
│ │                        product_1_yieldtype                                                   │ │
│ │                        provenance  procedure                                                 │ │
│ │                        0  lsf_lit_minisci_1            10.1021/jo9010624  publication  ...   │ │
│ │                        UNKNOWN  Alex T. Mueller alex.mueller@roche.com 0000-00...        NaN │ │
│ │                        1  lsf_lit_minisci_2            10.1021/jo9010624  publication  ...   │ │
│ │                        UNKNOWN  Alex T. Mueller alex.mueller@roche.com 0000-00...        NaN │ │
│ │                        2  lsf_lit_minisci_3            10.1021/jo9010624  publication  ...   │ │
│ │                        UNKNOWN  Alex T. Mueller alex.mueller@roche.com 0000-00...        NaN │ │
│ │                        3  lsf_lit_minisci_4  10.1021/acs.orglett.8b02988  publication  ...   │ │
│ │                        UNKNOWN  Alex T. Mueller alex.mueller@roche.com 0000-00...        NaN │ │
│ │                        4  lsf_lit_minisci_5  10.1021/acs.orglett.8b02988  publication  ...   │ │
│ │                        UNKNOWN  Alex T. Mueller alex.mueller@roche.com 0000-00...        NaN │ │
│ │                                                                                              │ │
│ │                        [5 rows x 39 columns]                                                 │ │
│ │                email = 'alex.mueller@roche.com'                                              │ │
│ │                  err = False                                                                 │ │
│ │                  idx = 0                                                                     │ │
│ │           input_file = 'data/surf_template.txt'                                              │ │
│ │              invalid = []                                                                    │ │
│ │                orcid = None                                                                  │ │
│ │         organization = None                                                                  │ │
│ │          output_file = 'data/surf_template.pbtxt'                                            │ │
│ │ overwrite_provenance = False                                                                 │ │
│ │             reaction = <class 'rich.pretty.Node'>.__repr__ returned empty string             │ │
│ │            reactions = []                                                                    │ │
│ │                  row = rxn_id                                                                │ │
│ │                        lsf_lit_minisci_1                                                     │ │
│ │                        source_id                                                             │ │
│ │                        10.1021/jo9010624                                                     │ │
│ │                        source_type                                                           │ │
│ │                        publication                                                           │ │
│ │                        rxn_type                                      alkylation minisci      │ │
│ │                        standard                                                              │ │
│ │                        temperature_deg_c                                                     │ │
│ │                        60                                                                    │ │
│ │                        time_h                                                                │ │
│ │                        0.5                                                                   │ │
│ │                        atmosphere                                                            │ │
│ │                        AIR                                                                   │ │
│ │                        stirring_shaking                                                      │ │
│ │                        UNSPECIFIED                                                           │ │
│ │                        scale_mol                                                             │ │
│ │                        0.0005                                                                │ │
│ │                        concentration_mol_l                                                   │ │
│ │                        0.1                                                                   │ │
│ │                        catalyst_1_cas                                                        │ │
│ │                        7782-63-0                                                             │ │
│ │                        catalyst_1_eq                                                         │ │
│ │                        0.6                                                                   │ │
│ │                        catalyst_1_smiles                                                     │ │
│ │                        [Fe].O=S(=O)(O)O.O                                                    │ │
│ │                        reagent_1_cas                                                         │ │
│ │                        7664-93-9                                                             │ │
│ │                        reagent_1_eq                                                          │ │
│ │                        3                                                                     │ │
│ │                        reagent_1_smiles                                                      │ │
│ │                        O=S(=O)(O)O                                                           │ │
│ │                        reagent_2_cas                                                         │ │
│ │                        7722-84-1                                                             │ │
│ │                        reagent_2_eq                                                          │ │
│ │                        6.0                                                                   │ │
│ │                        reagent_2_smiles                                                      │ │
│ │                        OO                                                                    │ │
│ │                        solvent_1_cas                                                         │ │
│ │                        7732-18-5                                                             │ │
│ │                        solvent_1_fraction                                                    │ │
│ │                        0.06                                                                  │ │
│ │                        solvent_1_smiles                                                      │ │
│ │                        O                                                                     │ │
│ │                        solvent_2_cas                                                         │ │
│ │                        67-68-5                                                               │ │
│ │                        solvent_2_fraction                                                    │ │
│ │                        0.94                                                                  │ │
│ │                        solvent_2_smiles                                                      │ │
│ │                        O=S(C)C                                                               │ │
│ │                        startingmat_1_cas                                                     │ │
│ │                        26272-85-5                                                            │ │
│ │                        startingmat_1_eq                                                      │ │
│ │                        2                                                                     │ │
│ │                        startingmat_1_smiles                                                  │ │
│ │                        IC1COC1                                                               │ │
│ │                        startingmat_2_cas                                                     │ │
│ │                        184475-35-2                                                           │ │
│ │                        startingmat_2_eq                                                      │ │
│ │                        1                                                                     │ │
│ │                        startingmat_2_smiles                                                  │ │
│ │                        FC1=CC=C(C=C1Cl)NC=2N=CN=C3C=C(OC)C(OCCCN4CCOC...                     │ │
│ │                        product_1_cas                                                         │ │
│ │                        1180654-05-0                                                          │ │
│ │                        product_1_ms                                           MS Found:      │ │
│ │                        503.1800                                                              │ │
│ │                        product_1_nmr           1H NMR (400 MHz; CDCl3) δ 8.01 (dd, J = 6.5,  │ │
│ │                        2...                                                                  │ │
│ │                        product_1_smiles                                                      │ │
│ │                        FC1=CC=C(C=C1Cl)NC=2N=C(N=C3C=C(OC)C(OCCCN4CCO...                     │ │
│ │                        product_1_yield                                                       │ │
│ │                        13                                                                    │ │
│ │                        product_1_yieldtype                                                   │ │
│ │                        UNKNOWN                                                               │ │
│ │                        provenance              Alex T. Mueller alex.mueller@roche.com        │ │
│ │                        0000-00...                                                            │ │
│ │                        Name: 0, dtype: object                                                │ │
│ │             username = 'Alex Mueller'                                                        │ │
│ │             validate = True                                                                  │ │
│ │    validate_cat_smls = False                                                                 │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ValueError: unknown enum label "NAME"

This also happens with a dataset I've formatted myself. The other conversion scripts don't appear to have this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions