# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['dslinter',
 'dslinter.checkers',
 'dslinter.checkers.deprecated',
 'dslinter.resources',
 'dslinter.scripts',
 'dslinter.tests',
 'dslinter.tests.checkers',
 'dslinter.tests.utils',
 'dslinter.utils']

package_data = \
{'': ['*']}

install_requires = \
['astroid==2.9.3',
 'data-science-types==0.2.23',
 'mypy==0.931',
 'pylint==2.12.2',
 'pyspark-stubs==3.0.0.post3',
 'toml>=0.9,<0.10']

setup_kwargs = {
    'name': 'dslinter',
    'version': '2.0.6',
    'description': '`dslinter` is a pylint plugin for linting data science and machine learning code. We plan to support the following Python libraries: TensorFlow, PyTorch, Scikit-Learn, Pandas, NumPy and SciPy.',
    'long_description': '# dslinter\n[![build](https://github.com/SERG-Delft/dslinter/actions/workflows/build.yml/badge.svg)](https://github.com/SERG-Delft/dslinter/actions/workflows/build.yml)\n[![codecov.io](https://codecov.io/github/SERG-Delft/dslinter/coverage.svg?branch=main)](https://codecov.io/github/SERG-Delft/dslinter?branch=main)\n[![PyPI version](https://badge.fury.io/py/dslinter.svg)](https://badge.fury.io/py/dslinter)\n[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n[![PyPI - Downloads - Monthly](https://img.shields.io/pypi/dm/dslinter)](https://pypi.org/project/dslinter/) \n[![Code Grade](https://api.codiga.io/project/33224/status/svg)](https://api.codiga.io/project/33224/status/svg)\n\n> Hi! We’re currently researching the code smells in machine learning projects in the industry context and looking for feedback for `dslinter`! It would be a massive help if you could run `dslinter` on your machine learning project in an industry setting and send the text and the json output to dslinter2022@gmail.com . The steps and commands can be found [here](https://github.com/SERG-Delft/dslinter/blob/main/STEPS_TO_FOLLOW.md) and it should take no more than 10 minutes. Feel free to send me an [email](dslinter2022@gmail.com) if you want to go through the process together. The process is anonymous and we will remove any sensitive information before the results are published. Many thanks!\n\n`dslinter` is a PyLint plugin for linting data science and machine learning code. It aims to help developers ensure the machine learning code quality and supports the following Python libraries: TensorFlow, PyTorch, Scikit-Learn, Pandas, NumPy and SciPy. \n\n`dslinter` implements the detection rules for smells identified by [our previous work](https://arxiv.org/pdf/2203.13746.pdf). The smells are collected from papers, grey literature, GitHub commits, and Stack Overflow posts. The smells are also elaborated at a [website](https://hynn01.github.io/ml-smells/) :)\n\n\nhttps://user-images.githubusercontent.com/26082974/166685300-71551c45-6d45-4646-bc34-084239b168bb.mov\n\n\n> The example project in the demo video can be found [here](https://github.com/Hynn01/dslinter-example-projects/tree/main/llexnlp).\n\n## Installation\nTo install from the Python Package Index:\n```\npip install dslinter\n```\n\n## Usage\nTo only use the checkers implemented in this plugin, run:\n\n[For Linux/Mac OS Users]:\n```\npylint \\\n--load-plugins=dslinter \\\n--disable=all \\\n--enable=import,unnecessary-iteration-pandas,unnecessary-iteration-tensorflow,\\\nnan-numpy,chain-indexing-pandas,datatype-pandas,\\\ncolumn-selection-pandas,merge-parameter-pandas,inplace-pandas,\\\ndataframe-conversion-pandas,scaler-missing-scikitlearn,hyperparameters-scikitlearn,\\\nhyperparameters-tensorflow,hyperparameters-pytorch,memory-release-tensorflow,\\\ndeterministic-pytorch,randomness-control-numpy,randomness-control-scikitlearn,\\\nrandomness-control-tensorflow,randomness-control-pytorch,randomness-control-dataloader-pytorch,\\\nmissing-mask-tensorflow,missing-mask-pytorch,tensor-array-tensorflow,\\\nforward-pytorch,gradient-clear-pytorch,data-leakage-scikitlearn,\\\ndependent-threshold-scikitlearn,dependent-threshold-tensorflow,dependent-threshold-pytorch \\\n--output-format=json:report.json,text:report.txt,colorized \\\n--reports=y \\\n<path_to_sources>\n```\n[For Windows Users]:\n```\npylint --load-plugins=dslinter --disable=all --enable=import,unnecessary-iteration-pandas,unnecessary-iteration-tensorflow,nan-numpy,chain-indexing-pandas,datatype-pandas,column-selection-pandas,merge-parameter-pandas,inplace-pandas,dataframe-conversion-pandas,scaler-missing-scikitlearn,hyperparameters-scikitlearn,hyperparameters-tensorflow,hyperparameters-pytorch,memory-release-tensorflow,deterministic-pytorch,randomness-control-numpy,randomness-control-scikitlearn,randomness-control-tensorflow,randomness-control-pytorch,randomness-control-dataloader-pytorch,missing-mask-tensorflow,missing-mask-pytorch,tensor-array-tensorflow,forward-pytorch,gradient-clear-pytorch,data-leakage-scikitlearn,dependent-threshold-scikitlearn,dependent-threshold-tensorflow,dependent-threshold-pytorch --output-format=json:report.json,text:report.txt,colorized --reports=y <path_to_sources>\n```\nOr place a [`.pylintrc` configuration file](https://github.com/Hynn01/dslinter/blob/main/docs/pylint-configuration-examples/pylintrc-with-only-dslinter-settings/.pylintrc) which contains above settings in the folder where you run your command on, and run:\n```\npylint <path_to_sources>\n```\nTo expand a current pylint configuration with the checkers from this plugin, run:\n```\npylint --load-plugins=dslinter <other_options> <path_to_sources>\n```\n\n## How to contribute\nContributions are welcome! If you want to contribute, please see the following steps:\n1. fork the repository and clone the repository you forked.\n```\ngit clone https://github.com/your-github-account/dslinter.git\ngit submodule update --init --recursive\n```\n2. `dslinter` uses `poetry` to manage dependencies, so you will need to install `poetry` first and then install the dependencies. \n```\npip install poetry\npoetry install\n```\n- To install `dslinter` from source for development purposes, install it with:\n```\npoetry build\npip install ./dist/dslinter-version.tar.gz\n```\n3. Assign yourself to the issue you want to solve. If you identify a new issue that needs to be solved, feel free to open a new issue.\n4. Make changes to the repository and run the tests.\nTo run the tests using pytest:\n```\npoetry run pytest .\n```\n5. Make a pull request. The pull request is expected to pass the tests. :)\n\n\n## Implemented Checkers:\n\n- **C5501 - C5506 | import | Import Checker**: Check whether data science modules are imported using the correct naming conventions.\n\n- **R5501 | unnecessary-iteration-pandas | Unnecessary Iteration Checker(Pandas)**: Vectorized solutions are preferred over iterators for DataFrames. If iterations are used while there are vectorized APIs can be used, the rule is violated.\n\n- **W5501 | dataframe-iteration-modification-pandas | Unnecessary Iteration Checker(Pandas)**: A dataframe where is iterated over should not be modified. If the dataframe is modified during iteration, the rule is violated.\n\n- **R5502 | unnecessary-iteration-tensorflow | Unnecessary Iteration Checker(TensorFlow)**: If there is any augment assignment operation in the loop, the rule is violated. Augment assignment in the loop can be replaced with vectorized solution in TensorFlow APIs.\n\n- **E5501 | nan-numpy | Nan Equality Checker(NumPy)**: Values cannot be compared with np.nan, as `np.nan != np.nan`.\n\n- **W5502 | chain-indexing-pandas | Chain Indexing Checker(Pandas)**: Chain indexing is considered bad practice in pandas code and should be avoided. If chain indexing is used on a pandas dataframe, the rule is violated.\n\n- **R5503 | datatype-pandas | Datatype Checker(Pandas)**: Datatype should be set when a dataframe is imported from data to ensure the data formats are imported as expected. If the datatype is not set when importing, the rule is violated.\n\n- **R5504 | column-selection-pandas | Column Selection Checker(Pandas)**: Column should be selected after the dataframe is imported for better elaborating what to be expected in the downstream. \n\n- **R5505 | merge-parameter-pandas | Merge Parameter Checker(Pandas)**: Parameters \'how\', \'on\' and \'validate\' should be set for merge operations to ensure the correct usage of merging.\n\n- **W5503 | inplace-pandas | InPlace Checker(Pandas)**: Operations on DataFrames return new DataFrames, and they should be assigned to a variable. Otherwise the result will be lost, and the rule is violated. Operations from the whitelist and with `in_place` parameter set are excluded.\n\n- **W5504 | dataframe-conversion-pandas | Dataframe Conversion Checker(Pandas)**: For dataframe conversion in pandas code, use .to_numpy() instead of .values. If .values is used in pandas code, the rule is violated.\n\n- **W5505 | scaler-missing-scikitlearn | Scaler Missing Checker(ScikitLearn)**: Check whether the scaler is used before every scaling-sensitive operation in scikit-learn codes. Scaling-sensitive operations includes Principal Component Analysis (PCA), Support Vector Machine (SVM), Stochastic Gradient Descent (SGD), Multi-layer Perceptron classifier and L1 and L2 regularization.\n\n- **R5506 | hyperparameters-scikitlearn | Hyperparameter Checker(ScikitLearn)**: For scikit-learn learning algorithms, some important hyperparameters should be set.\n\n- **R5507 | hyperparameter-tensorflow | Hyperparameter Checker(TensorFlow)**: For neural network learning algorithm, some imporatnt hyperparameters should be set, such as learning rate, batch size, momentum and weight decay.\n\n- **R5508 | hyperparameter-pytorch | Hyperparameter Checker(PyTorch)**: For neural network learning algorithm, some imporatnt hyperparameters should be set, such as learning rate, batch size, momentum and weight decay.\n\n- **W5506 | memory-release-tensorflow | Memory Release Checker(TensorFlow)**: If a neural network is created in the loop, and no memory clear operation is used, the rule is violated.\n\n- **W5507 | deterministic-pytorch | Deterministic Algorithm Usage Checker(PyTorch)**: If use_deterministic algorithm is not used in a pytorch program, the rule is violated.\n\n- **W5508 | randomness-control-numpy | Randomness Control Checker(NumPy)**: The np.seed() should be used to preserve reproducibility in a machine learning program.\n\n- **W5509 | randomness-control-scikitlearn | Randomness Control Checker(ScikitLearn)**: For reproducible results across executions, remove any use of random_state=None in scikit-learn estimators.\n\n- **W5510 | randomness-control-tensorflow | Randomness Control Checker(TensorFlow)**: The tf.random.set_seed() should be used to preserve reproducibility in a Tensorflow program.\n\n- **W5511 | randomness-control-pytorch | Randomness Control Checker(PyTorch)**: The torch.manual_seed() should be used to preserve reproducibility in a Tensorflow program.\n\n- **W5512 | randomness-control-dataloader-pytorch | Randomness Control Checker(PyTorch-Dataloader)**: The worker_init_fn() and generator should be set in dataloader to preserve reproducibility. If they\'re not set, the rule is violated.\n\n- **W5513 | missing-mask-tensorflow | Mask Missing Checker(TensorFlow)**: If log function is used in the code, check whether the argument value is valid. \n\n- **W5514 | missing-mask-pytorch | Mask Missing Checker(PyTorch)**: If log function is used in the code, check whether the argument value is valid. \n\n- **W5515 | tensor-array-tensorflow | Tensor Array Checker(Tensorflow)**: Use tf.TensorArray() for growing array in the loop.\n\n- **W5516 | forward-pytorch | Net Forward Checker(PyTorch)**: It is recommended to use self.net() rather than self.net.forward() in PyTorch code. If self.net.forward() is used in the code, the rule is violated.\n\n- **W5517 | gradient-clear-pytorch | Gradient Clear Checker(PyTorch)**: The loss_fn.backward() and optimizer.step() should be used together with optimizer.zero_grad(). If the ".backward()" is missing in the code, the rule is violated.\n\n- **W5518 | data-leakage-scikitlearn | Data Leakage Checker(ScikitLearn)**: All scikit-learn estimators should be used inside Pipelines, to prevent data leakage between training and test data.\n\n- **W5519 | dependent-threshold-scikitlearn | Dependent Threshold Checker(TensorFlow)**: If threshold-dependent evaluation(e.g., f-score) is used in the code, check whether threshold-indenpendent evaluation(e.g., auc) metrics is also used in the code.\n\n- **W5520 | dependent-threshold-tensorflow | Dependent Threshold Checker(PyTorch)**: If threshold-dependent evaluation(e.g., f-score) is used in the code, check whether threshold-indenpendent evaluation(e.g., auc) metrics is also used in the code.\n\n- **W5521 | dependent-threshold-pytorch | Dependent Threshold Checker(ScikitLearn)**: If threshold-dependent evaluation(e.g., f-score) is used in the code, check whether threshold-indenpendent evaluation(e.g., auc) metrics is also used in the code.\n\n## Team\n\nThe dslinter is developed by Mark Haakman and Haiyin Zhang during our master theses at the Software Engineering Research Group (SERG) at TU Delft and ING\'s AI for FinTech Research Lab, supervised by Luís Cruz and Arie van Deursen.\n\nMaintainer: Haiyin Zhang [hynn0633@gmail.com].\n',
    'author': 'Mark Haakman',
    'author_email': None,
    'maintainer': None,
    'maintainer_email': None,
    'url': 'https://pypi.org/project/dslinter/',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'python_requires': '>=3.7,<4.0',
}


setup(**setup_kwargs)
