# Show() in Python script triggers new Reader Object

**URL:** https://discourse.paraview.org/t/show-in-python-script-triggers-new-reader-object/5235
**Category:** Development
**Tags:** python
**Created:** [September 1, 2020, 12:52pm UTC](https://discourse.paraview.org/t/show-in-python-script-triggers-new-reader-object/5235 "2020-09-01T12:52:54Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![stefan\_m](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/b9e5f3/32.png) [@stefan\_m](https://discourse.paraview.org/u/stefan_m)
#### Post date: [September 1, 2020, 12:52pm UTC](https://discourse.paraview.org/t/show-in-python-script-triggers-new-reader-object/5235/1 "2020-09-01T12:52:54Z")

</div>

Hi there,

we develop our own Reader Plugin that can directly read in our compressed files into the ParaView workflow (pvpython from ParaView Prebuild Version 5.8.0; our plugin compiled with ParaView SuperBuild 5.8.0).  
When we use our Reader as part of a Python script, e.g. with pvpython, we found out, that the Show() creates a new instance of our reader and re-reads the already loaded data. (Calls to the constructor, RequestInformation() and RequestData() are performed.) Since our data is compressed, re-reading the data means re-decompressing it. Is there a way to avoid re-reading the data and just copy it from the initial reader instance?  
The initial instance of our reader can be deleted directly after executing the Show() command. For having a minimal memory footprint, this seems meaningful. Is it a good way to go?

Thank you very much in advance!

With best regards,  
Stefan

The Python code looks like (I replaced our reader by the EnSightReader):

```
//Initial instance:
incompressiblePisoFoamLesMotorBikeMotorBikecase = EnSightReader(CaseFileName='incompressiblePisoFoamLesMotorBikeMotorBike.case')
//Get active view
renderView1 = GetActiveViewOrCreate('RenderView')
//Show data in view: Show creates second instance of reader and returns it
incompressiblePisoFoamLesMotorBikeMotorBikecaseDisplay = Show(incompressiblePisoFoamLesMotorBikeMotorBikecase, renderView1, 'UnstructuredGridRepresentation')
//Destroy incompressiblePisoFoamLesMotorBikeMotorBikecase
Delete(incompressiblePisoFoamLesMotorBikeMotorBikecase)
del incompressiblePisoFoamLesMotorBikeMotorBikecase
```

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [September 15, 2020, 3:39pm UTC](https://discourse.paraview.org/t/show-in-python-script-triggers-new-reader-object/5235/2 "2020-09-15T15:39:14Z")

</div>

Show() doesn’t create an instance of a reader, but an instance of a representation.  
It is although when calling Show() that the data will be read for the first time.
