Dump Files Always as NPZ Not HDF5

87 views
Skip to first unread message

alom...@gmail.com

unread,
Jun 30, 2022, 1:24:23 PM6/30/22
to pysph-users
Hello,

   I have a Python script that can read NPZ files and automated post-processing for me. However, I am running pysph in a new computer cluster and the output files are being dumped in HDF5, which I am having a hard time converting to use with my script (which in turns uses Paraview). Any way we can tell pysph to dump files in NPZ instead of HDF5? Otherwise, does anyone know an easy way to convert the HDF5 files to VTk (VTU) or NPZ files?

Thank you so much for your help!
Alomir

mutaa...@gmail.com

unread,
Jul 1, 2022, 1:49:14 AM7/1/22
to pysph-users
Hi Alomir,

I don't think there is an option to choose between hdf5 and npz. PySPH checks for the package h5py and uses the hdf5 format (see, https://github.com/pypr/pysph/blob/master/pysph/__init__.py#L69), and if the package is not available it uses the npz format (see, https://github.com/pypr/pysph/blob/master/pysph/solver/output.py#L345). So, you could either remove the h5py package (unless you are using it for some other purpose) or change the has_h5py function as you see fit.

That said, you can easily convert hdf5 or npz files to vtk/vtu using the write_vtk function (https://github.com/pypr/pysph/blob/master/pysph/tools/pysph_to_vtk.py) which is also available from the command line by doing pysph dump_vtk XXX_folder_name.

Cheers,
Abhinav

Alomir Favero

unread,
Jul 1, 2022, 8:08:35 AM7/1/22
to mutaa...@gmail.com, pysph-users
Dear Abhinav,

  Thank you so much for the tip and the information provided. I really appreciate it!

Stay safe,
Alomir

--
You received this message because you are subscribed to a topic in the Google Groups "pysph-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pysph-users/I-2s1-0RA9Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pysph-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pysph-users/caad77f9-43db-4ed4-824d-9c13711a6710n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages