Skip to content

Commit

Permalink
Remove deprecated inverse_method option (#25)
Browse files Browse the repository at this point in the history
Bump version
  • Loading branch information
jessegrabowski authored Aug 11, 2024
1 parent b6bd3bf commit 51096e4
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cge_modeling/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
_log.addHandler(handler)


__version__ = "0.0.2"
__version__ = "0.0.3"

__all__ = [
"CGEModel",
Expand Down
5 changes: 0 additions & 5 deletions cge_modeling/base/cge.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ def __init__(
apply_sympy_simplify: bool = False,
backend: Literal["pytensor", "numba"] | None = "pytensor",
mode: str | None = None,
inverse_method: str = "solve",
use_sparse_matrices: bool = False,
compile: list[CompiledFunctions] | None = "all",
use_scan_euler: bool = False,
Expand Down Expand Up @@ -149,10 +148,6 @@ def __init__(
Compilation mode for the pytensor backend. One of None, "JAX", or "NUMBA". Defaults to None. Note that this
argument is ignored if the backend is not "pytensor".
inverse_method: str, optional
Method to use to compute the inverse of the Jacobian matrix. One of "solve", "pinv", or "SGD".
Defaults to "solve". Ignored if the backend is not "pytensor".
use_sparse_matrices: bool, optional
Whether to use sparse matrices to represent matrices associated with the system (e.g. the Jacobian matrix).
Defaults to False. Ignored if the backend is not "pytensor".
Expand Down
2 changes: 1 addition & 1 deletion cge_modeling/pytensorf/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def pytensor_euler_step(system, A, B, variables, parameters):
v = flatten_equations(step_size)
Bv = B @ v

step = pt.linalg.solve(-A, Bv)
step = -pt.linalg.solve(A, Bv)
step.name = "euler_step"

delta_x = flat_tensor_to_ragged_list(step, x_shapes)
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = cge_modeling
version = 0.0.2
version = 0.0.3
description = A package for working with computable general equilibrium (CGE) models
long_description = file: README.md
long_description_content_type = text/markdown
Expand Down

0 comments on commit 51096e4

Please sign in to comment.