Unverified Commit 2c6dca76 authored by Vít Novotný's avatar Vít Novotný
Browse files

Add flake8 to continuous integration

parent 8c1ca528
name: Run Python Tests
name: Run Tests
on:
push:
pull_request:
workflow_dispatch:
jobs:
build:
flake8:
name: Check Code Style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: 3.7
- run: |
python -m pip install --upgrade pip
pip install flake8
- run: |
flake8
unit_tests:
name: Run Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
......
from .common import get_topics, get_judged_documents, get_ndcg as ndcg, get_ndcg, get_random_ndcg, get_random_normalized_ndcg, get_judgement
from .common import (
get_topics,
get_judged_documents,
get_ndcg as ndcg,
get_ndcg,
get_random_ndcg,
get_random_normalized_ndcg,
get_judgement,
)
__all__ = [
'get_topics',
'get_judged_documents',
'ndcg',
'get_ndcg',
'get_random_ndcg',
'get_random_normalized_ndcg',
'get_judgement',
]
# -*- coding:utf-8 -*-
from copy import deepcopy
from itertools import chain
from math import log2
import numpy as np
......
[flake8]
max-line-length = 120
from math import log2
import unittest
from arqmath_eval import get_judgement
......
......@@ -55,8 +55,8 @@ class TestGetNDCG(unittest.TestCase):
'1282114': 0.15,
},
'A.31': {
'439044': 1.00,
'692232': 0.50,
'439044': 1.00,
'692232': 0.50,
},
}
ndcg = get_ndcg(parsed_run, 'task1-example', 'test')
......@@ -117,8 +117,8 @@ class TestGetNDCG(unittest.TestCase):
'unjudged_2': 0.05,
},
'A.31': {
'439044': 1.00,
'692232': 0.50,
'439044': 1.00,
'692232': 0.50,
},
}
ndcg = get_ndcg(parsed_run, 'task1-example', 'test')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment