diff --git a/.github/workflows/publish-analysis.yml b/.github/workflows/publish-analysis.yml new file mode 100644 index 00000000..effc4675 --- /dev/null +++ b/.github/workflows/publish-analysis.yml @@ -0,0 +1,36 @@ +# 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: + release: + types: [published, edited] +jobs: + deploy: + + runs-on: ubuntu-latest + + env: + working-directory: ./analysis-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 fc47881e..da8e601a 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,9 @@ analysis-master/__pycache__/ analysis-master/.pytest_cache/ data-analysis/.pytest_cache/ data-analysis/test.py +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/MAINTAINERS b/MAINTAINERS index 5454bc96..a8923f71 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1,3 +1,3 @@ Arthur Lu Jacob Levine -Dev Singh \ No newline at end of file +Dev Singh \ No newline at end of file diff --git a/analysis-master/setup.py b/analysis-master/setup.py index 64dfdc44..ca9af33c 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.12", + name="tra_analysis", + version="2.0.3", 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/tra_analysis/analysis.py b/analysis-master/tra_analysis/analysis.py index 2383d152..b62594d6 100644 --- a/analysis-master/tra_analysis/analysis.py +++ b/analysis-master/tra_analysis/analysis.py @@ -1,7 +1,7 @@ # 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 @@ -74,17 +74,17 @@ __changelog__ = """changelog: - added StatisticalTests class - added several correlation tests to CorrelationTests - added several statistical tests to StatisticalTests - 13.9: + 1.13.9: - moved elo, glicko2, trueskill functions under class Metrics - 13.8: + 1.13.8: - moved Glicko2 to a seperate package - 13.7: + 1.13.7: - fixed bug with trueskill - 13.6: + 1.13.6: - cleaned up imports - 13.5: + 1.13.5: - cleaned up package - 13.4: + 1.13.4: - small fixes to regression to improve performance 1.13.3: - filtered nans from regression diff --git a/data-analysis/superscript.py b/data-analysis/superscript.py index f820a37c..05d3e809 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: @@ -110,7 +110,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