Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera ready code #2

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/check_run_scripts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

rm filechk_results.txt

declare -a FilesArray=("requirements.txt" "run_experiment.sh")

for val in ${FilesArray[@]};
do
echo "Checking presence of $val"
if test -f "$val";
then
echo "$val exists" >> filechk_results.txt
else
echo "$val does not exist" >> filechk_results.txt
fi
done
52 changes: 52 additions & 0 deletions .github/workflows/cloc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Count Lines of Code

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on: [pull_request]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:

# This workflow contains a single job called "build"
cloc:

# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout repo
uses: actions/checkout@v3

# Runs djdefi/cloc-action
- name: Install and run cloc
run: |
sudo apt-get install cloc
cloc src --csv --quiet --report-file=cloc_report.csv

- name: Read CSV
id: csv
uses: juliangruber/read-file-action@v1
with:
path: ./cloc_report.csv

- name: Create MD
uses: petems/csv-to-md-table-action@master
id: csv-table-output
with:
csvinput: ${{ steps.csv.outputs.content }}

- name: Write file
uses: "DamianReeves/write-file-action@master"
with:
path: ./cloc_report.md
write-mode: overwrite
contents: |
${{steps.csv-table-output.outputs.markdown-table}}

- name: PR comment with file
uses: thollander/actions-comment-pull-request@v2
with:
filePath: ./cloc_report.md
24 changes: 24 additions & 0 deletions .github/workflows/filechk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Checks if files are present

on: [pull_request]

jobs:

# This workflow contains a single job called "test"
check_files:

runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Check files script
run: |
chmod +x ./.github/check_run_scripts.sh
./.github/check_run_scripts.sh

- name: PR comment with file
uses: thollander/actions-comment-pull-request@v2
with:
filePath: ./filechk_results.txt
25 changes: 25 additions & 0 deletions .github/workflows/pylinter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Checks python code for linting

on: [pull_request]

jobs:

# This workflow contains a single job called "test"
check_pylint:

runs-on: ubuntu-latest

steps:
# - name: Checkout repo
# uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Python Linter
uses: sunnysid3up/python-linter@master
with:
source: "src"
mypy-options: "--ignore-missing-imports --show-error-codes"
#pylint-options: "--rcfile=setup.cfg"
isort-options: "-w 100"
django: true
#- name: GitHub Action for pylint
# uses: marian-code/python-lint-annotate@v3
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ scikit_learn==1.0.1
scipy==1.12.0
statsmodels==0.13.2
torch==2.0.0
tqdm==4.66.2
tqdm==4.66.2
1 change: 1 addition & 0 deletions run_experiment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python -m experiments.particle_exp
6 changes: 6 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from setuptools import find_packages, setup

setup(
name='CopulaCPTS',
packages=find_packages(),
)
2 changes: 1 addition & 1 deletion covid_exp.py → src/experiments/covid_exp.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import torch
from sklearn.preprocessing import StandardScaler
import matplotlib.pyplot as plt
from models import rnn, lstm, bjrnn, cfrnn, copulaCPTS, dplstm, vanila_copula
from src.models import rnn, lstm, bjrnn, cfrnn, copulaCPTS, dplstm, vanila_copula

class COVIDDataset(torch.utils.data.Dataset):
def __init__(self, X, Y, sequence_lengths):
Expand Down
2 changes: 1 addition & 1 deletion drone_exp.py → src/experiments/drone_exp.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pandas as pd
import torch
import pickle
from models import rnn, lstm, bjrnn, cfrnn, copulaCPTS, dplstm, vanila_copula
from src.models import rnn, lstm, bjrnn, cfrnn, copulaCPTS, dplstm, vanila_copula


datapath = '../../robotics_project/PythonRobotics/AerialNavigation/drone_3d_trajectory_following/data/dataset_smallnoise.npy'
Expand Down
2 changes: 1 addition & 1 deletion particle_exp.py → src/experiments/particle_exp.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import os


from models import rnn, lstm, bjrnn, cfrnn, copulaCPTS, dplstm
from src.models import rnn, lstm, bjrnn, cfrnn, copulaCPTS, dplstm

def experiment(train, valid, test, name='exp'):
rnn_model = rnn.rnn(embedding_size=24, input_size=2, output_size=2, horizon=24)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.