Skip to content
Open
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 kan/MultKAN.py
Original file line number Diff line number Diff line change
Expand Up @@ -2273,7 +2273,7 @@ def ex_round(ex1, n_digit):
# define variables
if var == None:
for ii in range(1, self.width[0][0] + 1):
exec(f"x{ii} = sympy.Symbol('x_{ii}')")
exec(f"x{ii} = sympy.Symbol('x_{ii}')", globals())
exec(f"x.append(x{ii})")
Comment on lines -2276 to 2277
Copy link

@joshua-cogliati-inl joshua-cogliati-inl May 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just out of curiosity, why is this code not just:

                x.append(sympy.Symbol(f"x_{ii}"))

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it works for Ubuntu too

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, then either this pull request or #545 can solve the problem.

elif isinstance(var[0], sympy.Expr):
x = var
Expand Down