OSError: Can't prepare for writing data (No write intent on file)
Closed this issue · 1 comments
here I use the pyexodus to change the mesh files(.e) node values, there are some mistakes need your help
data=exodus('SphericalChunk3D_csem_30_1.e',mode='r’)
data.put_node_variable_values('VPV',1,VpvNew[0])
OSError Traceback (most recent call last)
in ()
----> 1 data.put_node_variable_values('VPV',1,VpvNew[0])
/anaconda3/envs/lasif/lib/python3.6/site-packages/pyexodus/core.py in put_node_variable_values(self, name, step, values)
553
554 d_name = "vals_nod_var%i" % idx
--> 555 self._f.variables[d_name][step - 1] = values
556
557 def get_node_variable_values(self, name, step):
/anaconda3/envs/lasif/lib/python3.6/site-packages/h5netcdf/core.py in setitem(self, key, value)
127
128 def setitem(self, key, value):
--> 129 self._h5ds[key] = value
130
131 @Property
h5py/_objects.pyx in h5py._objects.with_phil.wrapper (/Users/mikaelmortensen/anaconda2/conda-bld/osx-host_1490718644237/work/h5py-2.6.0/h5py/_objects.c:3195)()
h5py/_objects.pyx in h5py._objects.with_phil.wrapper (/Users/mikaelmortensen/anaconda2/conda-bld/osx-host_1490718644237/work/h5py-2.6.0/h5py/_objects.c:3153)()
/anaconda3/envs/lasif/lib/python3.6/site-packages/h5py/_hl/dataset.py in setitem(self, args, val)
616 mspace = h5s.create_simple(mshape_pad, (h5s.UNLIMITED,)*len(mshape_pad))
617 for fspace in selection.broadcast(mshape):
--> 618 self.id.write(mspace, fspace, val, mtype, dxpl=self._dxpl)
619
620 def read_direct(self, dest, source_sel=None, dest_sel=None):
h5py/_objects.pyx in h5py._objects.with_phil.wrapper (/Users/mikaelmortensen/anaconda2/conda-bld/osx-host_1490718644237/work/h5py-2.6.0/h5py/_objects.c:3195)()
h5py/_objects.pyx in h5py._objects.with_phil.wrapper (/Users/mikaelmortensen/anaconda2/conda-bld/osx-host_1490718644237/work/h5py-2.6.0/h5py/_objects.c:3153)()
h5py/h5d.pyx in h5py.h5d.DatasetID.write (/Users/mikaelmortensen/anaconda2/conda-bld/osx-host_1490718644237/work/h5py-2.6.0/h5py/h5d.c:4026)()
h5py/_proxy.pyx in h5py._proxy.dset_rw (/Users/mikaelmortensen/anaconda2/conda-bld/osx-host_1490718644237/work/h5py-2.6.0/h5py/_proxy.c:2373)()
h5py/_proxy.pyx in h5py._proxy.H5PY_H5Dwrite (/Users/mikaelmortensen/anaconda2/conda-bld/osx-host_1490718644237/work/h5py-2.6.0/h5py/_proxy.c:2083)()
OSError: Can't prepare for writing data (No write intent on file)
here the VpvNew[0] is
array([6216.08840868, 6194.08439874, 6242.58961137, ..., 6395.6677659 ,
6344.20862992, 6368.94750605])
If you want to write something you of course cannot open the file in read-only mode.