# Porting python adapter to preCICE 2

**URL:** <https://precice.discourse.group/t/porting-python-adapter-to-precice-2/173>\
**Category:** Using preCICE\
**Tags:** python\
**Created:** [March 11, 2020, 10:10am UTC](https://precice.discourse.group/t/porting-python-adapter-to-precice-2/173 "2020-03-11T10:10:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Claudio](https://avatars.discourse-cdn.com/v4/letter/c/7cd45c/32.png) [@Claudio](https://precice.discourse.group/u/Claudio)\
**Post date:** [March 11, 2020, 10:10am UTC](https://precice.discourse.group/t/porting-python-adapter-to-precice-2/173/1 "2020-03-11T10:10:09Z")

</div>

Hi,  
I am trying to port my python adapter to precice 2, and I am following the guide here: [https://github.com/precice/python-bindings/blob/develop/docs/MigrationGuide.md](https://github.com/precice/python-bindings/blob/develop/docs/MigrationGuide.md)  
afaik, in the new python bindings, data like interface grid, forces and diplacements are now 2D numpy arrays. This seems to work for the mesh grid and when I try to write: i.,e.  
interface.write\_block\_vector\_data(self.forceID, self.nodeVertexIDs, self.force)  
but, if I try something like:  
interface.read\_block\_vector\_data(self.displacementID, self.displacement)  
I got: File “precice.pyx”, line 1015, in precice.Interface.read\_block\_vector\_data  
ValueError: Buffer has wrong number of dimensions (expected 1, got 2)  
should I ravel/reshape the array?  
Thanks  
Claudio

---

<div class="post-metadata">

**Author:** ![Claudio](https://avatars.discourse-cdn.com/v4/letter/c/7cd45c/32.png) [@Claudio](https://precice.discourse.group/u/Claudio)\
**Post date:** [March 11, 2020, 1:20pm UTC](https://precice.discourse.group/t/porting-python-adapter-to-precice-2/173/2 "2020-03-11T13:20:36Z")

</div>

Sorry, I made the wrong call.  
It should be displacement = interface.read\_block\_vector\_data(self.displacementID, self.nodeVertexIDs)
