# How to loop over PartitionedDataSets in a ParatitionedDataSetCollection in paraview.simple

**URL:** https://discourse.paraview.org/t/how-to-loop-over-partitioneddatasets-in-a-paratitioneddatasetcollection-in-paraview-simple/16515
**Category:** ParaView Support
**Tags:** python
**Created:** [April 22, 2025, 6:18pm UTC](https://discourse.paraview.org/t/how-to-loop-over-partitioneddatasets-in-a-paratitioneddatasetcollection-in-paraview-simple/16515 "2025-04-22T18:18:01Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Alexandre\_Minot](https://discourse.paraview.org/user_avatar/discourse.paraview.org/alexandre_minot/32/7132_2.png) [@Alexandre\_Minot](https://discourse.paraview.org/u/Alexandre_Minot)
#### Post date: [April 22, 2025, 6:18pm UTC](https://discourse.paraview.org/t/how-to-loop-over-partitioneddatasets-in-a-paratitioneddatasetcollection-in-paraview-simple/16515/1 "2025-04-22T18:18:01Z")

</div>

Hello,

I am looking to loop over PartitionedDataSets in a ParatitionedDataSetCollection in paraview.simple. I cannot figure out how. Take the code bellow that uses the example source. How do I get the min and max value of the point variable “Scalars”?

Thanks,  
Alexandre

```auto
# script-version: 2.0
# Catalyst state generated using paraview version 5.13.3
import paraview
paraview.compatibility.major = 5
paraview.compatibility.minor = 13

#### import the simple module from the paraview
from paraview.simple import *
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()

# ----------------------------------------------------------------
# setup the data processing pipelines
# ----------------------------------------------------------------

# create a new 'PartitionedDataSetCollection Source'
source = PartitionedDataSetCollectionSource(registrationName='PartitionedDataSetCollectionSource1')

# ----------------------------------------------------------------
# restore active source
SetActiveSource(vTPC1)
# ----------------------------------------------------------------

# ------------------------------------------------------------------------------
# Catalyst options
from paraview import catalyst
options = catalyst.Options()
options.GlobalTrigger = 'Time Step'
options.CatalystLiveTrigger = 'Time Step'

# ------------------------------------------------------------------------------
if __name__ == ' __main__':
    from paraview.simple import SaveExtractsUsingCatalystOptions
    # Code for non in-situ environments; if executing in post-processing
    # i.e. non-Catalyst mode, let's generate extracts using Catalyst options
    SaveExtractsUsingCatalystOptions(options)

```

---

<div class="post-metadata">

### Author: ![Christos\_Tsolakis](https://discourse.paraview.org/user_avatar/discourse.paraview.org/christos_tsolakis/32/4450_2.png) [@Christos\_Tsolakis](https://discourse.paraview.org/u/Christos_Tsolakis)
#### Post date: [April 22, 2025, 6:52pm UTC](https://discourse.paraview.org/t/how-to-loop-over-partitioneddatasets-in-a-paratitioneddatasetcollection-in-paraview-simple/16515/2 "2025-04-22T18:52:20Z")

</div>

> How do I get the min and max value of the point variable “Scalars”?

```auto
source.UpdatePipeline()
print(source.GetDataInformation().GetPointDataInformation().GetArrayInformation(3).GetName())
print(source.GetDataInformation().GetPointDataInformation().GetArrayInformation(3).GetComponentRange(0))

```

> I am looking to loop over PartitionedDataSets in a ParatitionedDataSetCollection in paraview.simple

Since the data are in the server you will need first the [Fetch](https://www.paraview.org/paraview-docs/nightly/python/paraview.servermanager.html#paraview.servermanager.Fetch) the data and then a loop like this [https://gitlab.kitware.com/vtk/vtk/-/blob/v9.4.0/Common/DataModel/Testing/Python/TestPartitionedData.py#L190](https://gitlab.kitware.com/vtk/vtk/-/blob/v9.4.0/Common/DataModel/Testing/Python/TestPartitionedData.py#L190)

Make sure that this is what you really need because it will bring **all** the data to the client.

I would recommend to use the datainformation method above or create a programmable filter (which runs on the server so, no data movement) and return only what you need with a table or trivial dataset like `IntegrateVariables` does.

---

<div class="post-metadata">

### Author: ![Alexandre\_Minot](https://discourse.paraview.org/user_avatar/discourse.paraview.org/alexandre_minot/32/7132_2.png) [@Alexandre\_Minot](https://discourse.paraview.org/u/Alexandre_Minot)
#### Post date: [April 22, 2025, 6:57pm UTC](https://discourse.paraview.org/t/how-to-loop-over-partitioneddatasets-in-a-paratitioneddatasetcollection-in-paraview-simple/16515/3 "2025-04-22T18:57:43Z")

</div>

Thanks for your answer. What is the meaning of 3 in GetArrayInformation(3)?

Indeed, I’ve been struggling specifically because I didn’t want to fetch, so most of the documentation / help I find does not apply to the proxy.

---

<div class="post-metadata">

### Author: ![Alexandre\_Minot](https://discourse.paraview.org/user_avatar/discourse.paraview.org/alexandre_minot/32/7132_2.png) [@Alexandre\_Minot](https://discourse.paraview.org/u/Alexandre_Minot)
#### Post date: [April 22, 2025, 7:02pm UTC](https://discourse.paraview.org/t/how-to-loop-over-partitioneddatasets-in-a-paratitioneddatasetcollection-in-paraview-simple/16515/4 "2025-04-22T19:02:57Z")

</div>

Okay, 3 is the array index.

Does this give the range over all partitions? Because here, we only have one partition, and it is only one level down. What if we have n partitions? What if partitions are nested multiple levels beneath the root node?

Thanks

---

<div class="post-metadata">

### Author: ![Alexandre\_Minot](https://discourse.paraview.org/user_avatar/discourse.paraview.org/alexandre_minot/32/7132_2.png) [@Alexandre\_Minot](https://discourse.paraview.org/u/Alexandre_Minot)
#### Post date: [April 22, 2025, 7:16pm UTC](https://discourse.paraview.org/t/how-to-loop-over-partitioneddatasets-in-a-paratitioneddatasetcollection-in-paraview-simple/16515/5 "2025-04-22T19:16:15Z")

</div>

For instance, what is the issue here? It’s still a `vtkPartitionedDataSetCollection`.

```auto

boy = ExtractBlock(registrationName='boy', Input=source)
boy.Selectors = ["Root/Boy"]
print(boy.GetDataInformation().GetDataSetTypeAsString())
print(boy.GetDataInformation().GetPointDataInformation().GetArrayInformation("Scalars").GetComponentRange(0))

```

---

<div class="post-metadata">

### Author: ![Christos\_Tsolakis](https://discourse.paraview.org/user_avatar/discourse.paraview.org/christos_tsolakis/32/4450_2.png) [@Christos\_Tsolakis](https://discourse.paraview.org/u/Christos_Tsolakis)
#### Post date: [April 22, 2025, 7:44pm UTC](https://discourse.paraview.org/t/how-to-loop-over-partitioneddatasets-in-a-paratitioneddatasetcollection-in-paraview-simple/16515/6 "2025-04-22T19:44:59Z")

</div>

> [@Alexandre\_Minot](#):
>
> Does this give the range over all partitions? Because here, we only have one partition, and it is only one level down. What if we have n partitions? What if partitions are nested multiple levels beneath the root node?

It should iterate and give you the actual “global” min/max. The only exception is Catalyst/pvbatsch symmetric where you will get global min/max per rank.

> [@Alexandre\_Minot](#):
>
> boy = ExtractBlock(registrationName=‘boy’, Input=source)  
> boy.Selectors = [“Root/Boy”]  
> print(boy.GetDataInformation().GetDataSetTypeAsString())  
> print(boy.GetDataInformation().GetPointDataInformation().GetArrayInformation(“Scalars”).GetComponentRange(0))

First, you need to call `UpdatePipeline()` before Getting the information.  
Also tracing(Tools\>Start Trace) my steps in ParaView I noticed that I had to switch the assembly dropdown to “Hierarchy”. This is the working code

```auto
boy = ExtractBlock(registrationName='boy', Input=source)
boy.Assembly='Hierarchy'
boy.Selectors = ["Root/Boy"]
boy.UpdatePipeline()
print(boy)
print(boy.GetDataInformation().GetDataSetTypeAsString())
print(boy.GetDataInformation().GetNumberOfPoints())
print(boy.GetDataInformation().GetPointDataInformation().GetArrayInformation("Scalars").GetComponentRange(0))

```

---

<div class="post-metadata">

### Author: ![Alexandre\_Minot](https://discourse.paraview.org/user_avatar/discourse.paraview.org/alexandre_minot/32/7132_2.png) [@Alexandre\_Minot](https://discourse.paraview.org/u/Alexandre_Minot)
#### Post date: [April 22, 2025, 8:10pm UTC](https://discourse.paraview.org/t/how-to-loop-over-partitioneddatasets-in-a-paratitioneddatasetcollection-in-paraview-simple/16515/7 "2025-04-22T20:10:55Z")

</div>

Thanks for you help Christos.
