Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Michal Štefánik
ARQMath-eval
Commits
2c6dca76
Unverified
Commit
2c6dca76
authored
Feb 19, 2021
by
Vít Novotný
Browse files
Add flake8 to continuous integration
parent
8c1ca528
Changes
6
Hide whitespace changes
Inline
Side-by-side
.github/workflows/main.yml
View file @
2c6dca76
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
...
...
scripts/__init__.py
View file @
2c6dca76
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'
,
]
scripts/common.py
View file @
2c6dca76
# -*- coding:utf-8 -*-
from
copy
import
deepcopy
from
itertools
import
chain
from
math
import
log2
import
numpy
as
np
...
...
setup.cfg
0 → 100644
View file @
2c6dca76
[flake8]
max-line-length = 120
test/test_get_judgement.py
View file @
2c6dca76
from
math
import
log2
import
unittest
from
arqmath_eval
import
get_judgement
...
...
test/test_get_ndcg.py
View file @
2c6dca76
...
...
@@ -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'
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment