-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a122352
commit 3b1f4ab
Showing
3 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import pandas as pd | ||
from policyengine_us_data.data_storage import STORAGE_FOLDER | ||
from IPython.display import Markdown | ||
|
||
def main(): | ||
df = pd.read_csv(STORAGE_FOLDER / "evaluation.csv") | ||
|
||
most_recent_rows = df[df.Date == df.Date.max()].sort_values(["Variable", "Time period"]).set_index(["Variable", "Time period"]).Total | ||
second_most_recent_rows = df[df.Date == df.Date.sort_values().unique()[-2]].reset_index(drop=True).sort_values(["Variable", "Time period"]).set_index(["Variable", "Time period"]).Total | ||
|
||
diff = (most_recent_rows - second_most_recent_rows) | ||
# Convert to df | ||
diff = diff.reset_index() | ||
table = diff.to_markdown(index=False) | ||
|
||
review_text = f"""## National projection changes\n\n{table}""" | ||
|
||
print(review_text) | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Pull request | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
name: Build and test | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
|
||
- name: Install dependencies | ||
run: make install | ||
|
||
- name: Run tests | ||
run: make test | ||
|
||
- name: Run evaluation | ||
run: make evaluate | ||
|
||
- name: Add review comment | ||
run: python .github/review_pull_request.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters