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

Category theory examples from https://docs.sympy.org/latest/modules/categories.html fail on SymPy Live #176

Open
catskillsresearch opened this issue Aug 10, 2020 · 4 comments

Comments

@catskillsresearch
Copy link

This example code given on the website fails on SymPy Live in https://docs.sympy.org/latest/modules/categories.html:

>>> from sympy.categories import Object, NamedMorphism
Exception in SymPy Live of type 
<type 'exceptions.TypeError'>
for reference the last 5 stack trace entries are
Traceback (most recent call last):
  File "/base/data/home/apps/s~sympy-live-hrd/66.426491309333028408/app/handlers.py", line 271, in post
    live.evaluate(statement, session, printer, stream)
  File "/base/data/home/apps/s~sympy-live-hrd/66.426491309333028408/app/shell.py", line 284, in evaluate
    session_globals_dict = session.globals_dict()
  File "/base/data/home/apps/s~sympy-live-hrd/66.426491309333028408/app/models.py", line 87, in globals_dict
    for name, val in zip(self.global_names, self.globals))
  File "/base/data/home/apps/s~sympy-live-hrd/66.426491309333028408/app/models.py", line 87, in <genexpr>
    for name, val in zip(self.global_names, self.globals))
  File "/base/alloc/tmpfs/dynamic_runtimes/python27g/32fc9e2909a8cd9/python27/python27_dist/lib/python2.7/pickle.py", line 1388, in loads
    return Unpickler(file).load()
TypeError: name should be a string, not <class 'sympy.core.symbol.Symbol'>
@oscarbenjamin
Copy link
Contributor

Does it fail if you try again? I just tried and it worked fine

@catskillsresearch
Copy link
Author

On my work PC, which is Windows 10. It fails on the first example. On my home PC, which is Ubuntu, the first example works, and the 2nd one fails, in the same way as I initially reported:

TypeError: name should be a string, not <class 'sympy.core.symbol.Symbol'>

This happens with g * f, here is full context:

>>> (g * f).domain
Exception in SymPy Live of type 
<type 'exceptions.TypeError'>
for reference the last 5 stack trace entries are
Traceback (most recent call last):
  File "/base/data/home/apps/s~sympy-live-hrd/66.426491309333028408/app/handlers.py", line 271, in post
    live.evaluate(statement, session, printer, stream)
  File "/base/data/home/apps/s~sympy-live-hrd/66.426491309333028408/app/shell.py", line 284, in evaluate
    session_globals_dict = session.globals_dict()
  File "/base/data/home/apps/s~sympy-live-hrd/66.426491309333028408/app/models.py", line 87, in globals_dict
    for name, val in zip(self.global_names, self.globals))
  File "/base/data/home/apps/s~sympy-live-hrd/66.426491309333028408/app/models.py", line 87, in <genexpr>
    for name, val in zip(self.global_names, self.globals))
  File "/base/alloc/tmpfs/dynamic_runtimes/python27g/32fc9e2909a8cd9/python27/python27_dist/lib/python2.7/pickle.py", line 1388, in loads
    return Unpickler(file).load()
TypeError: name should be a string, not <class 'sympy.core.symbol.Symbol'>

Please see attached screenshot for visual confirmation.
Screenshot from 2020-08-10 07-46-56

@oscarbenjamin
Copy link
Contributor

Okay now I see it. It's the second example on that doc page that fails

@catskillsresearch
Copy link
Author

Also Piecewise functions in Elementary. So basically the whole thing is probably busted:

https://docs.sympy.org/latest/modules/functions/elementary.html

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