GateNLP / python-gatenlp

Python text processing, pattern matching, and NLP framework
https://gatenlp.github.io/python-gatenlp/
Apache License 2.0
63 stars 8 forks source link

Remove inter-extras dependencies #167

Closed johann-petrak closed 2 years ago

johann-petrak commented 2 years ago

Make sure we do not unintentionally depend on an extra which might not be installed.

There are several possible ways how this could happen:

johann-petrak commented 2 years ago

Fixed for the client modules

johann-petrak commented 2 years ago

Visualization: this happens because of the way how we currently map document formats to the classes that handle the format in the serialization/default module: currently we import all classes and then map the methods for saving/loading. Importing all classes requires all the packages each of the classes requires.

Possible ways to fix this:

For now, the first solution looks like the better option.

johann-petrak commented 2 years ago

If running under starboard (starboard.gg) and displaying a doc:

Traceback (most recent call last):
  File "/lib/python3.9/site-packages/gatenlp/[document.py](http://document.py/)", line 877, in _repr_html_
    if in_colab():
  File "/lib/python3.9/site-packages/gatenlp/[utils.py](http://utils.py/)", line 298, in in_colab
    from IPython.core import getipython
ModuleNotFoundError: No module named 'IPython'