From 03a4f5b72dee2939e89556fbc7749c0f6ae1fa89 Mon Sep 17 00:00:00 2001 From: Ryan Layer Date: Tue, 4 Oct 2022 10:56:32 -0600 Subject: [PATCH 1/7] Create unit_tests.yml --- .github/workflows/unit_tests.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/unit_tests.yml diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml new file mode 100644 index 0000000..a894579 --- /dev/null +++ b/.github/workflows/unit_tests.yml @@ -0,0 +1,16 @@ +name: Unit tests + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + unit_tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: | + cd test/unit + python -m unittest test_utils From bdae0eae6b98657913c7b49f2158a6f262b6b574 Mon Sep 17 00:00:00 2001 From: Ryan Layer Date: Tue, 4 Oct 2022 10:58:47 -0600 Subject: [PATCH 2/7] Update unit_tests.yml --- .github/workflows/unit_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index a894579..a4895b0 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -12,5 +12,5 @@ jobs: steps: - uses: actions/checkout@v2 - run: | - cd test/unit - python -m unittest test_utils + cd test/unit + python -m unittest test_utils From f095ea091bab446c6586a8d183fca128fedc093a Mon Sep 17 00:00:00 2001 From: Ryan Layer Date: Tue, 4 Oct 2022 11:06:49 -0600 Subject: [PATCH 3/7] Update unit_tests.yml --- .github/workflows/unit_tests.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index a4895b0..6bd00ff 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -7,6 +7,12 @@ on: branches: [main] jobs: + code_style: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: pycodestyle $(git ls-files "*.py") + unit_tests: runs-on: ubuntu-latest steps: From 75c363348b50e3a14d8ee2bc2abc3350d6dcc4f9 Mon Sep 17 00:00:00 2001 From: Ryan Layer Date: Tue, 4 Oct 2022 17:12:52 +0000 Subject: [PATCH 4/7] add conda env --- environment.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 environment.yml diff --git a/environment.yml b/environment.yml new file mode 100644 index 0000000..16abbdc --- /dev/null +++ b/environment.yml @@ -0,0 +1,28 @@ +name: swe4s +channels: + - conda-forge +dependencies: + - _libgcc_mutex=0.1=conda_forge + - _openmp_mutex=4.5=2_gnu + - bzip2=1.0.8=h7f98852_4 + - ca-certificates=2022.9.24=ha878542_0 + - ld_impl_linux-64=2.36.1=hea4e1c9_2 + - libffi=3.4.2=h7f98852_5 + - libgcc-ng=12.1.0=h8d9b700_16 + - libgomp=12.1.0=h8d9b700_16 + - libnsl=2.0.0=h7f98852_0 + - libsqlite=3.39.4=h753d276_0 + - libuuid=2.32.1=h7f98852_1000 + - libzlib=1.2.12=h166bdaf_4 + - ncurses=6.3=h27087fc_1 + - openssl=3.0.5=h166bdaf_2 + - pip=22.2.2=pyhd8ed1ab_0 + - pycodestyle=2.9.1=pyhd8ed1ab_0 + - python=3.10.6=ha86cf86_0_cpython + - readline=8.1.2=h0f457ee_0 + - setuptools=65.4.1=pyhd8ed1ab_0 + - tk=8.6.12=h27826a3_0 + - tzdata=2022d=h191b570_0 + - wheel=0.37.1=pyhd8ed1ab_0 + - xz=5.2.6=h166bdaf_0 +prefix: /home/jovyan/.conda/envs/swe4s From f51322850ab982d72cf73acbc066572e741cef56 Mon Sep 17 00:00:00 2001 From: Ryan Layer Date: Tue, 4 Oct 2022 11:16:20 -0600 Subject: [PATCH 5/7] Update unit_tests.yml --- .github/workflows/unit_tests.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 6bd00ff..7f4e7e4 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -11,6 +11,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: swe4s + environment-file: environment.yml - run: pycodestyle $(git ls-files "*.py") unit_tests: From f459051addf98da18e83d15e133df6a421fd30bd Mon Sep 17 00:00:00 2001 From: Ryan Layer Date: Tue, 4 Oct 2022 14:35:21 -0600 Subject: [PATCH 6/7] Update unit_tests.yml --- .github/workflows/unit_tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 7f4e7e4..75dd804 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -9,6 +9,9 @@ on: jobs: code_style: runs-on: ubuntu-latest + defaults: + run: + shell: bash -l {0} steps: - uses: actions/checkout@v2 - uses: conda-incubator/setup-miniconda@v2 From 5f06280d21d1303d2a8b3c1c113115738db26370 Mon Sep 17 00:00:00 2001 From: Ryan Layer Date: Thu, 6 Oct 2022 16:20:20 +0000 Subject: [PATCH 7/7] fix style issues --- search.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/search.py b/search.py index ebf90d7..716d040 100644 --- a/search.py +++ b/search.py @@ -32,8 +32,8 @@ def main(): linear_search_total_time += toc - tic linear_search_mean_time = linear_search_total_time / args.num_searches - print('Linear search: ' \ - + '{:.5f}'.format(linear_search_mean_time) \ + print('Linear search: ' + + '{:.5f}'.format(linear_search_mean_time) + ' seconds') tic = time.perf_counter() @@ -42,8 +42,8 @@ def main(): bsearch_idx_time = toc - tic - print('Indexing: ' \ - + '{:.5f}'.format(bsearch_idx_time) \ + print('Indexing: ' + + '{:.5f}'.format(bsearch_idx_time) + ' seconds') bsearch_total_time = 0 @@ -55,11 +55,10 @@ def main(): bsearch_total_time += toc - tic bsearch_mean_time = bsearch_total_time / args.num_searches - print('Binary search: ' \ - + '{:.5f}'.format(bsearch_mean_time) \ + print('Binary search: ' + + '{:.5f}'.format(bsearch_mean_time) + ' seconds') - if __name__ == '__main__': main()