Skip to content

Commit

Permalink
Fix deps (#59)
Browse files Browse the repository at this point in the history
* Fix deps

* Remove direct dependency on numpy
  • Loading branch information
xmnlab authored Nov 9, 2021
1 parent c429c66 commit 5635606
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 18 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ $ git clone [email protected]:your_name_here/ibis-omniscidb.git
3. Install your local copy into a virtual environment. Assuming want to use conda environment,
this is how you set up your fork for local development:
```sh
$ conda env create -n ibis-omniscidb-dev --file environment-dev.yml
$ conda env create -n ibis-omniscidb --file environment-dev.yml
$ python -m pip install -e .
# install git pre-commit hooks
$ pre-commit install
Expand All @@ -66,7 +66,7 @@ $ git clone [email protected]:your_name_here/ibis-omniscidb.git
or

```sh
$ conda create -n ibis-omniscidb-dev python=3.7 pip
$ conda create -n ibis-omniscidb python=3.7 pip
$ python -m pip install -r requirements.txt
$ python -m pip install -e .
# install git pre-commit hooks
Expand Down
4 changes: 2 additions & 2 deletions environment-dev.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: ibis-omniscidb-dev
name: ibis-omniscidb
channels:
- nodefaults
- conda-forge

dependencies:

# core
- python
- ibis-framework-core >=2
- pandas
- pyomnisci >=0.28.1
- pyomniscidb >=5.5.2
- pyarrow
- rbc >=0.4.0

Expand Down
16 changes: 9 additions & 7 deletions ibis_omniscidb/tests/test_operations.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import re

import ibis
import numpy as np
import pandas as pd
import pytest
from pytest import param
Expand All @@ -12,29 +11,32 @@
[
param(
lambda t: t[t, ibis.literal(1).degrees().name('n')].limit(1)['n'],
57.2957795130823,
pd.Series([57.2957795130823]),
id='literal_degree',
),
param(
lambda t: t[t, ibis.literal(1).radians().name('n')].limit(1)['n'],
0.0174532925199433,
pd.Series([0.0174532925199433]),
id='literal_radians',
),
param(
lambda t: t.double_col.corr(t.float_col),
1.000000000000113,
pd.Series([1.000000000000113]),
id='double_float_correlation',
),
param(
lambda t: t.double_col.cov(t.float_col),
91.67005567565313,
pd.Series([91.67005567565313]),
id='double_float_covariance',
),
],
)
def test_operations_scalar(alltypes, result_fn, expected):
result = result_fn(alltypes).execute()
np.testing.assert_allclose(result, expected)
if not isinstance(result, pd.Series):
result = pd.Series([result])

pd.testing.assert_series_equal(result, expected, check_names=False)


@pytest.mark.parametrize(
Expand Down Expand Up @@ -130,7 +132,7 @@ def test_arbitrary_none(alltypes, df_alltypes, result_fn, expected_fn):
expr = result_fn(alltypes)
result = expr.execute()
expected = expected_fn(df_alltypes)
np.testing.assert_allclose(result, expected)
pd.testing.assert_series_equal(pd.Series([result]), pd.Series([expected]))


@pytest.mark.parametrize(
Expand Down
7 changes: 1 addition & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
# core
pandas
pyomnisci>=0.27.0
pyomniscidb>=5.5.2
pyomnisci>=0.28.1
pyarrow
# numpy 1.20 has conflicts with pandas and pyarrow
# pyarrow.lib.ArrowTypeError: ('Did not pass numpy.dtype object',
# 'Conversion failed for column salary with type float64')
numpy<1.20
rbc-project>=0.4.0

# dev
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
'ibis-framework>=2.0',
'pandas',
'pyomnisci>=0.28.1',
'pyomniscidb>=5.5.2',
'pyarrow',
'rbc-project>=0.4.0',
],
Expand Down

0 comments on commit 5635606

Please sign in to comment.