Skip to content

Commit

Permalink
Assorted fixes (#845)
Browse files Browse the repository at this point in the history
* Fix Remove unnecessary `baseline` parameter node  #844 and Original FRS simulations error due to no corporate wealth #843

* Remove docker build action for now
  • Loading branch information
nikhilwoodruff authored Apr 16, 2024
1 parent 8b821c7 commit f40b63e
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 36 deletions.
14 changes: 0 additions & 14 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,3 @@ jobs:
run: make documentation
env:
POLICYENGINE_GITHUB_MICRODATA_AUTH_TOKEN: ${{ secrets.POLICYENGINE_GITHUB_MICRODATA_AUTH_TOKEN}}
Docker:
name: Docker
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build container
run: docker build docs/streamlit -t ghcr.io/policyengine/policyengine-uk-documentation
19 changes: 0 additions & 19 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,25 +79,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: docs/book/_build/html # The folder the action should deploy.
Docker:
if: |
(github.repository == 'PolicyEngine/policyengine-uk')
&& (github.event.head_commit.message == 'Update PolicyEngine UK')
name: Docker
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build container
run: docker build docs/streamlit -t ghcr.io/policyengine/policyengine-uk-documentation
- name: Push container
run: docker push ghcr.io/policyengine/policyengine-uk-documentation
Publish:
if: |
(github.repository == 'PolicyEngine/policyengine-uk')
Expand Down
5 changes: 5 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- bump: patch
changes:
fixed:
- Bug causing frs_2021 simulations to error.
- Unnecessary system initialisation code.
1 change: 0 additions & 1 deletion policyengine_uk/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class CountryTaxBenefitSystem(TaxBenefitSystem):
def __init__(self, reform=None):
super().__init__(entities, reform=reform)

self.parameters.add_child("baseline", self.parameters.clone())
self.parameters = backdate_parameters(self.parameters, "2021-01-01")


Expand Down
5 changes: 4 additions & 1 deletion policyengine_uk/variables/household/wealth/corporate.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ class shareholding(Variable):

def formula(household, period, parameters):
wealth = household("corporate_wealth", period)
if hasattr(household.simulation, "dataset"):
if (
hasattr(household.simulation, "dataset")
and household("corporate_wealth", period).sum() != 0
):
weight = household("household_weight", period)
return wealth / (wealth * weight).sum()
wealth = parameters(period).household.wealth
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"microdf_python>=0.3.0",
"pandas",
"plotly>=4.14.3",
"PolicyEngine-Core>=2.11.3,<3",
"PolicyEngine-Core>=2.19.0,<3",
"pyyaml>=5.3.1",
"pytest",
"requests>=2.25.1",
Expand Down

0 comments on commit f40b63e

Please sign in to comment.