Skip to content
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

Exposing sympy API #299

Open
Jhsmit opened this issue Feb 7, 2020 · 2 comments
Open

Exposing sympy API #299

Jhsmit opened this issue Feb 7, 2020 · 2 comments

Comments

@Jhsmit
Copy link
Collaborator

Jhsmit commented Feb 7, 2020

In api.py the sympy API is exposed by:

# Expose the sympy API
from sympy import *

This has the consequence that:

import symfit
print(symfit.core)
>>> <module 'sympy.core.core' from 'C:\\Users\\jhs\\Miniconda3\\lib\\site-packages\\sympy\\core\\core.py'>

What? symfit.core is not sympy.core.core? Its probably not a problem but it caused me a lot of confusion since you can't import anymore like this:

import symfit.core.argument as arg
ImportError: cannot import name 'argument' from 'sympy.core.core' (C:\Users\jhs\Miniconda3\lib\site-packages\sympy\core\core.py)

Maybe we can only import the useful stuff from sympy instead of importing *?

@tBuLi
Copy link
Owner

tBuLi commented Mar 19, 2020

Yeah you're probably right about this. The original reason for doing this is that there is probably a lot of useful stuff in sympy that people want to have access to, and it's a changing list over time. Is there a smart way to get both proper paths and a maintenance free way of exposing sympy?

@Jhsmit
Copy link
Collaborator Author

Jhsmit commented Mar 19, 2020

Yes I understand the reasoning and I frequently use exp from sympy.

this issue is related to: sympy/sympy#12115
where they had a similar issue of imports from sympy.core.core and this seems to be fixed on diofant (which is a fork of sympy) by restructuring and removing core.py

The only fix I can think of is manually importing what could be useful. But if you look in sympy's init its a long list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants