Skip to content

Commit dab6470

Browse files
authored
Merge pull request #3 from ddaskan/V0.1.1
V0.1.1
2 parents cb04b18 + 896b0d8 commit dab6470

File tree

8 files changed

+52
-16
lines changed

8 files changed

+52
-16
lines changed

.github/workflows/test_coverage.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ name: tests
55

66
on:
77
workflow_dispatch:
8+
schedule:
9+
- cron: '0 */2 * * *'
810
push:
911
branches: [ master ]
1012
pull_request:
@@ -17,7 +19,7 @@ jobs:
1719
strategy:
1820
matrix:
1921
os: [macos-latest, ubuntu-latest, windows-latest]
20-
python-version: [3.5, 3.6, 3.7, 3.8]
22+
python-version: [3.6, 3.7, 3.8, 3.9]
2123

2224
steps:
2325
- uses: actions/checkout@v2
@@ -34,7 +36,8 @@ jobs:
3436
pip install pytest
3537
pip install pytest-cov
3638
python -m doctest README.md
37-
pytest --doctest-modules --junitxml=junit/test-results-${{ matrix.os }}-py${{ matrix.python-version }}.xml --cov=trendypy --cov-report=xml --cov-report=html
39+
python -m doctest docs/source/quickstart.rst
40+
pytest --doctest-modules --junitxml=junit/test-results-${{ matrix.os }}-py${{ matrix.python-version }}.xml --cov=mlqa --cov-report=xml --cov-report=html
3841
- name: Upload pytest test results
3942
uses: actions/upload-artifact@v2
4043
with:

.github/workflows/upload_pypi.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This workflows will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
name: Upload to PyPI
5+
6+
on:
7+
release:
8+
types: [created]
9+
10+
jobs:
11+
deploy:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Set up Python
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: '3.x'
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install setuptools wheel twine
25+
- name: Build and publish
26+
env:
27+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
28+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
29+
run: |
30+
python setup.py sdist bdist_wheel
31+
twine upload dist/*

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
# MLQA <img src="docs/_static/mlqa.png" align="right" width="120"/>
1+
# MLQA
2+
3+
<img src="https://raw.githubusercontent.com/ddaskan/mlqa/master/docs/_static/mlqa.png" align="right" width="120"/>
24

35
[![PyPI](https://img.shields.io/pypi/v/mlqa)](https://pypi.org/project/mlqa/)
6+
[![tests](https://github.com/ddaskan/mlqa/workflows/tests/badge.svg)](https://github.com/ddaskan/mlqa/actions?query=workflow%3Atests)
7+
[![Codecov](https://codecov.io/gh/ddaskan/mlqa/master.svg)](https://codecov.io/gh/ddaskan/mlqa/)
48
[![Documentation Status](https://readthedocs.org/projects/mlqa/badge/?version=latest)](https://mlqa.readthedocs.io/en/latest/?badge=latest)
5-
[![PyPI - License](https://img.shields.io/pypi/l/mlqa)](https://github.com/ddaskan/mlqa/blob/master/LICENSE)
69
[![PyPI - Downloads](https://img.shields.io/pypi/dm/mlqa)](https://pypi.org/project/mlqa/)
710
[![GitHub last commit](https://img.shields.io/github/last-commit/ddaskan/mlqa)](https://github.com/ddaskan/mlqa)
811
[![Twitter](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fgithub.com%2Fddaskan%2Fmlqa)](https://twitter.com/intent/tweet?text=Wow:&url=https%3A%2F%2Fgithub.com%2Fddaskan%2Fmlqa)
@@ -19,7 +22,7 @@ You can install MLQA with pip.
1922

2023
`pip install mlqa`
2124

22-
MLQA depends on Pandas and Numpy and works in Python 3.5+.
25+
MLQA depends on Pandas and Numpy and works in Python 3.6+.
2326

2427
## Quickstart
2528

@@ -48,4 +51,4 @@ See more examples at [Documentation/Quickstart](https://mlqa.readthedocs.io/en/l
4851
Tests are written with [unittest](https://docs.python.org/3/library/unittest.html) and can be located in the [tests](tests/) folder. There are also some tests in docstring to be run by [doctest](https://docs.python.org/3/library/doctest.html).
4952

5053
## License
51-
[MIT](LICENSE)
54+
[MIT](https://github.com/ddaskan/mlqa/blob/master/LICENSE)

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
author = 'Dogan Askan'
2626

2727
# The full version, including alpha/beta/rc tags
28-
release = '0.1.0.post2'
28+
release = '0.1.1'
2929

3030

3131
# -- General configuration ---------------------------------------------------

mlqa/identifiers.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ class DiffChecker():
6363
>>> dc.set_threshold(0.1)
6464
>>> dc.check(pd.DataFrame({'mean_col':[1, 1.5]*50, 'na_col':[None]*70+[1]*30}))
6565
False
66-
>>> os.remove('mylog.log')
6766
6867
'''
6968
stats = []
@@ -183,10 +182,10 @@ def set_threshold(self, threshold):
183182
col1 col2
184183
mean 0.2 0.1
185184
max 0.2 0.1
186-
>>> dc.set_threshold({'col1':{'mean':0.1}}) # to set in column-stat level
185+
>>> dc.set_threshold({'col1':{'mean':0.3}}) # to set in column-stat level
187186
>>> print(dc.threshold_df)
188187
col1 col2
189-
mean 0.1 0.1
188+
mean 0.3 0.1
190189
max 0.2 0.1
191190
192191
'''
@@ -254,7 +253,7 @@ def fit(self, df):
254253
self.df_fit_stats.loc[stat_name, col] = df[col].agg(stat)
255254

256255
self.threshold_df = self.df_fit_stats.copy()
257-
self.threshold_df.replace(self.threshold_df, np.NaN, inplace=True)
256+
self.threshold_df.loc[:, :] = np.NaN
258257

259258
def check(self, df_to_check, columns=None, columns_to_exclude=None):
260259
'''Checks given `df_to_check` based on fitted `df` stats.

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
numpy
2-
pandas
1+
numpy>=1.19.4
2+
pandas>=1.1.5

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
setuptools.setup(
1010
name="mlqa",
11-
version="0.1.0.post2",
11+
version="0.1.1",
1212
author="Dogan Askan",
1313
author_email="[email protected]",
1414
description="A Package to perform QA on data flows for Machine Learning.",
@@ -32,6 +32,6 @@
3232
"Topic :: Scientific/Engineering :: Artificial Intelligence",
3333
"Topic :: Software Development",
3434
],
35-
python_requires='>=3.5',
35+
python_requires='>=3.6',
3636
install_requires=install_requires,
3737
)

tests/test_identifier.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def test_check(self):
239239
dcr.check(self.df1)
240240
self.assertRegex(
241241
log.output[0],
242-
"^WARNING:test_mlqa:mean value \(i.e. 0.73\) is not in the (.*) "
242+
"^WARNING:test_mlqa:mean value \\(i.e. 0.73\\) is not in the (.*) "
243243
"for Siblings/Spouses Aboard$")
244244
self.assertEqual(
245245
log.output[1],

0 commit comments

Comments
 (0)