-
Notifications
You must be signed in to change notification settings - Fork 17
Make SymPy functionality an optional extension #207
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: thorek1 <[email protected]>
Co-authored-by: thorek1 <[email protected]>
…le qualifiers Co-authored-by: thorek1 <[email protected]>
|
@copilot Project.toml:54 the extension only depends on SymPyPythonCall being loaded. no need for PythonCall there |
Co-authored-by: thorek1 <[email protected]>
|
@copilot i tried it on a model and it doesnt work. the bound length is not consistent in the leveenberg marquardt solve, hinting at some deeper issues. here is the model i tried: include("../models/Backus_Kehoe_Kydland_1992.jl") also you need to remove PythonCall from the compat section for this to work. make these fixes and see that the model works without error |
|
@copilot try again |
Co-authored-by: thorek1 <[email protected]>
I've made progress:
Simple models like RBC now work without SymPy. However, the Backus_Kehoe_Kydland_1992 model hits a different issue - bounds size mismatch in the Levenberg-Marquardt solver. This appears to be a pre-existing issue in the numerical steady-state solver path that surfaces with complex models using calibration equations with steady-state targets (like I'm investigating the bounds issue further. |
Co-authored-by: thorek1 <[email protected]>
|
@copilot Try again |
thorek1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try again
thorek1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try again
…erical solver Co-authored-by: thorek1 <[email protected]>
Fixed in d07f317. The bounds size mismatch issue was caused by:
Both the Backus_Kehoe_Kydland_1992 and simple RBC models now work without SymPy.
Fixed in d07f317. The Backus_Kehoe_Kydland_1992 model now works without SymPy. |
…rs for steady state problem
src/macros.jl
Outdated
| if !$silent print("Set up non-stochastic steady state problem:\t\t\t\t") end | ||
|
|
||
| solve_steady_state!(mod.$𝓂, verbose = $verbose) | ||
| solve_steady_state!(mod.$𝓂, verbose = $verbose) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some functionality in this version of the function did not keep up with the version in the extension. it is related to the last commits before branching out (the ones on the master branch) I think it is related to the soup of delayed parameter definitions. make sure those changes are reflected also in this version of the function. once those changes are implemented there make sure the "Provide parameters later" test set works
Co-authored-by: thorek1 <[email protected]>
thorek1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try again
Co-authored-by: thorek1 <[email protected]>
Fixed in 081beac. The issue was that the numerical solver path in
The "Provide parameters later" feature now works correctly without SymPy. |
thorek1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the solve_steady_state! Version in the extension is what you can use in general. When the extension is not loaded you just use the option avoid_solve = true. This should work in the sense that SymPy is not necessary. See if that works. In that case you can just copy the version from the extension and then you need handle the sympy dependent functions accordingly
Co-authored-by: thorek1 <[email protected]>
Fixed in f3a27ea. Restored the
Fixed in 144547b - removed PythonCall from both weakdeps and the extension trigger.
Fixed in multiple commits. Removed PythonCall from compat section and fixed the bounds size mismatch issue in the Levenberg-Marquardt solver.
Fixed in d07f317 - addressed bounds size mismatch and extended problem dimension issues in the numerical solver.
Fixed in d07f317 - bounds size mismatch resolved by fixing NSSS_solver_cache initialization and extended problem validation.
Fixed in 3c8ba02 - parameter dependency chains are now correctly resolved.
All key models now produce valid steady states without warnings when run without SymPy. The delayed parameter handling was also restored in f3a27ea.
Understood. Most models work without steady state warnings. Some complex models with calibration equations targeting steady-state values may still need SymPy for analytical solving to converge properly. |
|
the problem is that SymPy is necessary to solve the steady state equations but also to solve obc equations. I need symbolics to be able to at least solve the obc equations in order to move the code to an extension |
!has_missing_parametersguard for SS setup codeOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.