diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 9ba2f5a..35bb85f 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -7,6 +7,6 @@ ENV FLIT_ROOT_INSTALL=1 COPY pyproject.toml . RUN touch README.md \ - && mkdir -p src/python_package \ + && mkdir -p src/tf_tabular \ && python -m flit install --only-deps --deps develop \ && rm -r pyproject.toml README.md src diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 6d8e6f8..ec9a80b 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -13,13 +13,8 @@ "github.vscode-pull-request-github", "ms-azuretools.vscode-docker", "ms-python.python", - "ms-python.vscode-pylance", - "ms-python.pylint", - "ms-python.isort", "ms-python.flake8", "ms-python.black-formatter", - "ms-vsliveshare.vsliveshare", - "ryanluker.vscode-coverage-gutters", "bungcip.better-toml", "GitHub.copilot" ], @@ -28,17 +23,11 @@ "black-formatter.path": [ "/usr/local/py-utils/bin/black" ], - "pylint.path": [ - "/usr/local/py-utils/bin/pylint" - ], "flake8.path": [ "/usr/local/py-utils/bin/flake8" - ], - "isort.path": [ - "/usr/local/py-utils/bin/isort" ] } } }, "onCreateCommand": "pre-commit install-hooks" -} +} \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 8cd4fb9..218261b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,22 +1,20 @@ version: 2 updates: -- package-ecosystem: pip - directory: "/" - schedule: - interval: daily - time: "13:00" - open-pull-requests-limit: 10 - reviewers: - - dciborow - allow: - - dependency-type: direct - - dependency-type: indirect - commit-message: - prefix: "fix: " -- package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: daily - time: "13:00" - commit-message: - prefix: "fix: " + - package-ecosystem: pip + directory: "/" + schedule: + interval: daily + time: "07:00" + open-pull-requests-limit: 3 + allow: + - dependency-type: direct + commit-message: + prefix: "update: " + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: daily + time: "07:00" + commit-message: + prefix: "update: " + open-pull-requests-limit: 3 diff --git a/.github/template-sync.yml b/.github/template-sync.yml deleted file mode 100644 index 8158f79..0000000 --- a/.github/template-sync.yml +++ /dev/null @@ -1,21 +0,0 @@ -files: - - ".gitignore" # include - - ".github" - - ".vscode" - - "tests/conftest.py" - - ".flake8" - - ".pre-commit-config.yml" - - ".pypirc" - - "docs" - - "src/README.md" - - "CODE_OF_CONDUCT.md" - - "LICENSE" - - "README.md" - - "SECURITY.md" - - "SUPPORT.md" - - "pyproject.toml" - - - "!.github/workflows/template-sync.yml" - - "!.github/template-sync.yml" - - "!src/python_project" - - "!tests/test_methods.py" diff --git a/.github/workflows/schedule-update-actions.yml b/.github/workflows/schedule-update-actions.yml index f4c30b6..3cd88b2 100644 --- a/.github/workflows/schedule-update-actions.yml +++ b/.github/workflows/schedule-update-actions.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.5.2 + - uses: actions/checkout@v4.1.2 with: # [Required] Access token with `workflow` scope. token: ${{ secrets.PAT }} diff --git a/.github/workflows/semantic-pr-check.yml b/.github/workflows/semantic-pr-check.yml deleted file mode 100644 index 3a1158d..0000000 --- a/.github/workflows/semantic-pr-check.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: "Semantic PR Check" - -on: - pull_request_target: - types: - - opened - - edited - - synchronize - -jobs: - main: - name: Validate PR title - runs-on: ubuntu-latest - steps: - - uses: amannn/action-semantic-pull-request@v5.2.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/sphinx.yml b/.github/workflows/sphinx.yml deleted file mode 100644 index d8498e6..0000000 --- a/.github/workflows/sphinx.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Deploy Sphinx documentation to Pages - -on: - push: - branches: [main] # branch to trigger deployment - -jobs: - pages: - runs-on: ubuntu-20.04 - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - permissions: - pages: write - id-token: write - steps: - - id: deployment - uses: sphinx-notes/pages@v3 diff --git a/.github/workflows/template-sync.yml b/.github/workflows/template-sync.yml deleted file mode 100644 index 49666bc..0000000 --- a/.github/workflows/template-sync.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Template Sync -on: - workflow_dispatch: -jobs: - sync: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3.5.2 # important! - - uses: euphoricsystems/action-sync-template-repository@v2.5.1 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - dry-run: true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 012f302..c5f4a07 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,44 +17,20 @@ repos: - id: requirements-txt-fixer - id: trailing-whitespace - - repo: https://github.com/PyCQA/isort - rev: 5.12.0 + - repo: https://github.com/astral-sh/ruff-pre-commit + # Ruff version. + rev: v0.2.0 hooks: - - id: isort - args: ["-a", "from __future__ import annotations"] + # Run the linter. + - id: ruff + args: [--fix] + # Run the formatter. + - id: ruff-format - - repo: https://github.com/asottile/pyupgrade - rev: v2.31.0 + - repo: https://github.com/pre-commit/mirrors-mypy + rev: "v1.8.0" # Use the sha / tag you want to point at hooks: - - id: pyupgrade - args: [--py37-plus] - - - repo: https://github.com/hadialqattan/pycln - rev: v1.2.5 - hooks: - - id: pycln - args: [--config=pyproject.toml] - stages: [manual] - - - repo: https://github.com/codespell-project/codespell - rev: v2.1.0 - hooks: - - id: codespell - - - repo: https://github.com/pre-commit/pygrep-hooks - rev: v1.9.0 - hooks: - - id: python-check-blanket-noqa - - id: python-check-blanket-type-ignore - - id: python-no-log-warn - - id: python-no-eval - - id: python-use-type-annotations - - id: rst-backticks - - id: rst-directive-colons - - id: rst-inline-touching-normal - - - repo: https://github.com/mgedmin/check-manifest - rev: "0.47" - hooks: - - id: check-manifest - stages: [manual] + - id: mypy + args: [--ignore-missing-imports] + additional_dependencies: + - "types-PyYAML" diff --git a/LICENSE b/LICENSE index 9e841e7..b383d40 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License - Copyright (c) Microsoft Corporation. + Copyright (c) Xmartlabs. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index cf349a6..66fe8b8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,23 @@ -# Python Project Template +# TF Tabular + +### Feature Overview +* Create input layers based on lists of columns +* No model building or training: Build whatever you want on top +* Support custom embeddings +* Support attention for mixing sequence layers +* Support multi-hot categoricals +* Support computing vocab and normalization params? + + +### Competitor analysis +* DeepTables: + * This is for TensorFlow + * Broader scope: Includes model building and training +* Pytorch tabular: + * Only Pytorch + * Broader scope: Includes model building and training + * Not focused on recommenders (no support for multi-hot and sequence columns https://github.com/manujosephv/pytorch_tabular/issues/174) -This project is a template for creating Python projects that follows the Python Standards declared in PEP 621. It uses a pyproject.yaml file to configure the project and Flit to simplify the build process and publish to PyPI. Flit simplifies the build and packaging process for Python projects by eliminating the need for separate setup.py and setup.cfg files. With Flit, you can manage all relevant configurations within the pyproject.toml file, streamlining development and promoting maintainability by centralizing project metadata, dependencies, and build specifications in one place. ## Project Organization diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index a050f36..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,41 +0,0 @@ - - -## Security - -Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). - -If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below. - -## Reporting Security Issues - -**Please do not report security vulnerabilities through public GitHub issues.** - -Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). - -If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). - -You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). - -Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: - - * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) - * Full paths of source file(s) related to the manifestation of the issue - * The location of the affected source code (tag/branch/commit or direct URL) - * Any special configuration required to reproduce the issue - * Step-by-step instructions to reproduce the issue - * Proof-of-concept or exploit code (if possible) - * Impact of the issue, including how an attacker might exploit the issue - -This information will help us triage your report more quickly. - -If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. - -## Preferred Languages - -We prefer all communications to be in English. - -## Policy - -Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). - - diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index d4bb2cb..0000000 --- a/docs/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line, and also -# from the environment for the first two. -SPHINXOPTS ?= -SPHINXBUILD ?= sphinx-build -SOURCEDIR = . -BUILDDIR = _build - -# Put it first so that "make" without argument is like "make help". -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -.PHONY: help Makefile - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/conf.py b/docs/conf.py deleted file mode 100644 index 4867d95..0000000 --- a/docs/conf.py +++ /dev/null @@ -1,67 +0,0 @@ -# Configuration file for the Sphinx documentation builder. -# -# This file only contains a selection of the most common options. For a full -# list see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html - -# -- Path setup -------------------------------------------------------------- - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -# -import os -import sys - -sys.path.insert(0, os.path.abspath("../src/")) - - -# -- Project information ----------------------------------------------------- - -project = "ai-python docs" -copyright = "2022, Daniel Ciborowski" -author = "Daniel Ciborowski" - -# The full version, including alpha/beta/rc tags -release = "0.1.0" - - -# -- General configuration --------------------------------------------------- - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.doctest", - "sphinx.ext.intersphinx", - "sphinx.ext.ifconfig", - "sphinx.ext.viewcode", # Add links to highlighted source code - "sphinx.ext.napoleon", # to render Google format docstrings - "sphinx.ext.githubpages", -] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This pattern also affects html_static_path and html_extra_path. -exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] - - -# -- Options for HTML output ------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -# -html_theme = "sphinx_rtd_theme" - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# Napoleon settings -napoleon_include_init_with_doc = True -napoleon_include_private_with_doc = True diff --git a/docs/devcontainer.md b/docs/devcontainer.md deleted file mode 100644 index 7b7bfd2..0000000 --- a/docs/devcontainer.md +++ /dev/null @@ -1,16 +0,0 @@ -# GitHub Codespace - -The project's Codespace configuration is located in ".devcontainer". It includes the "Dockerfile" for the development container. -The project can be opened directly in a Codespace. - -## Running Unit Tests - -## Displaying Code Coverage - -## Included Extensions -### Python -### Pylance - -## Installing pre-released Extensions -### Pylint -### Black diff --git a/docs/developer.md b/docs/developer.md deleted file mode 100644 index cbe350a..0000000 --- a/docs/developer.md +++ /dev/null @@ -1,3 +0,0 @@ -# Developer Guide - -## Testing Template Project diff --git a/docs/index.rst b/docs/index.rst deleted file mode 100644 index b10c570..0000000 --- a/docs/index.rst +++ /dev/null @@ -1,20 +0,0 @@ -.. ai-python docs documentation master file, created by - sphinx-quickstart on Thu May 5 14:06:45 2022. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Welcome to ai-python docs's documentation! -========================================== - -.. toctree:: - :maxdepth: 2 - :caption: Contents: - modules - - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100644 index 32bb245..0000000 --- a/docs/make.bat +++ /dev/null @@ -1,35 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=. -set BUILDDIR=_build - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.https://www.sphinx-doc.org/ - exit /b 1 -) - -if "%1" == "" goto help - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - -:end -popd diff --git a/docs/modules.rst b/docs/modules.rst deleted file mode 100644 index 8feff2b..0000000 --- a/docs/modules.rst +++ /dev/null @@ -1,7 +0,0 @@ -src -=== - -.. toctree:: - :maxdepth: 4 - - python_package diff --git a/docs/pre-commit-config.md b/docs/pre-commit-config.md deleted file mode 100644 index f05fc3c..0000000 --- a/docs/pre-commit-config.md +++ /dev/null @@ -1,6 +0,0 @@ -# pre-commit-config.yaml - -Pre-commit is a Python package which can be used to create 'git' hooks which scan can prior to checkins. -The included configuration focuses on python actions which will help to prevent users from commiting code which will fail during builds. -In general, only formatting actions are automatiicaly performed. These include auto-formatting with 'black', or sorting dependacies with 'isort'. -Linting actions are left to the discretion of the user. diff --git a/docs/pylint.md b/docs/pylint.md deleted file mode 100644 index 1fdb3a1..0000000 --- a/docs/pylint.md +++ /dev/null @@ -1,507 +0,0 @@ -[MASTER] - -# A comma-separated list of package or module names from where C extensions may -# be loaded. Extensions are loading into the active Python interpreter and may -# run arbitrary code. -extension-pkg-whitelist=numpy,torch,cv2,pyodbc,pydantic,ciso8601,netcdf4,scipy - -# Add files or directories to the blacklist. They should be base names, not -# paths. -ignore=CVS - -# Add files or directories matching the regex patterns to the blacklist. The -# regex matches against base names, not paths. -ignore-patterns=test.*?py,conftest.py - -# Python code to execute, usually for sys.path manipulation such as -# pygtk.require(). -init-hook='import sys; sys.setrecursionlimit(8 * sys.getrecursionlimit())' - -# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the -# number of processors available to use. -jobs=0 - -# Control the amount of potential inferred values when inferring a single -# object. This can help the performance when dealing with large functions or -# complex, nested conditions. -limit-inference-results=100 - -# List of plugins (as comma separated values of python module names) to load, -# usually to register additional checkers. - -# Pickle collected data for later comparisons. -persistent=yes - -# Specify a configuration file. -#rcfile= - -# When enabled, pylint would attempt to guess common misconfiguration and emit -# user-friendly hints instead of false-positive error messages. -suggestion-mode=yes - -# Allow loading of arbitrary C extensions. Extensions are imported into the -# active Python interpreter and may run arbitrary code. -unsafe-load-any-extension=no - - -[MESSAGES CONTROL] - -# Only show warnings with the listed confidence levels. Leave empty to show -# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED. -confidence= - -# Disable the message, report, category or checker with the given id(s). You -# can either give multiple identifiers separated by comma (,) or put this -# option multiple times (only on the command line, not in the configuration -# file where it should appear only once). You can also use "--disable=all" to -# disable everything first and then reenable specific checks. For example, if -# you want to run only the similarities checker, you can use "--disable=all -# --enable=similarities". If you want to run only the classes checker, but have -# no Warning level messages displayed, use "--disable=all --enable=classes -# --disable=W". -#disable= -# Enable the message, report, category or checker with the given id(s). You can -# either give multiple identifier separated by comma (,) or put this option -# multiple time (only on the command line, not in the configuration file where -# it should appear only once). See also the "--disable" option for examples. -enable=c-extension-no-member - - -[REPORTS] - -# Python expression which should return a score less than or equal to 10. You -# have access to the variables 'error', 'warning', 'refactor', and 'convention' -# which contain the number of messages in each category, as well as 'statement' -# which is the total number of statements analyzed. This score is used by the -# global evaluation report (RP0004). -evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) - -# Template used to display messages. This is a python new-style format string -# used to format the message information. See doc for all details. -#msg-template= - -# Set the output format. Available formats are text, parseable, colorized, json -# and msvs (visual studio). You can also give a reporter class, e.g. -# mypackage.mymodule.MyReporterClass. -output-format=text - -# Tells whether to display a full report or only the messages. -reports=no - -# Activate the evaluation score. -score=yes - - -[REFACTORING] - -# Maximum number of nested blocks for function / method body -max-nested-blocks=5 - -# Complete name of functions that never returns. When checking for -# inconsistent-return-statements if a never returning function is called then -# it will be considered as an explicit return statement and no message will be -# printed. -never-returning-functions=sys.exit - - -[BASIC] - -# Naming style matching correct argument names. -argument-naming-style=snake_case - -# Regular expression matching correct argument names. Overrides argument- -# naming-style. -#argument-rgx= - -# Naming style matching correct attribute names. -attr-naming-style=snake_case - -# Regular expression matching correct attribute names. Overrides attr-naming- -# style. -#attr-rgx= - -# Bad variable names which should always be refused, separated by a comma. -bad-names=foo, - bar, - baz, - toto, - tutu, - tata - -# Naming style matching correct class attribute names. -class-attribute-naming-style=any - -# Regular expression matching correct class attribute names. Overrides class- -# attribute-naming-style. -#class-attribute-rgx= - -# Naming style matching correct class names. -class-naming-style=PascalCase - -# Regular expression matching correct class names. Overrides class-naming- -# style. -#class-rgx= - -# Naming style matching correct constant names. -const-naming-style=UPPER_CASE - -# Regular expression matching correct constant names. Overrides const-naming- -# style. -#const-rgx= - -# Minimum line length for functions/classes that require docstrings, shorter -# ones are exempt. -docstring-min-length=-1 - -# Naming style matching correct function names. -function-naming-style=snake_case - -# Regular expression matching correct function names. Overrides function- -# naming-style. -#function-rgx= - -# Good variable names which should always be accepted, separated by a comma. -good-names=i, - j, - k, - ex, - Run, - _, - df, - n, - N, - t, - T, - ax - -# Include a hint for the correct naming format with invalid-name. -include-naming-hint=no - -# Naming style matching correct inline iteration names. -inlinevar-naming-style=any - -# Regular expression matching correct inline iteration names. Overrides -# inlinevar-naming-style. -#inlinevar-rgx= - -# Naming style matching correct method names. -method-naming-style=snake_case - -# Regular expression matching correct method names. Overrides method-naming- -# style. -#method-rgx= - -# Naming style matching correct module names. -module-naming-style=any - -# Regular expression matching correct module names. Overrides module-naming- -# style. -#module-rgx= - -# Colon-delimited sets of names that determine each other's naming style when -# the name regexes allow several styles. -name-group= - -# Regular expression which should only match function or class names that do -# not require a docstring. -no-docstring-rgx=^_ - -# List of decorators that produce properties, such as abc.abstractproperty. Add -# to this list to register other decorators that produce valid properties. -# These decorators are taken in consideration only for invalid-name. -property-classes=abc.abstractproperty - -# Naming style matching correct variable names. -variable-naming-style=snake_case - -# Regular expression matching correct variable names. Overrides variable- -# naming-style. -#variable-rgx= - - -[FORMAT] - -# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. -expected-line-ending-format= - -# Regexp for a line that is allowed to be longer than the limit. -ignore-long-lines=^\s*(# )?.*['"]?? - -# Number of spaces of indent required inside a hanging or continued line. -indent-after-paren=4 - -# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 -# tab). -indent-string=' ' - -# Maximum number of characters on a single line. -max-line-length=120 - -# Maximum number of lines in a module. -max-module-lines=1000 - -# List of optional constructs for which whitespace checking is disabled. `dict- -# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. -# `trailing-comma` allows a space between comma and closing bracket: (a, ). -# `empty-line` allows space-only lines. -no-space-check=trailing-comma, - dict-separator - -# Allow the body of a class to be on the same line as the declaration if body -# contains single statement. -single-line-class-stmt=no - -# Allow the body of an if to be on the same line as the test if there is no -# else. -single-line-if-stmt=no - - -[LOGGING] - -# Format style used to check logging format string. `old` means using % -# formatting, `new` is for `{}` formatting,and `fstr` is for f-strings. -logging-format-style=old - -# Logging modules to check that the string format arguments are in logging -# function parameter format. -logging-modules=logging - - -[MISCELLANEOUS] - -# List of note tags to take in consideration, separated by a comma. -notes=FIXME, - XXX, - TODO - - -[SIMILARITIES] - -# Ignore comments when computing similarities. -ignore-comments=yes - -# Ignore docstrings when computing similarities. -ignore-docstrings=yes - -# Ignore imports when computing similarities. -ignore-imports=yes - -# Minimum lines number of a similarity. -min-similarity-lines=9 - - -[SPELLING] - -# Limits count of emitted suggestions for spelling mistakes. -max-spelling-suggestions=4 - -# Spelling dictionary name. Available dictionaries: none. To make it work, -# install the python-enchant package. -spelling-dict= - -# List of comma separated words that should not be checked. -spelling-ignore-words= - -# A path to a file that contains the private dictionary; one word per line. -spelling-private-dict-file= - -# Tells whether to store unknown words to the private dictionary (see the -# --spelling-private-dict-file option) instead of raising a message. -spelling-store-unknown-words=no - - -[STRING] - -# This flag controls whether the implicit-str-concat-in-sequence should -# generate a warning on implicit string concatenation in sequences defined over -# several lines. -check-str-concat-over-line-jumps=no - - -[TYPECHECK] - -# List of decorators that produce context managers, such as -# contextlib.contextmanager. Add to this list to register other decorators that -# produce valid context managers. -contextmanager-decorators=contextlib.contextmanager - -# List of members which are set dynamically and missed by pylint inference -# system, and so shouldn't trigger E1101 when accessed. Python regular -# expressions are accepted. -generated-members=numpy.*,np.*,pyspark.sql.functions,collect_list - -# Tells whether missing members accessed in mixin class should be ignored. A -# mixin class is detected if its name ends with "mixin" (case insensitive). -ignore-mixin-members=yes - -# Tells whether to warn about missing members when the owner of the attribute -# is inferred to be None. -ignore-none=yes - -# This flag controls whether pylint should warn about no-member and similar -# checks whenever an opaque object is returned when inferring. The inference -# can return multiple potential results while evaluating a Python object, but -# some branches might not be evaluated, which results in partial inference. In -# that case, it might be useful to still emit no-member and other checks for -# the rest of the inferred objects. -ignore-on-opaque-inference=yes - -# List of class names for which member attributes should not be checked (useful -# for classes with dynamically set attributes). This supports the use of -# qualified names. -ignored-classes=optparse.Values,thread._local,_thread._local,numpy,torch,swagger_client - -# List of module names for which member attributes should not be checked -# (useful for modules/projects where namespaces are manipulated during runtime -# and thus existing member attributes cannot be deduced by static analysis). It -# supports qualified module names, as well as Unix pattern matching. -ignored-modules=numpy,torch,swagger_client,netCDF4,scipy - -# Show a hint with possible names when a member name was not found. The aspect -# of finding the hint is based on edit distance. -missing-member-hint=yes - -# The minimum edit distance a name should have in order to be considered a -# similar match for a missing member name. -missing-member-hint-distance=1 - -# The total number of similar names that should be taken in consideration when -# showing a hint for a missing member. -missing-member-max-choices=1 - -# List of decorators that change the signature of a decorated function. -signature-mutators= - - -[VARIABLES] - -# List of additional names supposed to be defined in builtins. Remember that -# you should avoid defining new builtins when possible. -additional-builtins=dbutils - -# Tells whether unused global variables should be treated as a violation. -allow-global-unused-variables=yes - -# List of strings which can identify a callback function by name. A callback -# name must start or end with one of those strings. -callbacks=cb_, - _cb - -# A regular expression matching the name of dummy variables (i.e. expected to -# not be used). -dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ - -# Argument names that match this expression will be ignored. Default to name -# with leading underscore. -ignored-argument-names=_.*|^ignored_|^unused_ - -# Tells whether we should check for unused import in __init__ files. -init-import=no - -# List of qualified module names which can have objects that can redefine -# builtins. -redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io - - -[CLASSES] - -# List of method names used to declare (i.e. assign) instance attributes. -defining-attr-methods=__init__, - __new__, - setUp, - __post_init__ - -# List of member names, which should be excluded from the protected access -# warning. -exclude-protected=_asdict, - _fields, - _replace, - _source, - _make - -# List of valid names for the first argument in a class method. -valid-classmethod-first-arg=cls - -# List of valid names for the first argument in a metaclass class method. -valid-metaclass-classmethod-first-arg=cls - - -[DESIGN] - -# Maximum number of arguments for function / method. -max-args=5 - -# Maximum number of attributes for a class (see R0902). -max-attributes=7 - -# Maximum number of boolean expressions in an if statement (see R0916). -max-bool-expr=5 - -# Maximum number of branch for function / method body. -max-branches=12 - -# Maximum number of locals for function / method body. -max-locals=15 - -# Maximum number of parents for a class (see R0901). -max-parents=7 - -# Maximum number of public methods for a class (see R0904). -max-public-methods=20 - -# Maximum number of return / yield for function / method body. -max-returns=6 - -# Maximum number of statements in function / method body. -max-statements=50 - -# Minimum number of public methods for a class (see R0903). -min-public-methods=2 - - -[IMPORTS] - -# List of modules that can be imported at any level, not just the top level -# one. -allow-any-import-level= - -# Allow wildcard imports from modules that define __all__. -allow-wildcard-with-all=no - -# Analyse import fallback blocks. This can be used to support both Python 2 and -# 3 compatible code, which means that the block might have code that exists -# only in one or another interpreter, leading to false positives when analysed. -analyse-fallback-blocks=no - -# Deprecated modules which should not be used, separated by a comma. -deprecated-modules=optparse,tkinter.tix - -# Create a graph of external dependencies in the given file (report RP0402 must -# not be disabled). -ext-import-graph= - -# Create a graph of every (i.e. internal and external) dependencies in the -# given file (report RP0402 must not be disabled). -import-graph= - -# Create a graph of internal dependencies in the given file (report RP0402 must -# not be disabled). -int-import-graph= - -# Force import order to recognize a module as part of the standard -# compatibility libraries. -known-standard-library= - -# Force import order to recognize a module as part of a third party library. -known-third-party=enchant, azureiai-logistics-inventoryplanning - -# Couples of modules and preferred modules, separated by a comma. -preferred-modules= - - -[EXCEPTIONS] - -# Exceptions that will emit a warning when being caught. Defaults to -# "BaseException, Exception". -overgeneral-exceptions=BaseException, - Exception diff --git a/docs/pyproject.md b/docs/pyproject.md deleted file mode 100644 index 32fa0fe..0000000 --- a/docs/pyproject.md +++ /dev/null @@ -1,9 +0,0 @@ -# pypyroject.toml - -The pyproject.toml is the main configuration file used for the Python project. -It contains configurations for building, linting, testing, and publishing the Python package. - -The pyproject.toml replaces the "setup.py" package. When using 'flit' or 'poetry', only the pyproject.toml is required. -This project currently uses 'flit', but in the future may also include a 'poetry' example. Both are considered viable options. - -When using setuptools, and setup.cfg is still required. diff --git a/docs/python_package.hello_world.rst b/docs/python_package.hello_world.rst deleted file mode 100644 index 16f91f0..0000000 --- a/docs/python_package.hello_world.rst +++ /dev/null @@ -1,21 +0,0 @@ -python\_package.hello\_world package -==================================== - -Submodules ----------- - -python\_package.hello\_world.hello\_world module ------------------------------------------------- - -.. automodule:: python_package.hello_world.hello_world - :members: - :undoc-members: - :show-inheritance: - -Module contents ---------------- - -.. automodule:: python_package.hello_world - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/python_package.rst b/docs/python_package.rst deleted file mode 100644 index 3d9e787..0000000 --- a/docs/python_package.rst +++ /dev/null @@ -1,29 +0,0 @@ -python\_package package -======================= - -Subpackages ------------ - -.. toctree:: - :maxdepth: 4 - - python_package.hello_world - -Submodules ----------- - -python\_package.setup module ----------------------------- - -.. automodule:: python_package.setup - :members: - :undoc-members: - :show-inheritance: - -Module contents ---------------- - -.. automodule:: python_package - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index b75b86b..0000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -sphinx -sphinx-copybutton -sphinx-rtd-theme diff --git a/docs/vscode.md b/docs/vscode.md deleted file mode 100644 index 9987b82..0000000 --- a/docs/vscode.md +++ /dev/null @@ -1 +0,0 @@ -# Visual Studio Code for Python Development diff --git a/docs/workflows.md b/docs/workflows.md deleted file mode 100644 index db88500..0000000 --- a/docs/workflows.md +++ /dev/null @@ -1,4 +0,0 @@ -# GitHub Workflow for Python - -The main workflow file is ".github/workflows/CI.yml". This performs linting, testing, and publishing for Python packages. -It can also be triggered manually on a specific branch. diff --git a/src/README.md b/src/README.md index faa68b2..f51b561 100644 --- a/src/README.md +++ b/src/README.md @@ -1 +1 @@ -This directoy stores each Python Package. +This directory stores each Python Package. diff --git a/src/python_package/hello_world.py b/src/python_package/hello_world.py deleted file mode 100644 index db43d69..0000000 --- a/src/python_package/hello_world.py +++ /dev/null @@ -1,25 +0,0 @@ -# --------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See LICENSE in project root for information. -# --------------------------------------------------------------------------------- -"""This is a Sample Python file.""" - - -from __future__ import annotations - - -def hello_world(i: int = 0) -> str: - """Doc String.""" - print("hello world") - return f"string-{i}" - - -def good_night() -> str: - """Doc String.""" - print("good night") - return "string" - - -def hello_goodbye(): - hello_world(1) - good_night() diff --git a/src/python_package/__init__.py b/src/tf_tabular/__init__.py similarity index 76% rename from src/python_package/__init__.py rename to src/tf_tabular/__init__.py index 9115027..57ff411 100644 --- a/src/python_package/__init__.py +++ b/src/tf_tabular/__init__.py @@ -1,8 +1,8 @@ # ------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Xmartlabs. All rights reserved. # Licensed under the MIT License. See LICENSE in project root for information. # ------------------------------------------------------------- """Python Package Template""" from __future__ import annotations -__version__ = "0.0.2" +__version__ = "0.0.1" diff --git a/tests/test_methods.py b/tests/test_methods.py deleted file mode 100644 index 40b5791..0000000 --- a/tests/test_methods.py +++ /dev/null @@ -1,32 +0,0 @@ -# --------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See LICENSE in project root for information. -# --------------------------------------------------------------------------------- -"""This is a sample python file for testing functions from the source code.""" -from __future__ import annotations - -from python_package.hello_world import hello_world - - -def hello_test(): - """ - This defines the expected usage, which can then be used in various test cases. - Pytest will not execute this code directly, since the function does not contain the suffex "test" - """ - hello_world() - - -def test_hello(unit_test_mocks: None): - """ - This is a simple test, which can use a mock to override online functionality. - unit_test_mocks: Fixture located in conftest.py, implictly imported via pytest. - """ - hello_test() - - -def test_int_hello(): - """ - This test is marked implicitly as an integration test because the name contains "_init_" - https://docs.pytest.org/en/6.2.x/example/markers.html#automatically-adding-markers-based-on-test-names - """ - hello_test()