Skip to content

Commit

Permalink
refactor: add setup.cfg and reformat the code;
Browse files Browse the repository at this point in the history
  • Loading branch information
WenjieDu committed Jul 30, 2023
1 parent 480f92b commit 295dacf
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 20 deletions.
9 changes: 8 additions & 1 deletion pycorruptor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
# 'X.Y.dev0' is the canonical version of 'X.Y.dev'
__version__ = "0.0.4"


try:
from pycorruptor.corrupt import (
cal_missing_rate,
Expand All @@ -33,3 +32,11 @@

except Exception as e:
print(e)


__all__ = [
"__version__",
"cal_missing_rate",
"masked_fill",
"mcar",
]
18 changes: 18 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file stores some meta configurations for project PyCorruptor.

# Created by Wenjie Du <[email protected]>
# License: GLP-v3

[flake8]
# People may argue that coding style is personal. This may be true if the project is personal and one works like a
# hermit, but to PyPOTS and its community, the answer is NO.
# We use Black and Flake8 to lint code style and keep the style consistent across all commits and pull requests.
# Black only reformats the code, and Flake8 is necessary for checking for some other issues not covered by Black.

# The Black line length is default as 88, while the default of Flake8 is 79. However, considering our monitors are
# much more advanced nowadays, I extend the maximum line length to 120, like other project e.g. transformers. People
# who prefer the default setting can keep using 88 or 79 while coding. Please ensure your code lines not exceeding 120.
max-line-length = 120
extend-ignore =
# why ignore E203? Refer to https://github.com/PyCQA/pycodestyle/issues/373
E203,
42 changes: 23 additions & 19 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,36 @@
from setuptools import setup, find_packages

from pycorruptor.__version__ import version
from pycorruptor import __version__

with open('./README.md', encoding='utf-8') as f:
with open("./README.md", encoding="utf-8") as f:
README = f.read()

setup(
name='pycorruptor',
version=version,
description='A Python Toolbox for Data Corruption',
name="pycorruptor",
version=__version__,
description="A Python Toolbox for Data Corruption",
long_description=README,
long_description_content_type='text/markdown',
license='GPL-3.0',
author='Wenjie Du',
author_email='[email protected]',
url='https://github.com/WenjieDu/PyCorruptor',
download_url='https://github.com/WenjieDu/PyCorruptor/archive/main.zip',
long_description_content_type="text/markdown",
license="GPL-3.0",
author="Wenjie Du",
author_email="[email protected]",
url="https://github.com/WenjieDu/PyCorruptor",
download_url="https://github.com/WenjieDu/PyCorruptor/archive/main.zip",
keywords=[
'missing data', 'missing values', 'data corruption',
'incomplete data', 'partial observation',
'data mining',
"missing data",
"missing values",
"data corruption",
"incomplete data",
"partial observation",
"data mining",
"missingness",
],
packages=find_packages(exclude=['tests']),
packages=find_packages(exclude=["tests"]),
include_package_data=True,
install_requires=[
'numpy',
'scikit_learn',
'pandas',
"numpy",
"scikit_learn",
"pandas",
],
setup_requires=['setuptools>=38.6.0'],
setup_requires=["setuptools>=38.6.0"],
)

0 comments on commit 295dacf

Please sign in to comment.