Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated inverse_method option #25

Merged
merged 1 commit into from
Aug 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading