From e41fe73786793e76b20192917a2b2bca429f1c56 Mon Sep 17 00:00:00 2001 From: Michael Ilie Date: Thu, 26 Oct 2023 13:37:12 -0400 Subject: [PATCH 1/5] add CI/Testing support --- LICENSE.txt | 21 +++++++++++ MANIFEST.in | 9 +++++ .../search_pe_papers.ipynb | 0 requirements.txt | 5 +++ setup.cfg | 35 +++++++++++++++++++ setup.py | 3 ++ .../prompt_systematic_review/__init__.py | 0 .../data}/blacklist.csv | 0 .../data}/prompt_engineering_arxiv.csv | 0 .../data/prompt_engineering_reviewed.csv | 0 .../prompt_systematic_review/keywords.py | 0 .../prompt_systematic_review/utils.py | 4 +-- tests/__init__.py | 0 tests/test_utils.py | 6 ++++ 14 files changed, 81 insertions(+), 2 deletions(-) create mode 100644 LICENSE.txt create mode 100644 MANIFEST.in rename search_pe_papers.ipynb => examples/search_pe_papers.ipynb (100%) create mode 100644 requirements.txt create mode 100644 setup.cfg create mode 100644 setup.py rename data/prompt_engineering_reviewed.csv => src/prompt_systematic_review/__init__.py (100%) rename {data => src/prompt_systematic_review/data}/blacklist.csv (100%) rename {data => src/prompt_systematic_review/data}/prompt_engineering_arxiv.csv (100%) create mode 100644 src/prompt_systematic_review/data/prompt_engineering_reviewed.csv rename keywords.py => src/prompt_systematic_review/keywords.py (100%) rename utils.py => src/prompt_systematic_review/utils.py (78%) create mode 100644 tests/__init__.py create mode 100644 tests/test_utils.py diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..10944da --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Sander Schulhoff + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..f0b8a72 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,9 @@ +include setup.py +include MANIFEST.in +include LICENSE +include README.md + +graft tests +graft examples +graft docs +graft src \ No newline at end of file diff --git a/search_pe_papers.ipynb b/examples/search_pe_papers.ipynb similarity index 100% rename from search_pe_papers.ipynb rename to examples/search_pe_papers.ipynb diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..f6687e1 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,5 @@ +numpy +pandas +requests +matplotlib +-e . \ No newline at end of file diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..27c3bd9 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,35 @@ +# FILEPATH: setup.cfg + +[metadata] +name = prompt_systematic_review +version = 0.1.0 +author = trigaten +author_email = sanderschulhoff@gmail.com +description = a systematic review of prompting +long_description = file: README.md +long_description_content_type = text/markdown +url = https://github.com/trigaten/Prompt_Systematic_Review/ +license = MIT +classifiers= + Development Status :: 1 - Planning + Environment :: Console + Intended Audience :: Science/Research + Natural Language :: English + Programming Language :: Python :: 3 + Topic :: Scientific/Engineering :: Artificial Intelligence + Topic :: Scientific/Engineering :: Information Analysis + + +[options] +packages = find: +package_dir = + =src +include_package_data = True +install_requires = + numpy + pandas + requests + matplotlib + +[options.packages.find] +where=src diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..fc1f76c --- /dev/null +++ b/setup.py @@ -0,0 +1,3 @@ +from setuptools import setup + +setup() \ No newline at end of file diff --git a/data/prompt_engineering_reviewed.csv b/src/prompt_systematic_review/__init__.py similarity index 100% rename from data/prompt_engineering_reviewed.csv rename to src/prompt_systematic_review/__init__.py diff --git a/data/blacklist.csv b/src/prompt_systematic_review/data/blacklist.csv similarity index 100% rename from data/blacklist.csv rename to src/prompt_systematic_review/data/blacklist.csv diff --git a/data/prompt_engineering_arxiv.csv b/src/prompt_systematic_review/data/prompt_engineering_arxiv.csv similarity index 100% rename from data/prompt_engineering_arxiv.csv rename to src/prompt_systematic_review/data/prompt_engineering_arxiv.csv diff --git a/src/prompt_systematic_review/data/prompt_engineering_reviewed.csv b/src/prompt_systematic_review/data/prompt_engineering_reviewed.csv new file mode 100644 index 0000000..e69de29 diff --git a/keywords.py b/src/prompt_systematic_review/keywords.py similarity index 100% rename from keywords.py rename to src/prompt_systematic_review/keywords.py diff --git a/utils.py b/src/prompt_systematic_review/utils.py similarity index 78% rename from utils.py rename to src/prompt_systematic_review/utils.py index c077422..3057002 100644 --- a/utils.py +++ b/src/prompt_systematic_review/utils.py @@ -1,8 +1,8 @@ import requests from xml.etree import ElementTree as ET -def search_arxiv(keyword): - url = f"http://export.arxiv.org/api/query?search_query=all:{keyword}&start=0&max_results=10000" +def search_arxiv(keyword,max_results=10000): + url = f"http://export.arxiv.org/api/query?search_query=all:{keyword}&start=0&max_results={max_results}" data = requests.get(url).content return data diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_utils.py b/tests/test_utils.py new file mode 100644 index 0000000..0a83501 --- /dev/null +++ b/tests/test_utils.py @@ -0,0 +1,6 @@ +# test_utils.py +import pytest +from src.prompt_systematic_review.utils import add, subtract + +def test_assert(): + assert True \ No newline at end of file From a98870269e639580257df13bbf820258459dc9be Mon Sep 17 00:00:00 2001 From: Michael Ilie Date: Thu, 26 Oct 2023 13:42:21 -0400 Subject: [PATCH 2/5] fixed test_utils.py --- tests/test_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_utils.py b/tests/test_utils.py index 0a83501..2b95a97 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,6 +1,6 @@ # test_utils.py import pytest -from src.prompt_systematic_review.utils import add, subtract +from prompt_systematic_review.utils import add, subtract def test_assert(): assert True \ No newline at end of file From a5029afae5b9bccd63472bf585d3a7179466ad28 Mon Sep 17 00:00:00 2001 From: Michael Ilie Date: Thu, 26 Oct 2023 13:43:40 -0400 Subject: [PATCH 3/5] fixed dumb typo --- tests/test_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_utils.py b/tests/test_utils.py index 2b95a97..88ff72c 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,6 +1,6 @@ # test_utils.py import pytest -from prompt_systematic_review.utils import add, subtract +from prompt_systematic_review.utils import * def test_assert(): assert True \ No newline at end of file From 9e0c2c8f041009a3b21dee444f62b9e279eee5f3 Mon Sep 17 00:00:00 2001 From: Michael Ilie Date: Thu, 26 Oct 2023 13:53:35 -0400 Subject: [PATCH 4/5] added tests for search_arxiv and count_articles --- tests/test_utils.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/test_utils.py b/tests/test_utils.py index 88ff72c..5195fd3 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,6 +1,11 @@ # test_utils.py import pytest -from prompt_systematic_review.utils import * +from prompt_systematic_review.utils import search_arxiv, count_articles -def test_assert(): - assert True \ No newline at end of file +def test_search_arxiv(): + data = search_arxiv("covid",max_results=10) + assert len(data) > 0 + +def test_count_articles(): + data = search_arxiv("covid",max_results=10) + assert count_articles(data) == 10 \ No newline at end of file From 57ba017bfef045e38265ec91823c630a6b5e5f69 Mon Sep 17 00:00:00 2001 From: Michael Ilie Date: Thu, 26 Oct 2023 14:59:17 -0400 Subject: [PATCH 5/5] move data to project root --- {src/prompt_systematic_review/data => data}/blacklist.csv | 0 .../data => data}/prompt_engineering_arxiv.csv | 0 .../data => data}/prompt_engineering_reviewed.csv | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename {src/prompt_systematic_review/data => data}/blacklist.csv (100%) rename {src/prompt_systematic_review/data => data}/prompt_engineering_arxiv.csv (100%) rename {src/prompt_systematic_review/data => data}/prompt_engineering_reviewed.csv (100%) diff --git a/src/prompt_systematic_review/data/blacklist.csv b/data/blacklist.csv similarity index 100% rename from src/prompt_systematic_review/data/blacklist.csv rename to data/blacklist.csv diff --git a/src/prompt_systematic_review/data/prompt_engineering_arxiv.csv b/data/prompt_engineering_arxiv.csv similarity index 100% rename from src/prompt_systematic_review/data/prompt_engineering_arxiv.csv rename to data/prompt_engineering_arxiv.csv diff --git a/src/prompt_systematic_review/data/prompt_engineering_reviewed.csv b/data/prompt_engineering_reviewed.csv similarity index 100% rename from src/prompt_systematic_review/data/prompt_engineering_reviewed.csv rename to data/prompt_engineering_reviewed.csv