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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assignment breaks the saving #427
Comments
|
@sjrl I think the automatic check is a good idea, at least for now so that if something isn't saved properly it doesn't fail silently. @jasonkhadka the two "Works BUT" examples are expected: |
PR for the fix: #432 This still has 1 issue.
Gives:
There is no harm in having |
I see.
|
Why does PR #432 fixes this issue?Current problem:
In code above, Now if you look up Currecnt
In the above code, Function So, there are special checks when variables are overridden and still can have self-dependence, which is true for |
Are there any other |
This should check for any possiblity of recursion basically.
|
here's a list of all ast node types: https://docs.python.org/3/library/ast.html |
@jasonkhadka thanks for the explanation! I think the problem is here: https://github.com/lf1-io/padl/blob/main/padl/dumptools/var2mod.py#L249 Let me know if you want to discuss this! |
Thanks, I had gone through that and updated the list for Func, Class, AsyncFuncDef.
Thanks for the explanation, I am going through the notebook. I will ping you if I need more clarifaction. I will update the PR with the changes.
|
From the discussion on PR: #432 @wuhu pointed out:
would not work. Also here, Another example that fails:
While:
would skip last b.B.A = 3 assignment but would give the dump.
|
Right, though this [...]
b = B(b)
print(b._pd_dumps()) seems to be a different problem, even just: @transform
class B:
def __init__(self, x):
...
b = 1
b = B(b)
print(b._pd_dumps()) goes wrong, dump is: from padl import transform
b = 1
@transform
class B:
def __init__(self, x):
...
b = B(b)
_pd_main = B(b) That's because the transform to dump ( We should be able to deal with this by applying |
The other problem seems a bit tricky - to get rid of the bug, it seems, we need to have (and deal with) multiple "conditional" |
After discussion:
So both variants will be looked up. Another example:
Order of variable finds:
|
馃悶 Bug
Assignment breaks the saving
Works BUT
pd_to
is not written in thetransform.py
filevisit_Attribute
is not triggered.content of
transform.py
Not working code
visit_Attribute
6 times.times_two
is not written on the file.content of
transform.py
Works BUT
device
assigment.new_name
visit_Attribute
This works. but forgets about
new_name
andnew_name
assigment.Below is the code written on
transform.py
.The text was updated successfully, but these errors were encountered: