# Storing Time-dependent PartitionedDataSetCollection

**URL:** https://discourse.vtk.org/t/storing-time-dependent-partitioneddatasetcollection/14658
**Category:** Support
**Created:** [October 4, 2024, 9:55am UTC](https://discourse.vtk.org/t/storing-time-dependent-partitioneddatasetcollection/14658 "2024-10-04T09:55:53Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![vb\_19192](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/v/ed655f/32.png) [@vb\_19192](https://discourse.vtk.org/u/vb_19192)
#### Post date: [October 4, 2024, 9:55am UTC](https://discourse.vtk.org/t/storing-time-dependent-partitioneddatasetcollection/14658/1 "2024-10-04T09:55:53Z")

</div>

I am writing a data format that is made of a `vtkPartitionedDataSetCollection` containing multiple `vtkUnstructuredGrid`s. This data is time dependent, such that a `PartitionedDataSetCollection` can be generated for each time step. I currently do something along the following lines:

```auto
times = [0,1,2,3,4,5]

for time in times:
    # Returns a vtkPartitionedDataSetCollection
    collection = get_collection(data, time=time)
    writer = vtkXMLPartitionedDataSetCollectionWriter()
    writer.SetInputData(collection)
    output_file = f"test_{time}.vtpc"
    writer.SetFileName(output_file)
    writer.Write()

```

This creates a separate file for each time step which is not optimal. How can I go about storing this time dependent data? Do I need to use the VTKHDF format to achieve this? Thanks!
