Skip to content

Commit

Permalink
Merge pull request #382 from jdebacker/start_year
Browse files Browse the repository at this point in the history
Update model default start year
  • Loading branch information
jdebacker authored Mar 8, 2024
2 parents da5e895 + ed3e337 commit 0e6e344
Show file tree
Hide file tree
Showing 7 changed files with 134 additions and 315 deletions.
2 changes: 1 addition & 1 deletion ccc/tests/test_calcfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def test_update_depr_methods(monkeypatch):
"""
Test of calcfunctions.update_depr_methods
"""
p = Specification()
p = Specification(year=2020)
json_str = """
{"schema": {
"labels": {
Expand Down
2 changes: 1 addition & 1 deletion ccc/tests/test_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def test_restore_assets():

def test_p_param_return_value():
assets = Assets()
p = Specification()
p = Specification(year=2022)
dp = DepreciationParams()
calc1 = Calculator(p, dp, assets)
obj = calc1.p_param("tau_int")
Expand Down
2 changes: 1 addition & 1 deletion ccc/tests/test_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def test_update_specification_with_json():


def test_update_bad_revision1():
spec = Specification()
spec = Specification(year=2022)
# profit rate has an upper bound at 1.0
revs = {"profit_rate": [{"year": spec.year, "value": 1.2}]}
spec.update_specification(revs, raise_errors=False)
Expand Down
2 changes: 1 addition & 1 deletion ccc/tests/test_run_ccc.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_calc_by_methods():
comparing actual and expect dataframes
"""
# execute Calculator calc_by methods to get actual results
p = Specification()
p = Specification(year=2022)
dp = DepreciationParams()
assets = Assets()
calc = Calculator(p, dp, assets)
Expand Down
2 changes: 1 addition & 1 deletion ccc/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
PYPI_PACKAGE_NAME = "cost-of-capital-calculator"

# Default year for model runs
DEFAULT_START_YEAR = 2022
DEFAULT_START_YEAR = 2024

# Year of asset data
ASSET_DATA_CSV_YEAR = 2013
Expand Down
5 changes: 3 additions & 2 deletions cs-config/cs_config/tests/test_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import numpy as np
import io
from cs_config import functions
from ccc.utils import DEFAULT_START_YEAR


def test_start_year_with_data_source():
Expand Down Expand Up @@ -47,10 +48,10 @@ class TestFunctions1(CoreTestFunctions):
run_model = functions.run_model
ok_adjustment = {
"Business Tax Parameters": {
"CIT_rate": [{"year": 2022, "value": 0.25}]
"CIT_rate": [{"year": DEFAULT_START_YEAR, "value": 0.25}]
},
"Individual and Payroll Tax Parameters": {
"FICA_ss_trt": [{"year": 2022, "value": 0.14}]
"FICA_ss_trt": [{"year": DEFAULT_START_YEAR, "value": 0.14}]
},
}
bad_adjustment = {
Expand Down
434 changes: 126 additions & 308 deletions docs/book/content/examples/PSL_demo.ipynb

Large diffs are not rendered by default.

0 comments on commit 0e6e344

Please sign in to comment.