Comments (5)
This is a known bug (#78) and its on the list to-be-killed. Thanks for putting some weight on it!
The workaround is for the moment to set all objects you used to store blocks, data_arrays, files, etc explicitly to None before re-assigning values to it. The following code should work:
file = nix.File.open('foo.h5', nix.FileMode.Overwrite)
file = None
file = nix.File.open('foo.h5', nix.FileMode.Overwrite)
from nixpy.
While risking to sound pretentious id like to point out that it might not be the same issue as \
nix_file = nix.File.open('foo.h5', nix.FileMode.ReadWrite)
nix_file = nix.File.open('foo.h5', nix.FileMode.ReadWrite)
does actually work.
I think it might just be that its not possible to overwrite and open h5 file. If this were the case then i think nixpy should simply sthrough a proper error.
from nixpy.
I am still not sure what exactly is going on in issue #78 but what is going on here is what @cgars already wrote (I think), i.e. that by the time you open the same file in overwrite mode (e.g. the right side of the statement) the file on the right is still open and therefore it doesn't work.
from nixpy.
The current version of nix/nixpy now behaves like this:
nix_file = nix.File.open('foo.h5', nix.FileMode.Overwrite)
nix_file = nix.File.open('foo.h5', nix.FileMode.Overwrite)
This throws a RuntimeError
because an opened file is opened again with truncate mode. I think this is the correct behavior. Reopen a file with other open modes works, which is also OK.
To reopen a file with truncate mode it has to be closed properly. This can be done with close
, or by assigning None
:
file = nix.File.open('foo.h5', nix.FileMode.Overwrite)
file = None
file = nix.File.open('foo.h5', nix.FileMode.Overwrite)
file = nix.File.open('foo.h5', nix.FileMode.Overwrite)
file.close()
file = nix.File.open('foo.h5', nix.FileMode.Overwrite)
Therefore I suggest to close this issue as well as #78.
from nixpy.
I cross-checked and agree to close this issue.
from nixpy.
Related Issues (20)
- Catch exception for old boolean type HOT 1
- (Multi)Tag extent clarification HOT 1
- Convert string columns in DataFrame data
- Disable check for __eq__ on subclasses
- Refactor object creation HOT 1
- New Tag data retrieval behaviour (inclusive vs exclusive)
- Broken references for nested Source HOT 2
- AliasRangeDimension documentation and simplification HOT 2
- Tagged data from a DataArray with polynom_coefficients and "alias" RangeDimension
- MultiTag.tagged_data: OOB and non-intuitive slicing HOT 1
- Upgrading 1.4.9 files fail HOT 1
- Changing property raises exception in 1.5.0 HOT 5
- Clarification: Bindings for C++ NIX HOT 2
- Error upgrading file on py3.6 HOT 2
- Creating a block with only "name" provided ignores the "name" value HOT 4
- [Block] Inconsistent ValueError/DuplicateName exception
- Container item delete methods HOT 1
- HDF5 RuntimeError on second+ level Section copy
- 1.5.1 Autogenerated release tars still say "dev" instead of release HOT 2
- Automatic conversion of metadata to np.str_ HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nixpy.