jcrist / codegen_talk Goto Github PK
View Code? Open in Web Editor NEWTalk for PyMNtos on code generation in SymPy
Talk for PyMNtos on code generation in SymPy
Hi Jim, I'm getting the following error in the notebook at the In[5]: print(ccode(mat_expr, assign_to=y)).
Does this look familiar?
sympy.version
'0.7.5'
numpy.version
'1.8.2'
❯❯❯ python --version
Python 2.7.6
AttributeError Traceback (most recent call last)
in ()
----> 1 print(ccode(mat_expr, assign_to=y))
/home/cekees/proteus/linux2/lib/python2.7/site-packages/sympy/printing/ccode.pyc in ccode(expr, assign_to, **settings)
277
278 """
--> 279 return CCodePrinter(settings).doprint(expr, assign_to)
280
281
/home/cekees/proteus/linux2/lib/python2.7/site-packages/sympy/printing/ccode.pyc in doprint(self, expr, assign_to)
91 lines.append("}")
92 else:
---> 93 code0 = self._doprint_a_piece(expr, assign_to)
94 lines.extend(code0)
95
/home/cekees/proteus/linux2/lib/python2.7/site-packages/sympy/printing/codeprinter.pyc in _doprint_a_piece(self, expr, assign_to)
37 # Setup loops over non-dummy indices -- all terms need these
38 if self._settings.get('contract', True):
---> 39 indices = self.get_expression_indices(expr, assign_to)
40 else:
41 indices = []
/home/cekees/proteus/linux2/lib/python2.7/site-packages/sympy/printing/codeprinter.pyc in get_expression_indices(self, expr, assign_to)
111 def get_expression_indices(self, expr, assign_to):
112 from sympy.tensor import get_indices, get_contraction_structure
--> 113 rinds, junk = get_indices(expr)
114 linds, junk = get_indices(assign_to)
115
/home/cekees/proteus/linux2/lib/python2.7/site-packages/sympy/tensor/index_methods.pyc in get_indices(expr)
235 elif expr is None:
236 return set(), {}
--> 237 elif expr.is_Atom:
238 return set(), {}
239 elif isinstance(expr, Idx):
/home/cekees/proteus/linux2/lib/python2.7/site-packages/sympy/matrices/matrices.pyc in getattr(self, attr)
3037 else:
3038 raise AttributeError(
-> 3039 "%s has no attribute %s." % (self.class.name, attr))
3040
3041 def integrate(self, *args):
AttributeError: MutableDenseMatrix has no attribute is_Atom.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.