[petsc-dev] How come petsc4py objects do not handle attributes in the "standard" way?

Barry Smith bsmith at petsc.dev
Mon Mar 6 20:18:36 CST 2023


  How come petsc4py has the (nonstandard?) v.setAttr('name',value) and v.getAttr('name') instead of v.name notation? Could they be refactored to have "normal" attribute behavior? If not, could a v.hasAttr('name') be added? 

  Similarly, how come numpy arrays seem to have no way to set attributes on them? 

  PyTorch tensors seem to support the standard t.name handling of attributes.

   Thanks 


More information about the petsc-dev mailing list