Skip to content

Commit

Permalink
Merge pull request #206 from machow/chore-cleanup
Browse files Browse the repository at this point in the history
Chore cleanup
  • Loading branch information
machow authored Mar 5, 2020
2 parents f97939a + 1aa7a60 commit bcc06bc
Show file tree
Hide file tree
Showing 10 changed files with 287 additions and 233 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# That pesky Mac file
.DS_Store

# Vim Swapfiles
.*.swp
.*.swo
Expand Down
17 changes: 10 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,26 @@ jobs:
include:
- name: "Minimum install_requires versions"
install:
- pip install numpy~=1.12.0 pandas~=0.24.0 SQLAlchemy~=1.1.18 psycopg2~=2.7.0
- pip install pytest==4.4.2 hypothesis==4.50.2 attrs==19.3.0
- pip install -r requirements-test.txt
- pip install . numpy~=1.12.0 pandas~=0.24.0 SQLAlchemy~=1.1.18 psycopg2~=2.7.0
- name: "Late 2019 dependencies"
install:
- pip install numpy==1.17.4 pandas==0.24.2 SQLAlchemy==1.2.19 psycopg2==2.8.4
- pip install pytest==4.4.2 hypothesis==4.50.2 attrs==19.3.0
- pip install -r requirements-test.txt
- pip install . numpy==1.17.4 pandas==0.24.2 SQLAlchemy==1.2.19 psycopg2==2.8.4
- name: "Newest studied dependency versions"
install:
- pip install numpy==1.17.4 pandas~=0.25.3 SQLAlchemy~=1.3.11 psycopg2~=2.8.4
- pip install pytest==4.4.2 hypothesis==4.50.2 attrs==19.3.0
- pip install -r requirements-test.txt
- pip install . numpy==1.17.4 pandas~=0.25.3 SQLAlchemy~=1.3.11 psycopg2~=2.8.4
- name: "Pure setup.py install"
install:
- pip install -r requirements-test.txt
- pip install ./
- pip install psycopg2~=2.8.4
- pip install pytest==4.4.2 hypothesis==4.50.2 attrs==19.3.0

# command to run tests
install:
- pip install -r requirements.txt
- pip install .
services:
- postgresql
env:
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
NOTEBOOK_TESTS=$(addprefix examples/, examples-dplyr-funcs.ipynb case-iris-select.ipynb examples-postgres.ipynb examples-varspec.ipynb)
NOTEBOOK_TESTS=$(addprefix examples/, \
examples-dplyr-funcs.ipynb case-iris-select.ipynb examples-postgres.ipynb examples-varspec.ipynb \
examples-siu.ipynb \
)

AUTODOC_SCRIPT=docs/generate_autodoc.py

Expand All @@ -11,7 +14,7 @@ test:
pytest --dbs="sqlite,postgresql" siuba/

test-travis:
#py.test --nbval $(filter-out %postgres.ipynb, $(NOTEBOOK_TESTS))
py.test --nbval-lax $(filter-out %postgres.ipynb, $(NOTEBOOK_TESTS))
pytest --dbs="sqlite,postgresql" siuba/

examples/%.ipynb:
Expand Down
186 changes: 91 additions & 95 deletions examples/case-iris-select.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"> 📢: **This document was used during early development of siuba. See the [select docs](https://siuba.readthedocs.io/en/latest/api_table_core/03_select.html).**\n",
"\n",
"Many different ways of selecting columns from the iris dataset. "
]
},
Expand All @@ -23,8 +25,6 @@
"from siuba import *\n",
"import pandas as pd\n",
"\n",
"from sklearn import datasets\n",
"\n",
"pd.set_option('max_rows', 5)"
]
},
Expand All @@ -34,9 +34,21 @@
"metadata": {},
"outputs": [],
"source": [
"iris = datasets.load_iris()\n",
"df_iris = pd.DataFrame(iris.data, columns = iris.feature_names)\n",
"df_iris['species'] = iris.target_names[iris.target]"
"## Rather than import the iris data from sklearn, I am just including the\n",
"## first 5 rows.\n",
"\n",
"# from sklearn import datasets\n",
"# iris = datasets.load_iris()\n",
"# df_iris = pd.DataFrame(iris.data, columns = iris.feature_names)\n",
"# df_iris['species'] = iris.target_names[iris.target]\n",
"\n",
"df_iris = pd.DataFrame({\n",
" 'sepal length (cm)': [5.1, 4.9, 4.7, 4.6, 5.0],\n",
" 'sepal width (cm)': [3.5, 3.0, 3.2, 3.1, 3.6],\n",
" 'petal length (cm)': [1.4, 1.4, 1.3, 1.5, 1.4],\n",
" 'petal width (cm)': [0.2, 0.2, 0.2, 0.2, 0.2],\n",
" 'species': ['setosa', 'setosa', 'setosa', 'setosa', 'setosa']\n",
"})"
]
},
{
Expand Down Expand Up @@ -90,50 +102,47 @@
" <td>4.9</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <th>2</th>\n",
" <td>3.2</td>\n",
" <td>1.3</td>\n",
" <td>0.2</td>\n",
" <td>setosa</td>\n",
" <td>4.7</td>\n",
" </tr>\n",
" <tr>\n",
" <th>148</th>\n",
" <td>3.4</td>\n",
" <td>5.4</td>\n",
" <td>2.3</td>\n",
" <td>virginica</td>\n",
" <td>6.2</td>\n",
" <th>3</th>\n",
" <td>3.1</td>\n",
" <td>1.5</td>\n",
" <td>0.2</td>\n",
" <td>setosa</td>\n",
" <td>4.6</td>\n",
" </tr>\n",
" <tr>\n",
" <th>149</th>\n",
" <td>3.0</td>\n",
" <td>5.1</td>\n",
" <td>1.8</td>\n",
" <td>virginica</td>\n",
" <td>5.9</td>\n",
" <th>4</th>\n",
" <td>3.6</td>\n",
" <td>1.4</td>\n",
" <td>0.2</td>\n",
" <td>setosa</td>\n",
" <td>5.0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>150 rows × 5 columns</p>\n",
"</div>"
],
"text/plain": [
" sepal width (cm) petal length (cm) petal width (cm) species \\\n",
"0 3.5 1.4 0.2 setosa \n",
"1 3.0 1.4 0.2 setosa \n",
".. ... ... ... ... \n",
"148 3.4 5.4 2.3 virginica \n",
"149 3.0 5.1 1.8 virginica \n",
"\n",
" sepal length (cm) \n",
"0 5.1 \n",
"1 4.9 \n",
".. ... \n",
"148 6.2 \n",
"149 5.9 \n",
" sepal width (cm) petal length (cm) petal width (cm) species \\\n",
"0 3.5 1.4 0.2 setosa \n",
"1 3.0 1.4 0.2 setosa \n",
"2 3.2 1.3 0.2 setosa \n",
"3 3.1 1.5 0.2 setosa \n",
"4 3.6 1.4 0.2 setosa \n",
"\n",
"[150 rows x 5 columns]"
" sepal length (cm) \n",
"0 5.1 \n",
"1 4.9 \n",
"2 4.7 \n",
"3 4.6 \n",
"4 5.0 "
]
},
"execution_count": 3,
Expand Down Expand Up @@ -482,37 +491,34 @@
" <td>setosa</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <th>2</th>\n",
" <td>4.7</td>\n",
" <td>3.2</td>\n",
" <td>setosa</td>\n",
" </tr>\n",
" <tr>\n",
" <th>148</th>\n",
" <td>6.2</td>\n",
" <td>3.4</td>\n",
" <td>virginica</td>\n",
" <th>3</th>\n",
" <td>4.6</td>\n",
" <td>3.1</td>\n",
" <td>setosa</td>\n",
" </tr>\n",
" <tr>\n",
" <th>149</th>\n",
" <td>5.9</td>\n",
" <td>3.0</td>\n",
" <td>virginica</td>\n",
" <th>4</th>\n",
" <td>5.0</td>\n",
" <td>3.6</td>\n",
" <td>setosa</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>150 rows × 3 columns</p>\n",
"</div>"
],
"text/plain": [
" sepal length (cm) sepal width (cm) species\n",
"0 5.1 3.5 setosa\n",
"1 4.9 3.0 setosa\n",
".. ... ... ...\n",
"148 6.2 3.4 virginica\n",
"149 5.9 3.0 virginica\n",
"\n",
"[150 rows x 3 columns]"
" sepal length (cm) sepal width (cm) species\n",
"0 5.1 3.5 setosa\n",
"1 4.9 3.0 setosa\n",
"2 4.7 3.2 setosa\n",
"3 4.6 3.1 setosa\n",
"4 5.0 3.6 setosa"
]
},
"execution_count": 6,
Expand Down Expand Up @@ -576,50 +582,40 @@
" <td>setosa</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <th>2</th>\n",
" <td>4.7</td>\n",
" <td>3.2</td>\n",
" <td>1.3</td>\n",
" <td>0.2</td>\n",
" <td>setosa</td>\n",
" </tr>\n",
" <tr>\n",
" <th>148</th>\n",
" <td>6.2</td>\n",
" <td>3.4</td>\n",
" <td>5.4</td>\n",
" <td>2.3</td>\n",
" <td>virginica</td>\n",
" <th>3</th>\n",
" <td>4.6</td>\n",
" <td>3.1</td>\n",
" <td>1.5</td>\n",
" <td>0.2</td>\n",
" <td>setosa</td>\n",
" </tr>\n",
" <tr>\n",
" <th>149</th>\n",
" <td>5.9</td>\n",
" <td>3.0</td>\n",
" <td>5.1</td>\n",
" <td>1.8</td>\n",
" <td>virginica</td>\n",
" <th>4</th>\n",
" <td>5.0</td>\n",
" <td>3.6</td>\n",
" <td>1.4</td>\n",
" <td>0.2</td>\n",
" <td>setosa</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>150 rows × 5 columns</p>\n",
"</div>"
],
"text/plain": [
" sepal length (cm) sepal width (cm) petal_length petal width (cm) \\\n",
"0 5.1 3.5 1.4 0.2 \n",
"1 4.9 3.0 1.4 0.2 \n",
".. ... ... ... ... \n",
"148 6.2 3.4 5.4 2.3 \n",
"149 5.9 3.0 5.1 1.8 \n",
"\n",
" species \n",
"0 setosa \n",
"1 setosa \n",
".. ... \n",
"148 virginica \n",
"149 virginica \n",
"\n",
"[150 rows x 5 columns]"
" sepal length (cm) sepal width (cm) petal_length petal width (cm) species\n",
"0 5.1 3.5 1.4 0.2 setosa\n",
"1 4.9 3.0 1.4 0.2 setosa\n",
"2 4.7 3.2 1.3 0.2 setosa\n",
"3 4.6 3.1 1.5 0.2 setosa\n",
"4 5.0 3.6 1.4 0.2 setosa"
]
},
"execution_count": 7,
Expand Down Expand Up @@ -663,7 +659,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.7"
"version": "3.6.8"
},
"toc": {
"base_numbering": 1,
Expand All @@ -680,5 +676,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
Loading

0 comments on commit bcc06bc

Please sign in to comment.