Closed guyer closed 6 months ago
>>> import fipy as fp >>> mesh = fp.Grid2D(nx=3, ny=4) >>> mesh.cellCenters[0] Traceback (most recent call last): File ~/mambaforge-arm/envs/fipy311/lib/python3.11/site-packages/IPython/core/formatters.py:699 in __call__ return repr(obj) File ~/Documents/research/FiPy/fipy/fipy/variables/operatorVariable.py:307 in __repr__ return self._getRepresentation() File ~/Documents/research/FiPy/fipy/fipy/variables/operatorVariable.py:87 in _getRepresentation representation = self._py3kInstructions(op=self.op, style=style, argDict=argDict, id=id, freshen=freshen) File ~/Documents/research/FiPy/fipy/fipy/variables/operatorVariable.py:211 in _py3kInstructions stack.append(stack.pop(-2) + "[" + stack.pop() + "]") TypeError: can only concatenate str (not "int") to str
The stack.pop() needs to be wrapped in str(), or the whole thing should use f-string formatting.
stack.pop()
str()
The
stack.pop()
needs to be wrapped instr()
, or the whole thing should use f-string formatting.