Grouping Plotfiles in Paraview

Does anyone have a satisfactory solution to consistently grouping plotfiles in paraview?

I am aware of @jmusser 's post on this from six years ago, but assume/hope this is no longer the best approach. Visualization of time series with Paraview · Issue #496 · AMReX-Codes/amrex

I also haven’t had any luck creating .series files Amrvis — amrex 25.06-dev documentation.

Let’s assume you have 10 plot files (plt00000, plt00100, … plt00900).

Start by loading the plt00000 plot file in ParaView and setup your scene. Next you have to manually setup the animation time series (View → Animation View).

Setup the end time to be the number of steps-1, and the number of frames to be the number of steps. Using the above example, these are 9 and 10.

Add a Python track and double-click to bring up the text editor.

Below is an example script with some comments. You’ll need modify it to account for your plot file base (here it’s plt) and the path to the directory containing the plot file directories.

from paraview.simple import *

def start_cue(self):

    # Modules used
    import os, glob

    # Make these global so that the tick() function can access them
    global reader, filenames   
    # Find the reader object. Match the name in the pipeline browser
    reader = FindSource("plt00000")   
    # Go to the directory where the plt files are. Adjust as needed
    os.chdir("/nfs/scr/1/jmusser/asure-reactor/runs/2024/1204/new/Plot_Files")

    # Get the names of all plt files and sort them.
    # Make sure nothing else start with plt in that dir    
    #filenames = sorted(glob.glob("plt*"), key=len)
    reader.FileNames = sorted(glob.glob("plt*"), key=len)

def tick(self):

    # Clock time will be a float matching
    # the time displayed in the animation bar
    reader.UpdatePipeline(time=self.GetClockTime())


def end_cue(self): pass

Not sure if this would help, but I am facing the same issue where I have a group of plt files and a bunch of plt directories that are not in the group:

I am using Paraview 6.0 on Joule. There are two icons on the top right: A gear icon image to toggle file details and an icon with two green dots to toggle file grouping image.

I found out that toggling this file grouping icon, sometimes many times back and forth, or toggling the gear icon eventually managed to correctly group the plt directories:

If you are still having this issue, this may be worth trying.

I was facing the same issue. Here is another option that i find useful. Paraview can read data.series JSON file containing the list of all plt* files in order. I use the following python script to generate data.series file.

import os
import json
import re

directory="."
prefix="plt"
extension=""
output_name="data.series"

"""
Scans a directory for files matching a prefix and extension,
and creates a ParaView .series JSON file.
"""
# 1. Gather all matching files
files = [f for f in os.listdir(directory) if f.startswith(prefix) and f.endswith(extension)]

# 2. Sort files numerically by extracting the first integer found in the filename
def extract_number(filename):
    numbers = re.findall(r'\d+', filename)
    return int(numbers[0]) if numbers else 0

files.sort(key=extract_number)

# 3. Build the ParaView series structure
series_data = {
    "file-series-version": "1.0",
    "files": []
}

for filename in files:
    time_val = extract_number(filename)
    series_data["files"].append({
        "name": filename,
        "time": time_val
    })

# 4. Write to JSON file
with open(output_name, "w") as f:
    json.dump(series_data, f, indent=4)

print(f"Successfully created {output_name} with {len(files)} entries.")

Run the above code in the directory containing plt files. Then, read the output data.series in Paraview like following:

File → Open →Select “All files” from the filter → Load the data.series file