Re: [sympy] Best way to import Sympy

2020-06-30 Thread Aaron Meurer
On Tue, Jun 30, 2020 at 3:53 PM David Bailey wrote: > > Aaron, thanks for responding to my question in detail. > > On 30/06/2020 20:00, Aaron Meurer wrote: > > > The printer doesn't take into account your namespace. It is > copy-pastable from the point of view of having all the SymPy names > impor

Re: [sympy] Best way to import Sympy

2020-06-30 Thread David Bailey
Aaron, thanks for responding to my question in detail. On 30/06/2020 20:00, Aaron Meurer wrote: The printer doesn't take into account your namespace. It is copy-pastable from the point of view of having all the SymPy names imported. We could add a string printer mode that prefixes all SymPy nam

Re: [sympy] Best way to import Sympy

2020-06-30 Thread Aaron Meurer
On Mon, Jun 29, 2020 at 2:43 PM David Bailey wrote: > > On 29/06/2020 17:16, Oscar Benjamin wrote: > > > In any significant codebase star-import is a bad idea. It makes it > hard to trace the origin of an imported name when looking at the code. > If I'm looking at the code and I see sp.cos then I

Re: [sympy] Best way to import Sympy

2020-06-30 Thread Jonathan Gutow
+1 to this option. I agree with Oscar, this seems the least ambiguous and simplest recommendation. I also second Oscar's suggestion that examples in the tutorial should be modified to reflect this. On 6/30/20 11:07 AM, Oscar Benjamin wrote: I would recommend use the star import for interactive

Re: [sympy] Best way to import Sympy

2020-06-30 Thread Oscar Benjamin
On Tue, 30 Jun 2020 at 16:34, Nicolas Guarin wrote: > > I would recommend use the star import for interactive CAS work, otherwise I > would second Aaron in using > > import sympy as sym Okay maybe we should go with this. It's less ambiguous than the other variants and is potentially more me

Re: [sympy] Best way to import Sympy

2020-06-30 Thread Nicolas Guarin
I would recommend use the star import for interactive CAS work, otherwise I would second Aaron in using import sympy as sym On Monday, June 29, 2020 at 3:43:14 PM UTC-5, David Bailey wrote: > > On 29/06/2020 17:16, Oscar Benjamin wrote: > > > In any significant codebase star-import is a bad

Re: [sympy] Best way to import Sympy

2020-06-29 Thread David Bailey
On 29/06/2020 17:16, Oscar Benjamin wrote: In any significant codebase star-import is a bad idea. It makes it hard to trace the origin of an imported name when looking at the code. If I'm looking at the code and I see sp.cos then I expect that sp will be defined or imported somewhere at the top

Re: [sympy] Best way to import Sympy

2020-06-29 Thread Aaron Meurer
The sp shorthand is usually used for scipy. I recommend using 'import sympy as sym' or 'import sympy as sm' (sm is also used by statsmodels so I would avoid that one if you use that library). Aaron Meurer On Mon, Jun 29, 2020 at 12:38 PM Jonathan Gutow wrote: > > +1 for encouraging `import sympy

Re: [sympy] Best way to import Sympy

2020-06-29 Thread Jonathan Gutow
+1 for encouraging `import sympy as sp`, when every things are not simple enough for `from sympy import *`. Jonathan On 6/29/20 11:16 AM, Oscar Benjamin wrote: CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the send

Re: [sympy] Best way to import Sympy

2020-06-29 Thread Oscar Benjamin
On Mon, 29 Jun 2020 at 15:54, Javier Arantegui wrote: > > Hi! Hi Javier, > Most probably, this is a silly question... I don't think it's a silly question > What is the best way to import Sympy? > > I usually use: > > from sympy import * > > I know that using a wild import should be avoided

[sympy] Best way to import Sympy

2020-06-29 Thread Javier Arantegui
Hi! Most probably, this is a silly question... What is the best way to import Sympy? I usually use: from sympy import * I know that using a wild import should be avoided. Is this a better way: import sympy as sp Best regards, Javier -- You received this message because you are sub