Hi Roberto,

I already answered this on SO:
https://stackoverflow.com/questions/62798213/keep-the-order-of-parameters-fixed-in-sympy-lambdify-from-free-symbols/62800716?noredirect=1#comment111075099_62800716

If you are using symarray to generate the symbols then you can get the
list of symbols from the symarray directly and then pass those to
lambdify.

I can't think of any situation where it would be a good idea to use
free_symbols to get the arguments to lambdify.

Oscar

On Fri, 10 Jul 2020 at 08:10, roberto franceschini
<franceschini.robe...@gmail.com> wrote:
>
> Hello, I have opened an issue for the input of lambdify. If you want to 
> disallow sets as inputs I think it is fair. However, It would be nice to have 
> that free_symbol can be given directly as input for lambdify, is that 
> possible? should I use something else than free_symbols for this purpose?
>
> On Thu, Jul 9, 2020 at 9:55 PM Aaron Meurer <asmeu...@gmail.com> wrote:
>>
>> Can you open an issue in the issue tracker for this? I agree that sets
>> should not be allowed.
>>
>> Aaron Meurer
>>
>> On Thu, Jul 9, 2020 at 3:08 AM Roberto <franceschini.robe...@gmail.com> 
>> wrote:
>> >
>> > I have seen that lambdify wants a list for the arguments to be treated as 
>> > symbols. This list can be also give as a python set, e.g. {x,y,z }, which 
>> > is exactly what would be returned by a .free_symbol property. If lambdify 
>> > is feed a set like that of the output of .free_symbol it may change their 
>> > order in the conversion from set to list. This is done silently and may 
>> > cause major disfunction in the use of the lamdified function because you 
>> > think x is x, but is y instead and so on.
>> > I would like to ask developers to check for the type of the lambdify list 
>> > of arguments and throw a warning to flag that a set is being converted and 
>> > that the ordering is not guaranteed.
>> > Given that .free_symbols returns a set, not a list, this is very common 
>> > pitfall in my opinion and must be prevented.
>> >
>> > --
>> > You received this message because you are subscribed to the Google Groups 
>> > "sympy" group.
>> > To unsubscribe from this group and stop receiving emails from it, send an 
>> > email to sympy+unsubscr...@googlegroups.com.
>> > To view this discussion on the web visit 
>> > https://groups.google.com/d/msgid/sympy/c1517b79-490b-4a1b-b526-3e3842b55fbco%40googlegroups.com.
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "sympy" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to sympy+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/sympy/CAKgW%3D6KuqnjJHTObyDxK0tvaF_Frxzd-MfyQSY94v-oTUWyNAg%40mail.gmail.com.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sympy+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sympy/CAJxM9JqSoqQQkYH9UUXGyXNqRtY9VHJxKByc8Fv8%2BPaqFudP6w%40mail.gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAHVvXxSsngVE_X-aBRYWER5sESZW-e-EnjwWcfGAhM%3D%2Beq97zQ%40mail.gmail.com.

Reply via email to