diff --git a/.github/workflows/publish-analysis.yml b/.github/workflows/publish-analysis.yml new file mode 100644 index 00000000..45580049 --- /dev/null +++ b/.github/workflows/publish-analysis.yml @@ -0,0 +1,38 @@ +# This workflows will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +name: Upload Analysis Package + +on: + push: + tags: + - v* +jobs: + deploy: + + runs-on: ubuntu-latest + + env: + working-directory: ./analysis-master/ + if: contains(github.ref, "master") + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Install dependencies + working-directory: ${{env.working-directory}} + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build package + working-directory: ${{env.working-directory}} + run: | + python setup.py sdist bdist_wheel + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.PYPI_TOKEN }} + packages_dir: analysis-master/dist/ diff --git a/.gitignore b/.gitignore index 8e0a337d..94273ee2 100644 --- a/.gitignore +++ b/.gitignore @@ -30,4 +30,10 @@ data-analysis/config-pop.json data-analysis/__pycache__/ analysis-master/__pycache__/ analysis-master/.pytest_cache/ -data-analysis/.pytest_cache/ \ No newline at end of file +data-analysis/.pytest_cache/ +analysis-master/tra_analysis.egg-info +analysis-master/tra_analysis/__pycache__ +analysis-master/tra_analysis/.ipynb_checkpoints +.pytest_cache +analysis-master/tra_analysis/metrics/__pycache__ +analysis-master/dist \ No newline at end of file diff --git a/README.md b/README.md index cc218369..fef2f068 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ # red-alliance-analysis Titan Robotics 2022 Strategy Team Repository for Data Analysis Tools. Included with these tools are the backend data analysis engine formatted as a python package, associated binaries for the analysis package, and premade scripts that can be pulled directly from this repository and will integrate with other Red Alliance applications to quickly deploy FRC scouting tools. + +# Installing +`pip install tra_analysis` \ No newline at end of file diff --git a/analysis-master/analysis/.ipynb_checkpoints/equation-checkpoint.ipynb b/analysis-master/analysis/.ipynb_checkpoints/equation-checkpoint.ipynb deleted file mode 100644 index 9245ab26..00000000 --- a/analysis-master/analysis/.ipynb_checkpoints/equation-checkpoint.ipynb +++ /dev/null @@ -1,35 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "string = \"3+4+5\"\n", - "re.sub(\"\\d+[+]{1}\\d+\", string, sum([int(i) for i in re.split(\"[+]{1}\", re.search(\"\\d+[+]{1}\\d+\", string).group())]))" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.7.6" - } - }, - "nbformat": 4, - "nbformat_minor": 4 -} diff --git a/analysis-master/dist/analysis-1.0.0.10-py3-none-any.whl b/analysis-master/dist/analysis-1.0.0.10-py3-none-any.whl deleted file mode 100644 index a9401521..00000000 Binary files a/analysis-master/dist/analysis-1.0.0.10-py3-none-any.whl and /dev/null differ diff --git a/analysis-master/dist/analysis-1.0.0.10.tar.gz b/analysis-master/dist/analysis-1.0.0.10.tar.gz deleted file mode 100644 index a970f1b5..00000000 Binary files a/analysis-master/dist/analysis-1.0.0.10.tar.gz and /dev/null differ diff --git a/analysis-master/dist/analysis-1.0.0.11-py3-none-any.whl b/analysis-master/dist/analysis-1.0.0.11-py3-none-any.whl deleted file mode 100644 index 6ad83256..00000000 Binary files a/analysis-master/dist/analysis-1.0.0.11-py3-none-any.whl and /dev/null differ diff --git a/analysis-master/dist/analysis-1.0.0.11.tar.gz b/analysis-master/dist/analysis-1.0.0.11.tar.gz deleted file mode 100644 index 2e9aa30e..00000000 Binary files a/analysis-master/dist/analysis-1.0.0.11.tar.gz and /dev/null differ diff --git a/analysis-master/dist/analysis-1.0.0.12-py3-none-any.whl b/analysis-master/dist/analysis-1.0.0.12-py3-none-any.whl deleted file mode 100644 index 60e0b51c..00000000 Binary files a/analysis-master/dist/analysis-1.0.0.12-py3-none-any.whl and /dev/null differ diff --git a/analysis-master/dist/analysis-1.0.0.12.tar.gz b/analysis-master/dist/analysis-1.0.0.12.tar.gz deleted file mode 100644 index 1ba27431..00000000 Binary files a/analysis-master/dist/analysis-1.0.0.12.tar.gz and /dev/null differ diff --git a/analysis-master/dist/analysis-1.0.0.8-py3-none-any.whl b/analysis-master/dist/analysis-1.0.0.8-py3-none-any.whl deleted file mode 100644 index 83d5cb96..00000000 Binary files a/analysis-master/dist/analysis-1.0.0.8-py3-none-any.whl and /dev/null differ diff --git a/analysis-master/dist/analysis-1.0.0.8.tar.gz b/analysis-master/dist/analysis-1.0.0.8.tar.gz deleted file mode 100644 index 922e71b3..00000000 Binary files a/analysis-master/dist/analysis-1.0.0.8.tar.gz and /dev/null differ diff --git a/analysis-master/dist/analysis-1.0.0.9-py3-none-any.whl b/analysis-master/dist/analysis-1.0.0.9-py3-none-any.whl deleted file mode 100644 index 24f78782..00000000 Binary files a/analysis-master/dist/analysis-1.0.0.9-py3-none-any.whl and /dev/null differ diff --git a/analysis-master/dist/analysis-1.0.0.9.tar.gz b/analysis-master/dist/analysis-1.0.0.9.tar.gz deleted file mode 100644 index 542898be..00000000 Binary files a/analysis-master/dist/analysis-1.0.0.9.tar.gz and /dev/null differ diff --git a/analysis-master/setup.py b/analysis-master/setup.py index 043ca845..55ca9255 100644 --- a/analysis-master/setup.py +++ b/analysis-master/setup.py @@ -7,11 +7,11 @@ with open("requirements.txt", 'r') as file: requirements.append(line) setuptools.setup( - name="analysis", - version="1.0.0.012", + name="tra_analysis", + version="2.0.2", author="The Titan Scouting Team", author_email="titanscout2022@gmail.com", - description="analysis package developed by Titan Scouting for The Red Alliance", + description="Analysis package developed by Titan Scouting for The Red Alliance", long_description="", long_description_content_type="text/markdown", url="https://github.com/titanscout2022/tr2022-strategy", diff --git a/analysis-master/test_analysis.py b/analysis-master/test_analysis.py index 0d1ce96b..ffb7e88f 100644 --- a/analysis-master/test_analysis.py +++ b/analysis-master/test_analysis.py @@ -1,5 +1,5 @@ -from analysis import analysis as an -from analysis import metrics +from tra_analysis import analysis as an +from tra_analysis import metrics def test_(): test_data_linear = [1, 3, 6, 7, 9] diff --git a/analysis-master/analysis/__init__.py b/analysis-master/tra_analysis/__init__.py similarity index 100% rename from analysis-master/analysis/__init__.py rename to analysis-master/tra_analysis/__init__.py diff --git a/analysis-master/analysis/analysis.py b/analysis-master/tra_analysis/analysis.py similarity index 99% rename from analysis-master/analysis/analysis.py rename to analysis-master/tra_analysis/analysis.py index 07e619c4..d4a086e0 100644 --- a/analysis-master/analysis/analysis.py +++ b/analysis-master/tra_analysis/analysis.py @@ -1,16 +1,18 @@ # Titan Robotics Team 2022: Data Analysis Module -# Written by Arthur Lu & Jacob Levine +# Written by Arthur Lu, Jacob Levine, and Dev Singh # Notes: -# this should be imported as a python module using 'from analysis import analysis' +# this should be imported as a python module using 'from tra_analysis import analysis' # this should be included in the local directory or environment variable # this module has been optimized for multhreaded computing # current benchmark of optimization: 1.33 times faster # setup: -__version__ = "1.2.2.000" +__version__ = "2.0.2" # changelog should be viewed using print(analysis.__changelog__) __changelog__ = """changelog: + 2.0.2: + - rename analysis imports to tra_analysis for PyPI publishing 1.2.2.000: - added Sort class - added several array sorting functions to Sort class including: @@ -345,8 +347,8 @@ __all__ = [ # imports (now in alphabetical order! v 1.0.3.006): import csv -from analysis.metrics import elo as Elo -from analysis.metrics import glicko2 as Glicko2 +from tra_analysis.metrics import elo as Elo +from tra_analysis.metrics import glicko2 as Glicko2 import math import numba from numba import jit @@ -355,7 +357,7 @@ import scipy from scipy import optimize, stats import sklearn from sklearn import preprocessing, pipeline, linear_model, metrics, cluster, decomposition, tree, neighbors, naive_bayes, svm, model_selection, ensemble -from analysis.metrics import trueskill as Trueskill +from tra_analysis.metrics import trueskill as Trueskill import warnings class error(ValueError): diff --git a/analysis-master/analysis/equation.ipynb b/analysis-master/tra_analysis/equation.ipynb similarity index 100% rename from analysis-master/analysis/equation.ipynb rename to analysis-master/tra_analysis/equation.ipynb diff --git a/analysis-master/analysis/metrics/__init__.py b/analysis-master/tra_analysis/metrics/__init__.py similarity index 100% rename from analysis-master/analysis/metrics/__init__.py rename to analysis-master/tra_analysis/metrics/__init__.py diff --git a/analysis-master/analysis/metrics/elo.py b/analysis-master/tra_analysis/metrics/elo.py similarity index 100% rename from analysis-master/analysis/metrics/elo.py rename to analysis-master/tra_analysis/metrics/elo.py diff --git a/analysis-master/analysis/metrics/glicko2.py b/analysis-master/tra_analysis/metrics/glicko2.py similarity index 100% rename from analysis-master/analysis/metrics/glicko2.py rename to analysis-master/tra_analysis/metrics/glicko2.py diff --git a/analysis-master/analysis/metrics/trueskill.py b/analysis-master/tra_analysis/metrics/trueskill.py similarity index 100% rename from analysis-master/analysis/metrics/trueskill.py rename to analysis-master/tra_analysis/metrics/trueskill.py diff --git a/analysis-master/analysis/regression.py b/analysis-master/tra_analysis/regression.py similarity index 100% rename from analysis-master/analysis/regression.py rename to analysis-master/tra_analysis/regression.py diff --git a/analysis-master/analysis/titanlearn.py b/analysis-master/tra_analysis/titanlearn.py similarity index 100% rename from analysis-master/analysis/titanlearn.py rename to analysis-master/tra_analysis/titanlearn.py diff --git a/analysis-master/analysis/visualization.py b/analysis-master/tra_analysis/visualization.py similarity index 100% rename from analysis-master/analysis/visualization.py rename to analysis-master/tra_analysis/visualization.py diff --git a/data-analysis/superscript.py b/data-analysis/superscript.py index 94e2d84a..c6bba2e1 100644 --- a/data-analysis/superscript.py +++ b/data-analysis/superscript.py @@ -1,5 +1,5 @@ # Titan Robotics Team 2022: Superscript Script -# Written by Arthur Lu & Jacob Levine +# Written by Arthur Lu, Jacob Levine, and Dev Singh # Notes: # setup: @@ -7,6 +7,8 @@ __version__ = "0.0.6.002" # changelog should be viewed using print(analysis.__changelog__) __changelog__ = """changelog: + 0.0.6.003: + - rename analysis imports to tra_analysis for PyPI publishing 0.0.6.002: - integrated get_team_rankings.py as get_team_metrics() function - integrated visualize_pit.py as graph_pit_histogram() function @@ -110,7 +112,7 @@ __all__ = [ # imports: -from analysis import analysis as an +from tra_analysis import analysis as an import data as d import json import numpy as np