Skip to content

Commit

Permalink
Lint threshold (#9)
Browse files Browse the repository at this point in the history
* threshold

* lint combine

* lint fixed with threshold?

* lint

* above 7 now

* minor error changes
  • Loading branch information
andrewchang03 authored Mar 25, 2023
1 parent 8b37547 commit 5bbc0ed
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 19 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@ jobs:
pip install pylint
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py' | grep -v 'model/yolov5')
pylint $(git ls-files '*.py' | grep -v 'model/yolov5') \
--disable C0116 \
--disable E1101 \
--fail-under 7.0
16 changes: 8 additions & 8 deletions api/gcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,32 @@ def change_bucket(bucket_name):
try:
global bucket
bucket = storage_client.get_bucket(bucket_name)
except Exception as e:
print(e)
except Exception as error:
print(error)


def upload_to_bucket(blob_name, file_path):
"""Upload through file path"""
try:
blob = bucket.blob(blob_name)
blob.upload_from_filename(file_path)
except Exception as e:
print(e)
except Exception as error:
print(error)


def upload_file_to_bucket(blob_name, file):
"""Upload through file name"""
try:
blob = bucket.blob(blob_name)
blob.upload_from_file(file)
except Exception as e:
print(e)
except Exception as error:
print(error)


def download_from_bucket(blob_name, file_path):
"""Download to file path"""
try:
blob = bucket.blob(blob_name)
blob.download_to_filename(file_path)
except Exception as e:
print(e)
except Exception as error:
print(error)
5 changes: 0 additions & 5 deletions setup.sh

This file was deleted.

4 changes: 2 additions & 2 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ def load_config(path):
"""
Loads the config yaml file to read in parameters and settings.
"""
with open(path, 'r') as f:
config = yaml.safe_load(f)
with open(path, 'r') as file:
config = yaml.safe_load(file)
return config


Expand Down
5 changes: 2 additions & 3 deletions src/statrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
from stats import statistics

def load_config(path):
with open(path, 'r') as f:
config = yaml.safe_load(f)
with open(path, 'r') as file:
config = yaml.safe_load(file)
return config


def run_statistics(video_path):
statistics.load_video(video_path)

0 comments on commit 5bbc0ed

Please sign in to comment.