Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay authored and Jay committed Sep 30, 2024
1 parent c8acc25 commit 85a7fea
Show file tree
Hide file tree
Showing 11 changed files with 1,177 additions and 60 deletions.
Binary file added .DS_Store
Binary file not shown.
17 changes: 17 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM mcr.microsoft.com/vscode/devcontainers/universal:2-focal

# Execute files when main is triggered
RUN apt-get update && apt-get -y install --no-install-recommends \
python3.8-venv \
gcc

# Setting up virtual environment
ARG USER="codespace"
ARG VENV_PATH="/home/${USER}/venv"
COPY requirements.txt /tmp/
COPY Makefile /tmp/
# Install packages according to the versions listed in the requirements.txt file
RUN su $USER -c "/usr/bin/python3 -m venv /home/${USER}/venv" \
&& su $USER -c "${VENV_PATH}/bin/pip --disable-pip-version-check --no-cache-dir install -r /tmp/requirements.txt" \
# Removes the requirements.txt file from /tmp/
&& rm -rf /tmp/requirements.txt
89 changes: 68 additions & 21 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,69 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/python
//Set up development environment in Github Codespace
{
"name": "Python 3",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye"

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "pip3 install --user -r requirements.txt",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
"name": "GitHub Codespaces (Default)",
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},
"features": {
"ghcr.io/devcontainers/features/nvidia-cuda:1": {
"installCudnn": true
}
},
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"go.toolsManagement.checkForUpdates": "local",
"go.useLanguageServer": true,
"go.gopath": "/go",
"python.defaultInterpreterPath": "/home/codespace/venv/bin/python",
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.formatting.autopep8Path": "/home/codespace/venv/bin/autopep8",
"python.formatting.blackPath": "/home/codespace/venv/bin/black",
"python.formatting.yapfPath": "/home/codespace/venv/bin/yapf",
"python.linting.banditPath": "/home/codespace/venv/bin/bandit",
"python.linting.flake8Path": "/home/codespace/venv/bin/flake8",
"python.linting.mypyPath": "/home/codespace/venv/bin/mypy",
"python.linting.pycodestylePath": "/home/codespace/venv/bin/pycodestyle",
"python.linting.pydocstylePath": "/home/codespace/venv/bin/pydocstyle",
"python.linting.pylintPath": "/home/codespace/venv/bin/pylint",
"lldb.executable": "/usr/bin/lldb",
"files.watcherExclude": {
"**/target/**": true
}
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"GitHub.vscode-pull-request-github",
"GitHub.copilot-nightly",
"GitHub.copilot-labs",
"ms-azuretools.vscode-docker",
"ms-toolsai.jupyter",
"ms-toolsai.jupyter-keymap",
"ms-toolsai.jupyter-renderers",
"ms-python.vscode-pylance",
"ms-python.python",
"ms-vscode.makefile-tools"
]
}
},
"remoteUser": "codespace",
"overrideCommand": false,
//Docker volumes to be mounted from the Docker
"mounts": [
"source=codespaces-linux-var-lib-docker,target=/var/lib/docker,type=volume"
],
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined",
"--privileged",
"--init"
],
//runs the setup.sh file script
"postCreateCommand": "bash setup.sh"
}
22 changes: 12 additions & 10 deletions .github/workflows/hello.yml → .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Python Application Test with Github Actions
name: Github Actions Matrix Build for Multiple Python Versions

on:
schedule:
- cron: '0 3 * * SUN'
Expand All @@ -10,14 +11,18 @@ on:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7,3.8,3.9,3.11]
os: [ubuntu-latest]
runs-on: ${{matrix.os}}

steps:
- uses: actions/checkout@v3
- name: Setup Python 3.8
uses: actions/setup-python@v1
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: ${{matrix.python-version}}

- name: install packages and dependencies
run: |
Expand All @@ -30,7 +35,4 @@ jobs:
make test
- name: format with black
run: |
make format
- name: deploy the app
run: |
make deploy
make format
Binary file added Goals_Assists_Scatter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Goals_Mean_Hist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[![Python Application Test with Github Actions](https://github.com/jayliu1016/jayliu_ids_de_1/actions/workflows/hello.yml/badge.svg)](https://github.com/jayliu1016/jayliu_ids_de_1/actions/workflows/hello.yml)

# jayliu_ids_de_1
# jayliu_ids_Matrix_Build
python project
It is a template for my future python project.

<img width="1096" alt="Screenshot 2024-09-06 at 12 23 02 PM" src="https://github.com/user-attachments/assets/9c7c03b7-05ef-4086-8668-8181b2c95cb7">
39 changes: 36 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,37 @@
import math
import pandas as pd
import matplotlib.pyplot as plt

def add(x,y):
return math.ceil(x)+math.floor(y)
# Load the player overview dataset
soccer_df = pd.read_csv("player_overview.csv")


# print the head of the dataset to showcase what variables it includes
def print_head():
soccer_head = soccer_df.head()
print(soccer_head)
return soccer_head


# describe the dataset's statistics for all numerical columns
def describe_stat():
# This will include statistics like mean, median, std for all numerical columns
soccer_desc = soccer_df.describe(include=[float, int])
print(soccer_desc)
return soccer_desc


# create a scatter plot of the 'Goals' and 'Assists' columns
def build_scatter_plot():
plt.scatter(soccer_df['Goals'], soccer_df['Assists'], alpha=0.6, color='blue')
plt.xlabel('Goals')
plt.ylabel('Assists')
plt.title('Scatter Plot of Goals vs Assists')
plt.savefig("Goals_Assists_Scatter.png")
plt.show()


# main to execute the functions
if __name__ == "__main__":
print_head()
describe_stat()
build_scatter_plot()
Loading

0 comments on commit 85a7fea

Please sign in to comment.