Closed duncanhobbs closed 5 years ago
@jdebacker
This PR adds tests of 3 additional functions in aggregates.py eqpf, eqpk, and eqkk.
I ran the set of tests for CGE and added the output below.
Let me know if I need to do anything else for this PR.
=========================== test session starts ============================ platform win32 -- Python 3.7.3, pytest-4.4.0, py-1.8.0, pluggy-0.9.0 -- C:\Us \duncan.hobbs\AppData\Local\Continuum\anaconda3\envs\cge_env\python.exe cachedir: .pytest_cache rootdir: C:\Users\duncan.hobbs\Github\PSL\CGE plugins: xdist-1.26.1, pep8-1.0.6, forked-1.0.2 collected 37 items
test_aggregates.py::test_eqSp PASSED test_aggregates.py::test_Kd PASSED test_aggregates.py::test_eqKf PASSED test_aggregates.py::test_eqKk kk inputs= 2 20 0.02 [0.3 0.2 0.1 0.4] [5 6 8 PASSED test_aggregates.py::test_eqbop PASSED test_aggregates.py::test_eqSf 14.099999999999998 PASSED test_aggregates.py::test_eqpqerror PASSED test_aggregates.py::test_eqpf PASSED test_aggregates.py::test_eqpk PASSED test_execute.py::test_runner initial guess = [1. 1. 1. 1. 1. 1. 1. 1.] kk inputs= 1.0 1051.0 0.1 AGR 0.000000 OIL 0.000000 IND 0.237113 SER 0.762887 Name: INV, dtype: float64 AGR 1.0 OIL 1.0 IND 1.0 SER 1.0 dtype: float64 kk inputs= 1.0 1051.0 0.1 AGR 0.000000 OIL 0.000000 IND 0.237113 SER 0.762887 Name: INV, dtype: float64 AGR 1.0 OIL 1.0 IND 1.0 SER 1.0 dtype: float64 kk inputs= 1.0 1051.0 0.1 AGR 0.000000 OIL 0.000000 IND 0.237113 SER 0.762887 Name: INV, dtype: float64 AGR 1.0 OIL 1.0 IND 1.0 SER 1.0 dtype: float64 kk inputs= 1.0 1051.0 0.1 AGR 0.000000 OIL 0.000000 IND 0.237113 SER 0.762887 Name: INV, dtype: float64 AGR 1.0 OIL 1.0 IND 1.0 SER 1.0 dtype: float64 kk inputs= 1.0 1051.0 0.1 AGR 0.000000 OIL 0.000000 IND 0.237113 SER 0.762887 Name: INV, dtype: float64 AGR 1.0 OIL 1.0 IND 1.0 SER 1.0 dtype: float64 kk inputs= 1.0 1051.0 0.1 AGR 0.000000 OIL 0.000000 IND 0.237113 SER 0.762887 Name: INV, dtype: float64 AGR 1.0 OIL 1.0 IND 1.0 SER 1.0 dtype: float64 kk inputs= 1.0 1051.0 0.1 AGR 0.000000 OIL 0.000000 IND 0.237113 SER 0.762887 Name: INV, dtype: float64 AGR 1.0 OIL 1.0 IND 1.0 SER 1.0 dtype: float64 kk inputs= 1.0 1051.0 0.1 AGR 0.000000 OIL 0.000000 IND 0.237113 SER 0.762887 Name: INV, dtype: float64 AGR 1.0 OIL 1.0 IND 1.0 SER 1.0 dtype: float64 kk inputs= 1.0000000149011612 1051.0 0.1 AGR 0.000000 OIL 0.000000 IND 0.237113 SER 0.762887 Name: INV, dtype: float64 AGR 1.0 OIL 1.0 IND 1.0 SER 1.0 dtype: float64 kk inputs= 1.0 1051.0 0.1 AGR 0.000000 OIL 0.000000 IND 0.237113 SER 0.762887 Name: INV, dtype: float64 AGR 1.0 OIL 1.0 IND 1.0 SER 1.0 dtype: float64 kk inputs= 1.0 1051.0 0.1 AGR 0.000000 OIL 0.000000 IND 0.237113 SER 0.762887 Name: INV, dtype: float64 AGR 1.0 OIL 1.0 IND 1.0 SER 1.0 dtype: float64 kk inputs= 0.9999999999999999 1051.0 0.1 AGR 0.000000 OIL 0.000000 IND 0.237113 SER 0.762887 Name: INV, dtype: float64 AGR 1.0 OIL 1.0 IND 1.0 SER 1.0 dtype: float64 kk inputs= 0.9999999999999999 1051.0 0.1 AGR 0.000000 OIL 0.000000 IND 0.237113 SER 0.762887 Name: INV, dtype: float64 AGR 1.0 OIL 1.0 IND 1.0 SER 1.0 dtype: float64 Distance at iteration 1 is 4.121147867408581e-12 Model solved, Q = AGR 116.0 OIL 149.0 IND 1432.0 SER 1803.0 dtype: float64 PASSED test_execute.py::test_check_square PASSED test_execute.py::test_row_total PASSED test_execute.py::test_col_total PASSED test_execute.py::test_row_col_equal PASSED test_firms.py::test_eqpy PASSED test_firms.py::test_eqX PASSED test_firms.py::test_eqY PASSED test_firms.py::test_eqpz PASSED test_firms.py::test_eqXv PASSED test_firms.py::test_eqFsh PASSED test_firms.py::test_eqpe PASSED test_firms.py::test_eqpm PASSED test_firms.py::test_eqQ PASSED test_firms.py::test_eqM PASSED test_firms.py::test_eqD PASSED test_firms.py::test_eqpd PASSED test_firms.py::test_eqZ PASSED test_firms.py::test_eqE PASSED test_firms.py::test_eqDex PASSED test_government.py::test_eqTd PASSED test_government.py::test_eqTz PASSED test_government.py::test_eqTm PASSED test_government.py::test_eqXg PASSED test_government.py::test_eqSg PASSED test_household.py::test_eqF Type = <class 'pandas.core.frame.DataFrame'> 0 1 2 Row1 0.3 0.4 0.5 Row2 0.4 0.4 0.3 Row3 0.4 0.2 0.2 PASSED test_household.py::test_eqI Type = <class 'numpy.int32'> 75 PASSED test_household.py::test_eqXp Type = <class 'pandas.core.frame.DataFrame'> 0 Row1 0.2 Row2 0.4 Row3 0.4 PASSED
============================= warnings summary ============================= open_cge/tests/test_execute.py::test_runner open_cge/tests/test_execute.py::test_runner open_cge/tests/test_execute.py::test_runner C:\Users\duncan.hobbs\AppData\Local\Continuum\anaconda3\envs\cge_env\lib\si packages\numpy\lib\type_check.py:546: DeprecationWarning: np.asscalar(a) is d ecated since NumPy v1.16, use a.item() instead 'a.item() instead', DeprecationWarning, stacklevel=1)
-- Docs: https://docs.pytest.org/en/latest/warnings.html ================== 37 passed, 3 warnings in 2.08 seconds ===================
@duncanhobbs These look good - thanks! Merging now.
@jdebacker
This PR adds tests of 3 additional functions in aggregates.py eqpf, eqpk, and eqkk.
I ran the set of tests for CGE and added the output below.
Let me know if I need to do anything else for this PR.
=========================== test session starts ============================ platform win32 -- Python 3.7.3, pytest-4.4.0, py-1.8.0, pluggy-0.9.0 -- C:\Us \duncan.hobbs\AppData\Local\Continuum\anaconda3\envs\cge_env\python.exe cachedir: .pytest_cache rootdir: C:\Users\duncan.hobbs\Github\PSL\CGE plugins: xdist-1.26.1, pep8-1.0.6, forked-1.0.2 collected 37 items
test_aggregates.py::test_eqSp PASSED test_aggregates.py::test_Kd PASSED test_aggregates.py::test_eqKf PASSED test_aggregates.py::test_eqKk kk inputs= 2 20 0.02 [0.3 0.2 0.1 0.4] [5 6 8 PASSED test_aggregates.py::test_eqbop PASSED test_aggregates.py::test_eqSf 14.099999999999998 PASSED test_aggregates.py::test_eqpqerror PASSED test_aggregates.py::test_eqpf PASSED test_aggregates.py::test_eqpk PASSED test_execute.py::test_runner initial guess = [1. 1. 1. 1. 1. 1. 1. 1.] kk inputs= 1.0 1051.0 0.1 AGR 0.000000 OIL 0.000000 IND 0.237113 SER 0.762887 Name: INV, dtype: float64 AGR 1.0 OIL 1.0 IND 1.0 SER 1.0 dtype: float64 kk inputs= 1.0 1051.0 0.1 AGR 0.000000 OIL 0.000000 IND 0.237113 SER 0.762887 Name: INV, dtype: float64 AGR 1.0 OIL 1.0 IND 1.0 SER 1.0 dtype: float64 kk inputs= 1.0 1051.0 0.1 AGR 0.000000 OIL 0.000000 IND 0.237113 SER 0.762887 Name: INV, dtype: float64 AGR 1.0 OIL 1.0 IND 1.0 SER 1.0 dtype: float64 kk inputs= 1.0 1051.0 0.1 AGR 0.000000 OIL 0.000000 IND 0.237113 SER 0.762887 Name: INV, dtype: float64 AGR 1.0 OIL 1.0 IND 1.0 SER 1.0 dtype: float64 kk inputs= 1.0 1051.0 0.1 AGR 0.000000 OIL 0.000000 IND 0.237113 SER 0.762887 Name: INV, dtype: float64 AGR 1.0 OIL 1.0 IND 1.0 SER 1.0 dtype: float64 kk inputs= 1.0 1051.0 0.1 AGR 0.000000 OIL 0.000000 IND 0.237113 SER 0.762887 Name: INV, dtype: float64 AGR 1.0 OIL 1.0 IND 1.0 SER 1.0 dtype: float64 kk inputs= 1.0 1051.0 0.1 AGR 0.000000 OIL 0.000000 IND 0.237113 SER 0.762887 Name: INV, dtype: float64 AGR 1.0 OIL 1.0 IND 1.0 SER 1.0 dtype: float64 kk inputs= 1.0 1051.0 0.1 AGR 0.000000 OIL 0.000000 IND 0.237113 SER 0.762887 Name: INV, dtype: float64 AGR 1.0 OIL 1.0 IND 1.0 SER 1.0 dtype: float64 kk inputs= 1.0000000149011612 1051.0 0.1 AGR 0.000000 OIL 0.000000 IND 0.237113 SER 0.762887 Name: INV, dtype: float64 AGR 1.0 OIL 1.0 IND 1.0 SER 1.0 dtype: float64 kk inputs= 1.0 1051.0 0.1 AGR 0.000000 OIL 0.000000 IND 0.237113 SER 0.762887 Name: INV, dtype: float64 AGR 1.0 OIL 1.0 IND 1.0 SER 1.0 dtype: float64 kk inputs= 1.0 1051.0 0.1 AGR 0.000000 OIL 0.000000 IND 0.237113 SER 0.762887 Name: INV, dtype: float64 AGR 1.0 OIL 1.0 IND 1.0 SER 1.0 dtype: float64 kk inputs= 0.9999999999999999 1051.0 0.1 AGR 0.000000 OIL 0.000000 IND 0.237113 SER 0.762887 Name: INV, dtype: float64 AGR 1.0 OIL 1.0 IND 1.0 SER 1.0 dtype: float64 kk inputs= 0.9999999999999999 1051.0 0.1 AGR 0.000000 OIL 0.000000 IND 0.237113 SER 0.762887 Name: INV, dtype: float64 AGR 1.0 OIL 1.0 IND 1.0 SER 1.0 dtype: float64 Distance at iteration 1 is 4.121147867408581e-12 Model solved, Q = AGR 116.0 OIL 149.0 IND 1432.0 SER 1803.0 dtype: float64 PASSED test_execute.py::test_check_square PASSED test_execute.py::test_row_total PASSED test_execute.py::test_col_total PASSED test_execute.py::test_row_col_equal PASSED test_firms.py::test_eqpy PASSED test_firms.py::test_eqX PASSED test_firms.py::test_eqY PASSED test_firms.py::test_eqpz PASSED test_firms.py::test_eqXv PASSED test_firms.py::test_eqFsh PASSED test_firms.py::test_eqpe PASSED test_firms.py::test_eqpm PASSED test_firms.py::test_eqQ PASSED test_firms.py::test_eqM PASSED test_firms.py::test_eqD PASSED test_firms.py::test_eqpd PASSED test_firms.py::test_eqZ PASSED test_firms.py::test_eqE PASSED test_firms.py::test_eqDex PASSED test_government.py::test_eqTd PASSED test_government.py::test_eqTz PASSED test_government.py::test_eqTm PASSED test_government.py::test_eqXg PASSED test_government.py::test_eqSg PASSED test_household.py::test_eqF Type = <class 'pandas.core.frame.DataFrame'> 0 1 2 Row1 0.3 0.4 0.5 Row2 0.4 0.4 0.3 Row3 0.4 0.2 0.2 PASSED test_household.py::test_eqI Type = <class 'numpy.int32'> 75 PASSED test_household.py::test_eqXp Type = <class 'pandas.core.frame.DataFrame'> 0 Row1 0.2 Row2 0.4 Row3 0.4 PASSED
============================= warnings summary ============================= open_cge/tests/test_execute.py::test_runner open_cge/tests/test_execute.py::test_runner open_cge/tests/test_execute.py::test_runner C:\Users\duncan.hobbs\AppData\Local\Continuum\anaconda3\envs\cge_env\lib\si packages\numpy\lib\type_check.py:546: DeprecationWarning: np.asscalar(a) is d ecated since NumPy v1.16, use a.item() instead 'a.item() instead', DeprecationWarning, stacklevel=1)
-- Docs: https://docs.pytest.org/en/latest/warnings.html ================== 37 passed, 3 warnings in 2.08 seconds ===================