-
Notifications
You must be signed in to change notification settings - Fork 19
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
Allow declaration of Dummy arguments instead of just Symbols #290
Comments
I think that it's desired behaviour, as far as sympy is concerned. The good news is that we subclass Symbol fairly transparently: could you try |
This was also discussed a while ago in #124 |
@pckroon this breaks directly on Its possible to change the parameter creation from params = symbols(names, cls=Parameter, seq=True, **kwargs) cls = kwargs.pop('cls', Parameter)
params = symbols(names, cls=cls, seq=True, **kwargs) To then get Making |
More support for Dummies: Lines 120 to 123 in ecc567a
|
This is a very good question. I believe that if we coded everything correctly, there shouldn't be any difference since we never really do thing like So thinking about it now, there is actually a lot to be said for this. My biggest concern is actually not the impact on symfit functions, but how these objects would interact with sympy itself. |
One way I can think of this going wrong is the user defining a parameter once with a certain name and then doing the same thing again later with the expectation that this gives the same sympy symbol. |
I also think that is bad practice, and it is much easier when coding to reuse the same symbol then to type |
I'm not sure if this would break everything, but it would be very useful to be able to construct parameters/variables that inherit sympy's
Dummy
class instead of theSymbol
class. The reason being that if multiple variables are created with the same string input, they are the same object and changing one changes the other.This is even true if these variables are containerized into class instances.
Sympy solves this through the Dummy variable class, so if there was an alternative constructor for symfit's
Argument
class to extend Dummy, that (should) fix the issue.Now, I'm not sure if this is more properly a sympy bug or if this is actually desirable behavior, or if it would be a nightmare to implement, but... it would be nice.
The text was updated successfully, but these errors were encountered: