-
Notifications
You must be signed in to change notification settings - Fork 13
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
Fix mutation behavior of position
#131
Conversation
No idea, could just be an issue on Github's side. We can try restarting them. |
Seems like we could change all uses of |
I think overall the new code is definitely an improvement, but needs a cleanup and style improvements based on my comments. |
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #131 +/- ##
==========================================
- Coverage 72.90% 72.87% -0.03%
==========================================
Files 71 68 -3
Lines 4097 3982 -115
==========================================
- Hits 2987 2902 -85
+ Misses 1110 1080 -30 ☔ View full report in Codecov by Sentry. |
Looks good, thanks @b-kloss. This kind of cleanup/refactor will help when generalizing to loopy graphs with BP (@JoeyT1994). |
This PR makes
position(pos, PH)
not mutatePH::AbstractProjTTN
. Non-mutating versions ofmake_environment
are also implemented for the concrete subtypes. Additionally,copy
is implemented for the concrete types usingcopy_values_keys
onPH.enviroments
to provide copy safety (not entirely necessary if only in-place version is kept) and the original implementation renamed tounsafe_copy
.A test example verifying copy safety is provided (the original implementation was not copy-safe due to
andyferris/Dictionaries.jl#98) .
ToDo:
copy_keys_values
into namespaceProjTTNSum
?