Skip to content

Commit

Permalink
Black formatted firm.py and txfunc.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rickecon committed Feb 6, 2024
1 parent 6d278b2 commit d65cc5d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 13 deletions.
22 changes: 18 additions & 4 deletions ogcore/firm.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,12 @@ def get_Y(K, K_g, L, p, method, m=-1):
* (L ** ((epsilon - 1) / epsilon))
)
) ** (epsilon / (epsilon - 1))
Y2 = Z * (K**gamma) * (K_g**gamma_g) * (L ** (1 - gamma - gamma_g))
Y2 = (
Z
* (K**gamma)
* (K_g**gamma_g)
* (L ** (1 - gamma - gamma_g))
)
Y[epsilon == 1] = Y2[epsilon == 1]
else: # TPI case
if m is not None:
Expand Down Expand Up @@ -152,7 +157,12 @@ def get_Y(K, K_g, L, p, method, m=-1):
* (L ** ((epsilon - 1) / epsilon))
)
) ** (epsilon / (epsilon - 1))
Y2 = Z * (K**gamma) * (K_g**gamma_g) * (L ** (1 - gamma - gamma_g))
Y2 = (
Z
* (K**gamma)
* (K_g**gamma_g)
* (L ** (1 - gamma - gamma_g))
)
Y[:, epsilon == 1] = Y2[:, epsilon == 1]

return Y
Expand Down Expand Up @@ -453,7 +463,9 @@ def get_L_from_Y(w, Y, p, method):
Z = p.Z[-1]
else:
Z = p.Z[: p.T]
L = ((1 - p.gamma - p.gamma_g) * Z ** (p.epsilon - 1) * Y) / (w**p.epsilon)
L = ((1 - p.gamma - p.gamma_g) * Z ** (p.epsilon - 1) * Y) / (
w**p.epsilon
)

return L

Expand Down Expand Up @@ -654,7 +666,9 @@ def solve_L(Y, K, K_g, p, method, m=-1):
K_g[K_g == 0] = 1.0
gamma_g = 0
if epsilon == 1.0:
L = (Y / (Z * K**gamma * K_g**gamma_g)) ** (1 / (1 - gamma - gamma_g))
L = (Y / (Z * K**gamma * K_g**gamma_g)) ** (
1 / (1 - gamma - gamma_g)
)
else:
L = (
(
Expand Down
18 changes: 9 additions & 9 deletions ogcore/txfunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1308,15 +1308,15 @@ def tax_func_loop(
(NoData_cnt, 1)
) * (x1_mtry - x0_mtry)
for s_ind in range(NoData_cnt):
etrparam_list[s - NoData_cnt - min_age + s_ind] = (
lin_int_etr[s_ind, :]
)
mtrxparam_list[s - NoData_cnt - min_age + s_ind] = (
lin_int_mtrx[s_ind, :]
)
mtryparam_list[s - NoData_cnt - min_age + s_ind] = (
lin_int_mtry[s_ind, :]
)
etrparam_list[
s - NoData_cnt - min_age + s_ind
] = lin_int_etr[s_ind, :]
mtrxparam_list[
s - NoData_cnt - min_age + s_ind
] = lin_int_mtrx[s_ind, :]
mtryparam_list[
s - NoData_cnt - min_age + s_ind
] = lin_int_mtry[s_ind, :]

elif (
(NoData_cnt > 0)
Expand Down

0 comments on commit d65cc5d

Please sign in to comment.