clawpack / pyclaw

PyClaw is a Python-based interface to the algorithms of Clawpack and SharpClaw. It also contains the PetClaw package, which adds parallelism through PETSc.
http://www.clawpack.com/pyclaw
BSD 3-Clause "New" or "Revised" License
164 stars 99 forks source link

Give a more helpful error message if petsc4py is not installed. #705

Closed ketch closed 1 year ago

ketch commented 1 year ago

The code always tries to import the petsc format reading/writing routines at import time, and we don't want all of pyclaw to fail if petsc4py is not installed, so no error is raised then (only a debug log message). Then when the user tries to read a file in petsc format, they get a cryptic message. This patch checks if petsc4py is installed and informs the user of the problem (but only if/when they try to read a petsc formatted file).