diff --git a/.github/ISSUE_TEMPLATES/research_request.md b/.github/ISSUE_TEMPLATES/research_request.md new file mode 100644 index 0000000..717b651 --- /dev/null +++ b/.github/ISSUE_TEMPLATES/research_request.md @@ -0,0 +1,24 @@ +--- +name: Research Request +about: Use this template for to track a requests we receive. +title: Research Request- [Summary] +labels: 'research request' +assignees: '' +--- + +# Research Request + +Complete this issue to detail any research requests we recieve from internal or external partners. This issue is best for describing what type of work will be done. This research request can be followed up by one or more Research Tasks. + +## Project Description +* **Relevant PRs or Reserach Requests** (if applicable): + +* **Question or Goal**: overarching goal of this issue + +* **Data Required**: + * Currently have: + * Need: + +* **Research Required**: + +* **Expected Outputs / Findings**: what do you hope to have created when this is complete? diff --git a/.github/ISSUE_TEMPLATES/research_task b/.github/ISSUE_TEMPLATES/research_task.md similarity index 62% rename from .github/ISSUE_TEMPLATES/research_task rename to .github/ISSUE_TEMPLATES/research_task.md index 393650a..edf8bd9 100644 --- a/.github/ISSUE_TEMPLATES/research_task +++ b/.github/ISSUE_TEMPLATES/research_task.md @@ -1,26 +1,26 @@ --- -name: Research Request +name: Research Task about: Use this template for work that is either stand alone or a part of a bigger project. -title: Research Request- [Summary] -labels: 'research request' +title: Research Task- [Summary] +labels: 'research task' assignees: '' --- -# Research Request +# Research Task Complete this issue to track work that is either stand alone or a smaller part of a bigger project. ## Project Description * **Relevant PR** (if applicable): -* **Question or Goal**: overarching goal of this issue +* **Question or Goal**: what does this task aim to address? * **Data Required**: * Currently have: * Need: -* **Research Required**: +* **Tasks Required**: -* **Metrics**: what specific calculations are you looking to find? +* **Metrics**: what, if any, specific calculations are you looking to find? * **Expected Outputs / Findings**: what do you hope to have created when this is complete? diff --git a/.github/workflows/nbviewer.yml b/.github/workflows/nbviewer.yml new file mode 100644 index 0000000..b2ac2ab --- /dev/null +++ b/.github/workflows/nbviewer.yml @@ -0,0 +1,44 @@ +name: Generate nbviewer links + +on: + pull_request: + types: + - opened + - edited + paths: + - "**.ipynb" + +jobs: + nbviewer-links: + runs-on: ubuntu-latest + steps: + - name: checkout repo + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: get files + id: files + uses: jitterbit/get-changed-files@v1 + continue-on-error: true + + - name: add comments + uses: actions/github-script@v3 + env: + FILES: ${{steps.files.outputs.all}} + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + const body = process.env.FILES + .split(" ") + .filter(f => (f.endsWith(".ipynb") && !f.startsWith("portfolio/"))) + .map(f => `* [${f}](https://nbviewer.jupyter.org/github/${context.repo.owner}/${context.repo.repo}/blob/${context.sha}/${f})`) + + if (body.length > 0) { + github.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: "nbviewer URLs for impacted notebooks:\n\n" + body.join("\n") + }) + } diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..c2f7e71 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,14 @@ +name: pre-commit + +on: + pull_request: + push: + branches: [main] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v3.0.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5955d0d..f9428d8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,15 +1,32 @@ +files: _shared_utils repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.4.0 hooks: - - id: check-added-large-files - - id: end-of-file-fixer - - id: mixed-line-ending - - id: requirements-txt-fixer - id: trailing-whitespace - args: [--markdown-linebreak-ext=md] - - - repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.37.0 + - id: end-of-file-fixer + - id: check-yaml + args: ["--unsafe"] + - id: check-added-large-files + - repo: https://github.com/pycqa/flake8 + rev: 6.0.0 + hooks: + - id: flake8 + args: ["--ignore=E501,W503,F403,F405,E711,E712,E231,E702"] + # E711: comparison to None should be 'if cond is not None:' (siuba filtering requires we use != None and not is not) + # E712: line too long and line before binary operator (black is ok with these), assign lambda expression OK, comparison to True with is (siuba uses ==) + # E231: missing whitespace after colon (we don't want white space when setting gs://) + # E702: multiple statements on one line (semicolon) + types: + - python + files: _shared_utils + - repo: https://github.com/psf/black + rev: 23.1.0 + hooks: + - id: black + args: ["--line-length", "120"] + - repo: https://github.com/pycqa/isort + rev: 5.12.0 hooks: - - id: markdownlint + - id: isort + args: ["--profile", "black", "--filter-files"]