Closed anutosh491 closed 1 month ago
Ready !
There is a failure at the CI. Apart from that this looks good.
Hmm, pretty weird, I wasn't expecting any test to fail. You can quickly check the results on sympy live (https://live.sympy.org/), A WebAssembly-powered Python kernel backed by Pyodide
@certik could you maybe try having a look ?
@anutosh491 The following diff fixes the issue for me:
diff --git a/src/runtime/lpython/lpython.py b/src/runtime/lpython/lpython.py
index 9f23b02e9..a8b88ac6f 100644
--- a/src/runtime/lpython/lpython.py
+++ b/src/runtime/lpython/lpython.py
@@ -15,6 +15,10 @@ __slots__ = ["i8", "i16", "i32", "i64", "u8", "u16", "u32", "u64", "f32", "f64",
# data-types
+def get_sympy_S(x):
+ from sympy import S
+ return S(x)
+
type_to_convert_func = {
"i1": bool,
"i8": int,
@@ -34,7 +38,7 @@ type_to_convert_func = {
"Callable": lambda x: x,
"Allocatable": lambda x: x,
"Pointer": lambda x: x,
- "S": lambda x: x,
+ "S": get_sympy_S,
}
class Type:
Hey thanks Ubaid, I think this might fix the issue for us.
We should clean the commit history or squash merge this.
This Pr is trying to support the following case (and is also required for the gruntz algorithm)