pybel / pybel-notebooks

Notebooks demonstrating the usage of PyBEL and PyBEL Tools
Apache License 2.0
8 stars 4 forks source link

New pybel breaks indra dependencies in BEL to Natural Language #17

Open djinnome opened 4 years ago

djinnome commented 4 years ago

The latest version of pybel breaks indra dependencies in the BEL to Natural Language notebook

pybel.get_version()

'0.14.11-dev'

indra.util.get_version.get_version()

'1.17.0-c8f35a6f7a00e8a6116b707b6a034f57a72f22ae'

pbp = process_pybel_graph(sialic_acid_graph)
pbp.statements
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-17-2420ef54593c> in <module>
----> 1 pbp = process_pybel_graph(sialic_acid_graph)
      2 pbp.statements

~/Projects/Proposals/MARS/Pathogenesis/indra/indra/sources/bel/api.py in process_pybel_graph(graph)
    150     """
    151     bp = PybelProcessor(graph)
--> 152     bp.get_statements()
    153     if bp.annot_manager.failures:
    154         logger.warning('missing %d annotation pairs',

~/Projects/Proposals/MARS/Pathogenesis/indra/indra/sources/bel/processor.py in get_statements(self)
     90             for node_ix, node in enumerate((u_data, v_data)):
     91                 if isinstance(node, dsl.ComplexAbundance):
---> 92                     self._get_enum_complex(u_data, v_data, k, d, node_ix)
     93             subj_activity = _get_activity_condition(d.get(pc.SUBJECT))
     94             obj_activity = _get_activity_condition(d.get(pc.OBJECT))

~/Projects/Proposals/MARS/Pathogenesis/indra/indra/sources/bel/processor.py in _get_enum_complex(self, u_data, v_data, k, edge_data, node_ix)
    187         cplx_agent.bound_conditions = []
    188         agents.append(cplx_agent)
--> 189         ev = self._get_evidence(u_data, v_data, k, edge_data)
    190         stmt = Complex(agents, evidence=[ev])
    191         self.statements.append(stmt)

~/Projects/Proposals/MARS/Pathogenesis/indra/indra/sources/bel/processor.py in _get_evidence(self, u_data, v_data, k, edge_data)
    327         ev_pmid = None
    328         if ev_citation:
--> 329             cit_type = ev_citation[pc.CITATION_DB]
    330             cit_ref = ev_citation[pc.CITATION_IDENTIFIER]
    331             if cit_type == pc.CITATION_TYPES[pc.CITATION_TYPE_PUBMED]:

AttributeError: module 'pybel.constants' has no attribute 'CITATION_DB'
djinnome commented 4 years ago

I left a pull request on INDRA to handle the location change of citation_dict which was causing an ImportError on this line in BEL to Natural Language:

from indra.sources.bel.api import process_pybel_graph
djinnome commented 4 years ago

It's too bad that the notebooks can't be on continuous integration, or you probably would have caught this bug.

cthoyt commented 4 years ago

Hi @djinnome, I'd suggest you stay on stable versions of PyBEL that are released on PyPI. I can't support users on the development version, especially right now as v0.15.0 will have some breaking changes (as you've found)