From 3489e18a48afe6d690d990ab53931ce711483547 Mon Sep 17 00:00:00 2001 From: Amberg Date: Tue, 25 Jun 2024 16:30:20 -0700 Subject: [PATCH 1/5] add notebookviewer --- .github/workflows/nbviewer.yml | 44 ++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/nbviewer.yml 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") + }) + } From 42a9bc7b0ad81d3ac2058c55cad2d2f0489c37de Mon Sep 17 00:00:00 2001 From: Amberg Date: Tue, 25 Jun 2024 16:36:23 -0700 Subject: [PATCH 2/5] rename issue --- .github/ISSUE_TEMPLATES/{research_task => research_request} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/ISSUE_TEMPLATES/{research_task => research_request} (100%) diff --git a/.github/ISSUE_TEMPLATES/research_task b/.github/ISSUE_TEMPLATES/research_request similarity index 100% rename from .github/ISSUE_TEMPLATES/research_task rename to .github/ISSUE_TEMPLATES/research_request From aaacfb9fc56ef7751ea82df1666c7df81dcc7113 Mon Sep 17 00:00:00 2001 From: Amberg Date: Tue, 25 Jun 2024 16:43:38 -0700 Subject: [PATCH 3/5] add new issue --- .github/ISSUE_TEMPLATES/research_request.md | 24 +++++++++++++++++++ .../{research_request => research_task.md} | 14 +++++------ 2 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 .github/ISSUE_TEMPLATES/research_request.md rename .github/ISSUE_TEMPLATES/{research_request => research_task.md} (62%) 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_request b/.github/ISSUE_TEMPLATES/research_task.md similarity index 62% rename from .github/ISSUE_TEMPLATES/research_request rename to .github/ISSUE_TEMPLATES/research_task.md index 393650a..edf8bd9 100644 --- a/.github/ISSUE_TEMPLATES/research_request +++ 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? From f5c76e024e1cec2c1e13aef554ece185a3b18001 Mon Sep 17 00:00:00 2001 From: Amberg Date: Tue, 25 Jun 2024 16:46:31 -0700 Subject: [PATCH 4/5] add pre-commit file --- .github/workflows/pre-commit.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/workflows/pre-commit.yml 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 From e9f28e45bc495e405b05485f36a202becd36052f Mon Sep 17 00:00:00 2001 From: Amberg Date: Tue, 25 Jun 2024 16:51:06 -0700 Subject: [PATCH 5/5] update .pre-commit-config --- .pre-commit-config.yaml | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) 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"]