Skip to content

Commit 0ffc322

Browse files
committed
- updated pipeline
- updated versions and tests
1 parent 44d8a04 commit 0ffc322

20 files changed

+41
-81
lines changed

.github/workflows/pipeline.yml

Lines changed: 0 additions & 56 deletions
This file was deleted.

.github/workflows/test-pipeline.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Python package
2+
3+
on: [push]
4+
5+
jobs:
6+
test:
7+
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
python-version: ["3.8", "3.9", "3.10", "3.11"]
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Set up Python
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: '3.x'
19+
- name: Install dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install -r requirements.txt
23+
- name: Test with pytest
24+
run: |
25+
pip install pytest pytest-cov pytest-dependency
26+
pytest tests --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html

requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pandas>=2.1.4
2+
scikit-learn
3+
tensorflow>=2.10.0

requirements_tf1.txt

Lines changed: 0 additions & 8 deletions
This file was deleted.

requirements_tf2.txt

Lines changed: 0 additions & 7 deletions
This file was deleted.

setup.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@
1717
download_url='https://github.com/maxsch3/batchflow',
1818
license='MIT',
1919
setup_requires=['setuptools_scm'],
20-
install_requires=['numpy>=1.9.1',
21-
'scipy>=0.14',
20+
install_requires=['numpy>=1.20.0',
2221
'scikit-learn',
23-
'pandas'],
22+
'pandas>=2.0.0'],
2423
extras_require={
2524
'visualize': ['pydot>=1.2.4'],
2625
'tests': ['pytest',
@@ -33,7 +32,7 @@
3332
'Intended Audience :: Science/Research',
3433
'License :: OSI Approved :: MIT License',
3534
'Programming Language :: Python :: 3',
36-
'Programming Language :: Python :: 3.6',
35+
'Programming Language :: Python :: 3.10',
3736
'Topic :: Software Development :: Libraries',
3837
'Topic :: Software Development :: Libraries :: Python Modules'
3938
],
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

test/test_feature_dropout.py renamed to tests/test_feature_dropout.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@ def test_cols_dist(self):
4141
assert p > 0.001
4242

4343
def test_uniform_col_dist(self):
44+
sample_size = 1000
4445
fd = FeatureDropout([0., 1.], ['var1', 'var2', 'label'], drop_values='')
45-
batch = fd.transform(self.df.sample(1000, replace=True))
46+
batch = fd.transform(self.df.sample(sample_size, replace=True))
4647
b = (batch == '').sum(axis=0)
47-
c, p = chisquare(b, [333, 333, 333])
48+
c, p = chisquare(b, f_exp=[sample_size/3, sample_size/3, sample_size/3])
4849
assert p > 0.01
4950

5051
def test_different_drop_values(self):

test/test_numpy_encoder_adaptor.py renamed to tests/test_numpy_encoder_adaptor.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,16 @@ def test_transform(self):
2020

2121
def test_transform_integer_array(self):
2222
"""
23-
This tests that pandas specific IntegerArray is converted into numpy format
23+
This tests that pandas specific IntegerArray is converted into numpy format.
24+
IntergerArray of type "Int64" in pandas is a very handy integer data type which supports Nones and does
25+
not require conversion to float data type
2426
:return:
2527
"""
2628
data = pd.Series([1, 2, 4, 5], dtype="Int64")
2729
nea = NumpyEncoderAdaptor()
2830
tr = nea.transform(data)
2931
assert isinstance(tr, np.ndarray)
30-
assert np.issubdtype(tr.dtype, np.object)
32+
assert np.issubdtype(tr.dtype, object)
3133

3234
def test_transform_datetime(self):
3335
"""
@@ -45,7 +47,7 @@ def test_inverse_transform(self):
4547
nea = NumpyEncoderAdaptor()
4648
tr = nea.inverse_transform(data)
4749
assert isinstance(tr, pd.Series)
48-
assert np.issubdtype(tr.dtype, np.int)
50+
assert np.issubdtype(tr.dtype, np.int64)
4951
tr = nea.inverse_transform(data, dtype=np.float32)
5052
assert isinstance(tr, pd.Series)
5153
assert np.issubdtype(tr.dtype, np.float32)

test/test_pandas_encoder_adaptor.py renamed to tests/test_pandas_encoder_adaptor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def test_inverse_transform(self):
3434
pea = PandasEncoderAdaptor()
3535
tr = pea.inverse_transform(data)
3636
assert isinstance(tr, pd.Series)
37-
assert np.issubdtype(tr.dtype, np.int)
37+
assert np.issubdtype(tr.dtype, np.int64)
3838
tr = pea.inverse_transform(data, dtype=np.float32)
3939
assert isinstance(tr, pd.Series)
4040
assert np.issubdtype(tr.dtype, np.float32)
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)