Skip to content

Commit 7b04910

Browse files
authored
Fixes for Python 3.6 (#128)
* Tests working for python 3.6, except segfault with transformers.BertModel * Enable test_bert * Remove test_bert skip
1 parent 495e24a commit 7b04910

File tree

5 files changed

+31
-30
lines changed

5 files changed

+31
-30
lines changed

.travis.yml

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
language: python
2-
python:
3-
- "3.7"
42

53
jobs:
64
include:
5+
- python: "3.6"
76
- name: "Pandas 1.0.x"
7+
python: "3.7"
88
env: PANDAS_VERSION=1.0.*
99
- name: "Pandas 1.1.x"
10+
python: "3.7"
1011
env: PANDAS_VERSION=1.1.*
1112

1213
install:
13-
#install conda
14-
- sudo apt-get update
15-
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
16-
- bash miniconda.sh -b -p $HOME/miniconda
17-
- source "$HOME/miniconda/etc/profile.d/conda.sh"
18-
- hash -r
19-
- conda config --set always_yes yes --set changeps1 no
20-
- conda update -q conda
14+
#install conda
15+
- sudo apt-get update
16+
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
17+
- bash miniconda.sh -b -p $HOME/miniconda
18+
- source "$HOME/miniconda/etc/profile.d/conda.sh"
19+
- hash -r
20+
- conda config --set always_yes yes --set changeps1 no
21+
- conda update -q conda
2122

22-
- conda info -a
23+
- conda info -a
2324

24-
- CONDA_HOME="${HOME}/miniconda" ./env.sh
25+
- CONDA_HOME="${HOME}/miniconda" ./env.sh
2526

2627

2728
script:
28-
29-
#activate python virtual environment
30-
- conda activate pd
31-
#check that doc generation is possible
32-
- ./generate_docs.sh
33-
#run unit tests
34-
- pytest -v text_extensions_for_pandas
29+
#activate python virtual environment
30+
- conda activate pd
31+
#check that doc generation is possible
32+
- ./generate_docs.sh
33+
#run unit tests
34+
- pytest -v text_extensions_for_pandas

text_extensions_for_pandas/__init__.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
################################################################################
1717
# text_extensions_for_pandas
1818
#
19-
# NLP addons for Pandas dataframes.
19+
# NLP addons for Pandas DataFrames.
2020
#
2121
# To use:
22-
# import text_extensions_for_pandas as pt
22+
# import text_extensions_for_pandas as tp
2323
#
2424

2525

@@ -38,7 +38,8 @@
3838
import text_extensions_for_pandas.array.accessor
3939

4040
# Sub-modules
41-
import text_extensions_for_pandas.io as io
41+
from text_extensions_for_pandas import io
42+
from text_extensions_for_pandas import spanner
4243

4344
# Sphinx autodoc needs this redundant listing of public symbols to list the contents
4445
# of this subpackage.

text_extensions_for_pandas/io/__init__.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121

2222
# Expose the public APIs that users should get from importing the top-level
2323
# library.
24-
import text_extensions_for_pandas.io.watson as watson
25-
import text_extensions_for_pandas.io.bert as bert
26-
import text_extensions_for_pandas.io.conll as conll
27-
import text_extensions_for_pandas.io.spacy as spacy
24+
from text_extensions_for_pandas.io import watson
25+
from text_extensions_for_pandas.io import bert
26+
from text_extensions_for_pandas.io import conll
27+
from text_extensions_for_pandas.io import spacy
2828

2929
__all__ = ["watson", "bert", "conll", "spacy"]
3030

text_extensions_for_pandas/io/watson/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
# Expose the public APIs that users should get from importing the top-level
1717
# library.
18-
import text_extensions_for_pandas.io.watson.nlu as nlu
19-
import text_extensions_for_pandas.io.watson.tables as tables
18+
from text_extensions_for_pandas.io.watson import nlu
19+
from text_extensions_for_pandas.io.watson import tables
2020

2121
__all__ = ["nlu", "tables"]

text_extensions_for_pandas/io/watson/tables.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@
3333
import pandas as pd
3434
from typing import *
3535
import regex
36-
import text_extensions_for_pandas.io.watson.util as util
37-
36+
from text_extensions_for_pandas.io.watson import util
3837

3938

4039
def _make_headers_df(headers_response):
@@ -475,6 +474,7 @@ def make_table(dfs_dict: Dict[str, pd.DataFrame], value_col="text", row_explode_
475474
table = substitute_text_names(table,dfs_dict,row_headers_by_id,col_headers_by_id)
476475
return table
477476

477+
478478
def make_exploded_df(dfs_dict: Dict[str, pd.DataFrame], drop_original: bool = True,
479479
row_explode_by: str = None,
480480
col_explode_by: str = None, keep_all_cols: bool = False,

0 commit comments

Comments
 (0)