From 04f126a0b2974e293687497a89f4240aa685c8d8 Mon Sep 17 00:00:00 2001 From: trigaten Date: Thu, 2 Nov 2023 21:57:58 -0400 Subject: [PATCH 01/11] feat: gh --- .github/workflows/gh-pages.yml | 29 +++++++++++++++++++++++++++++ .gitignore | 5 ++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/gh-pages.yml diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml new file mode 100644 index 0000000..9a3d5fb --- /dev/null +++ b/.github/workflows/gh-pages.yml @@ -0,0 +1,29 @@ +name: Deploy +on: + push: + branches: [main, official_docs_site] + +jobs: + docs: + name: Generate Website + runs-on: ubuntu-latest + env: + SPHINX_GITHUB_CHANGELOG_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + + - name: Install dependencies + run: pip install -r requirements.txt && git clone https://github.com/trigaten/Prompt_Systematic_Review.git + + - name: Build + run: sphinx-build -b dirhtml -v docs/ build + + - name: Upload to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./build/ + + permissions: + contents: write \ No newline at end of file diff --git a/.gitignore b/.gitignore index 612f383..c56c1a2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ __pycache__ -*.egg-info/ \ No newline at end of file +*.egg-info +.DS_Store +_build +build \ No newline at end of file From 53fafc8301ceb7baf5e96e8401d2a31d6381be91 Mon Sep 17 00:00:00 2001 From: trigaten Date: Thu, 2 Nov 2023 21:59:41 -0400 Subject: [PATCH 02/11] feat: docs --- docs/Makefile | 24 ++++++++++++++++++ docs/conf.py | 33 +++++++++++++++++++++++++ docs/how_to_research.rst | 41 +++++++++++++++++++++++++++++++ docs/index.rst | 37 ++++++++++++++++++++++++++++ docs/make.bat | 35 ++++++++++++++++++++++++++ docs/prompt_systematic_review.rst | 12 +++++++++ docs/using_github.rst | 22 +++++++++++++++++ docs/using_latex.rst | 16 ++++++++++++ 8 files changed, 220 insertions(+) create mode 100644 docs/Makefile create mode 100644 docs/conf.py create mode 100644 docs/how_to_research.rst create mode 100644 docs/index.rst create mode 100644 docs/make.bat create mode 100644 docs/prompt_systematic_review.rst create mode 100644 docs/using_github.rst create mode 100644 docs/using_latex.rst diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..5f1c6d1 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,24 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +github: + @make html + @cp -a build/html/. ./docs + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..eb5878a --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,33 @@ +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +import renku_sphinx_theme + +project = "Prompt Systematic Review" +copyright = "2023, Schulhoff et al." +author = "Schulhoff et al." +release = "0.0.1" + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [ + "sphinx.ext.autodoc", + "renku_sphinx_theme", +] + +templates_path = ["_templates"] +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + + +html_theme = "renku" +html_static_path = ["_static"] diff --git a/docs/how_to_research.rst b/docs/how_to_research.rst new file mode 100644 index 0000000..d072b34 --- /dev/null +++ b/docs/how_to_research.rst @@ -0,0 +1,41 @@ +========================= +How to Research +========================= + +It can be difficult to know where to start researching a topic, especially as an undergrad with little or no experience. +I had to figure this out a few years, so let me save you some time :) + + +The Beginning +========================= + +At the beginning of the research process, you want to go broad in your subject. For example, if you are researching Gen AI Security, +you might look up "Generative AI Security review" (or overview), "Generative AI Security survey", and similar terms. If you can find +a review paper, great, read it. If not, start with the most relevant paper, read the abstract/conclusion, then jump to *related work*. +Most papers have a related work section; it discusses papers related to that one in the field. + +Use **Google Scholar**/ArXiv/Semantic Scholar + + +How to Read a Paper +========================= +If you need to understand a technique proposed by a paper (rather than just learn broadly about the field), do this: + +I am using the Chain of thought paper as an example: https://arxiv.org/pdf/2201.11903.pdf + +- Read the abstract+conclusion +- Read the description of the proposed method/analysis +- Look at any images (usually exclude graphs) +- Skip related work +- Skip experimental setup +- Skip ablations +- Read the conclusion, and perhaps some discussion + +You will usually only want to read the sections I said to skip if you *really* need to understand the technique (for example, if you are comparing it to other techniques). + +How to keep track of information +================================================== + +Do whatever your project lead suggests. The way I keep track of info is by adding the citation to the Overleaf +bibliography file (read the on Overleaf), then writing comments above it as my notes. I try to just started writing in the regular tex +file as soon as I get a decent understanding of the field. \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..38924f7 --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,37 @@ +.. Prompt Systematic Review documentation master file, created by + sphinx-quickstart on Thu Nov 2 15:25:04 2023. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Documentation for the Systematic Prompt Review Project +==================================================== + +This website contains all the information you need to understand the research process for this project. The first three sections +are about how to do research and use LaTeX/Github. The fourth section is an autogenerated API reference for our codebase. +Make sure to write Sphinx-style docstrings (look this up). + +Quick Info: + +- Github: https://github.com/trigaten/Prompt_Systematic_Review +- Overleaf: DM Sander or sub-team leader +- The plan document: check announcements in slack +- Main contact: sschulh@umd.edu + + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + how_to_research + using_latex + using_github + prompt_systematic_review + + + +.. Indices and tables +.. ================== + +.. * :ref:`genindex` +.. * :ref:`modindex` +.. * :ref:`search` diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..32bb245 --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/docs/prompt_systematic_review.rst b/docs/prompt_systematic_review.rst new file mode 100644 index 0000000..9601e12 --- /dev/null +++ b/docs/prompt_systematic_review.rst @@ -0,0 +1,12 @@ +prompt_systematic_review +======== + +.. automodule:: prompt_systematic_review.arxiv_source + :members: + + +.. automodule:: prompt_systematic_review.paperSource + :members: + +.. automodule:: prompt_systematic_review.utils + :members: \ No newline at end of file diff --git a/docs/using_github.rst b/docs/using_github.rst new file mode 100644 index 0000000..3ed8926 --- /dev/null +++ b/docs/using_github.rst @@ -0,0 +1,22 @@ +========================= +Using Git/Github +========================= + +Git and Github are important tools for collaborative coding projects. Here's a basic guide: + +1. **Git Basics**: Git is a version control system that helps you track changes in your code. You need to have Git installed on your computer. Learn a few commands like `git clone` (to get a copy of the project), `git pull` (to get the latest changes), `git push` (to share your changes), and `git commit` (to save your work). + +2. **Github**: Github is a platform where we store our code, which is based on Git. + +3. **Cloning a Repository**: To start working on a project, use `git clone https://github.com/trigaten/Prompt_Systematic_Review.git` to bring the project to your computer. + +4. **Branches and Pull Requests**: When you want to change something in the project, create a "branch." It's like creating a separate workspace for your ideas. After you're done, you can ask others to review your work by making a "pull request." It's like getting feedback from others before your changes become part of the main project. + +5. **Commit Messages**: When you make changes, write clear and simple messages about what you did. Use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). + +If you have any questions, feel free to ask me or your sub-team leader. + +For more help, you can check out the Github Help website: [Github Quickstart](https://docs.github.com/en/get-started/quickstart/hello-world). + +Note that our Github repo has a CI pipeline, which automatically runs tests, style checks, and more when you request you merge new code. +This helps ensure that broken code does not get merged in. \ No newline at end of file diff --git a/docs/using_latex.rst b/docs/using_latex.rst new file mode 100644 index 0000000..fc32b58 --- /dev/null +++ b/docs/using_latex.rst @@ -0,0 +1,16 @@ +========================= +Using LaTeX +========================= + +LaTeX is a typesetting language commonly used for creating documents with complex formatting, such as research papers +and scientific articles. For our collaborative document editing, we will be using Overleaf, an online LaTeX editor that +allows multiple people to work on a document simultaneously. If you need access to the LaTeX repository for our project, +please don't hesitate to reach out to me or your sub team lead. + +Here are some basic formatting tips with LaTeX: + +1. **Section Headings**: You can create section headings using LaTeX by starting a line with a series of `#` symbols. The number of `#` symbols determines the section level. For example, `#` is a top-level section, `##` is a subsection, and so on. + +2. **Italics and Bold**: To make text italic, you can use `\textit{}` and to make text bold, you can use `\textbf{}`. For example, `\textit{italic text}` and `\textbf{bold text}`. + +Learn more here: [Link to LaTeX Documentation](https://www.overleaf.com/learn) From 5d789030844572eb26e14c423cf76a601e0388a6 Mon Sep 17 00:00:00 2001 From: trigaten Date: Thu, 2 Nov 2023 23:20:46 -0400 Subject: [PATCH 03/11] fix: remove -e --- requirements.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 0b62b1f..cf5f1d5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,5 +6,4 @@ datasets huggingface_hub pytest jellyfish -black --e . \ No newline at end of file +black \ No newline at end of file From 8b37132be90a8ab40afe98245d9e0d57495b42b8 Mon Sep 17 00:00:00 2001 From: trigaten Date: Thu, 2 Nov 2023 23:22:27 -0400 Subject: [PATCH 04/11] feat: aiohttp version --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index cf5f1d5..9277d37 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,4 +6,5 @@ datasets huggingface_hub pytest jellyfish -black \ No newline at end of file +black +aiohttp==3.8.2 \ No newline at end of file From aa7b4fdda2501bedad7232cdb5c085fca933ec59 Mon Sep 17 00:00:00 2001 From: trigaten Date: Fri, 3 Nov 2023 13:50:33 -0400 Subject: [PATCH 05/11] feat: add -e --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 9277d37..275a61c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,4 +7,5 @@ huggingface_hub pytest jellyfish black -aiohttp==3.8.2 \ No newline at end of file +aiohttp==3.8.2 +-e \ No newline at end of file From e00f02b286d590d38d513bdedd2d4f055ef0c528 Mon Sep 17 00:00:00 2001 From: trigaten Date: Fri, 3 Nov 2023 13:54:01 -0400 Subject: [PATCH 06/11] fix: -e . --- requirements.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 275a61c..2809e03 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,5 +7,8 @@ huggingface_hub pytest jellyfish black +sphinx +renku-sphinx-theme +sphinx-autobuild aiohttp==3.8.2 --e \ No newline at end of file +-e . \ No newline at end of file From a9787f793e8364e498c62d7d6a8c2babd8487460 Mon Sep 17 00:00:00 2001 From: trigaten Date: Fri, 3 Nov 2023 14:09:21 -0400 Subject: [PATCH 07/11] docs(fix): title = length --- docs/index.rst | 2 +- docs/prompt_systematic_review.rst | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 38924f7..478b981 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -4,7 +4,7 @@ contain the root `toctree` directive. Documentation for the Systematic Prompt Review Project -==================================================== +======================================================================================================== This website contains all the information you need to understand the research process for this project. The first three sections are about how to do research and use LaTeX/Github. The fourth section is an autogenerated API reference for our codebase. diff --git a/docs/prompt_systematic_review.rst b/docs/prompt_systematic_review.rst index 9601e12..ba95a3a 100644 --- a/docs/prompt_systematic_review.rst +++ b/docs/prompt_systematic_review.rst @@ -1,6 +1,5 @@ prompt_systematic_review -======== - +==================================================== .. automodule:: prompt_systematic_review.arxiv_source :members: From 3623ccdfa16791c7eeb745fd3dbcb05af750d6b7 Mon Sep 17 00:00:00 2001 From: trigaten Date: Fri, 3 Nov 2023 14:11:09 -0400 Subject: [PATCH 08/11] fix(temp): update requirements --- .github/workflows/gh-pages.yml | 4 +++- requirements.txt | 4 ---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 9a3d5fb..f5efde4 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -14,7 +14,9 @@ jobs: - uses: actions/setup-python@v2 - name: Install dependencies - run: pip install -r requirements.txt && git clone https://github.com/trigaten/Prompt_Systematic_Review.git + run: | + pip install -r requirements.txt + git clone https://github.com/trigaten/Prompt_Systematic_Review.git - name: Build run: sphinx-build -b dirhtml -v docs/ build diff --git a/requirements.txt b/requirements.txt index 2809e03..0b62b1f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,8 +7,4 @@ huggingface_hub pytest jellyfish black -sphinx -renku-sphinx-theme -sphinx-autobuild -aiohttp==3.8.2 -e . \ No newline at end of file From bb3a1da31147beb9ee9b28bc648ca23522136638 Mon Sep 17 00:00:00 2001 From: trigaten Date: Fri, 3 Nov 2023 14:16:13 -0400 Subject: [PATCH 09/11] fix: workflow python versions+pip --- .github/workflows/gh-pages.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index f5efde4..a7b6a5a 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -7,14 +7,19 @@ jobs: docs: name: Generate Website runs-on: ubuntu-latest + env: SPHINX_GITHUB_CHANGELOG_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + with: + python-version: 3.10 - name: Install dependencies run: | + python -m pip install --upgrade pip pip install -r requirements.txt git clone https://github.com/trigaten/Prompt_Systematic_Review.git From c5044dcd7b5fbea36afa1880d9487e885ec087e8 Mon Sep 17 00:00:00 2001 From: trigaten Date: Fri, 3 Nov 2023 14:19:26 -0400 Subject: [PATCH 10/11] fix: python version --- .github/workflows/gh-pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index a7b6a5a..3e85b05 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v3 with: - python-version: 3.10 + python-version: "3.10" - name: Install dependencies run: | From f27dfe8c71aa5feef338571d0c5c3af705206e47 Mon Sep 17 00:00:00 2001 From: trigaten Date: Fri, 3 Nov 2023 14:21:18 -0400 Subject: [PATCH 11/11] feat: sphinx --- requirements.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/requirements.txt b/requirements.txt index 0b62b1f..e4c9c6e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,4 +7,7 @@ huggingface_hub pytest jellyfish black +sphinx +renku-sphinx-theme +sphinx-autobuild -e . \ No newline at end of file