You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AttributeError Traceback (most recent call last)
PIC_coords = tempSwarm.getField("DMSwarmPIC_coor").reshape(-1, self.dim)
PIC_cellid = tempSwarm.getField("DMSwarm_cellid")
AttributeError: 'tuple' object has no attribute 'reshape'
The swarm field data obtained from the function .getField() in FETSC used to be an array([]), but in the new version of PETSC, it becomes a tuple (array([]), dim). Easy to be fixed in related scripts (swam.py and discretisation.py) as:
So, I had complaints about this and was going to go back to a simple array with the dimensions already in it so you do not have to reshape. I will try and mail once that lands so we can switch back to the sensible interface. Sorry about the churn.
So, I had complaints about this and was going to go back to a simple array with the dimensions already in it so you do not have to reshape. I will try and mail once that lands so we can switch back to the sensible interface. Sorry about the churn.
Thanks for the update and your efforts to resolve the concerns.
Neng, many ways around this so that we can cope with users installing any version they like. Catch the return value and see if it is a tuple, or try / except, or use the PETSc version to see what needs to be done.
Branch tested: development
PETSc version: 3.15.0; 3.22.0
Python version: 3.11; 3.12
Issue description:
Error:
The swarm field data obtained from the function .getField() in FETSC used to be an array([]), but in the new version of PETSC, it becomes a tuple (array([]), dim). Easy to be fixed in related scripts (swam.py and discretisation.py) as:
Code to test:
The text was updated successfully, but these errors were encountered: