Almost all of our operations create an extra copy (see #280). The fix proposed there is to opt-in for copy-free construction (spelt layout.MultiVector(value, copy=False)). However, it seems that every single construction within clifford would want this optin, which would make it seem better as a default.
If we made not copying the default, there are two types of code that would start doing the wrong thing:
Both of these are easy to fix by using buffer.copy() instead of buffer, but:
- Users upgrading may not know they need to do this
- It's still possible to write this type of code by accident.
Does the benefit of not having copy=False sprinked throughout tools justify the cost of the potential breakage here?
Almost all of our operations create an extra copy (see #280). The fix proposed there is to opt-in for copy-free construction (spelt
layout.MultiVector(value, copy=False)). However, it seems that every single construction withincliffordwould want this optin, which would make it seem better as a default.If we made not copying the default, there are two types of code that would start doing the wrong thing:
Code which modifies arrays to create multiple multivectors
Code which modifies multivectors sharing the same array
Both of these are easy to fix by using
buffer.copy()instead ofbuffer, but:Does the benefit of not having
copy=Falsesprinked throughout tools justify the cost of the potential breakage here?