Comments (5)
Hi Ajay,
unfortunately I cannot reproduce this bug. The following code throws the expected Exception:
import nix
f = nix.File.open('test.h5', nix.FileMode.Overwrite)
f.create_block('Test', 'test_type')
for i in range(100):
try:
f.create_block('Test', 'test_type')
except Exception, e:
print(str(i) + ': ' + str(e))
0: Duplicate name given - names have to be unique for a given entity type & parent. (createBlock)
1: Duplicate name given - names have to be unique for a given entity type & parent. (createBlock)
2: Duplicate name given - names have to be unique for a given entity type & parent. (createBlock)
3: Duplicate name given - names have to be unique for a given entity type & parent. (createBlock)
4: Duplicate name given - names have to be unique for a given entity type & parent. (createBlock)
5: Duplicate name given - names have to be unique for a given entity type & parent. (createBlock)
...
96: Duplicate name given - names have to be unique for a given entity type & parent. (createBlock)
97: Duplicate name given - names have to be unique for a given entity type & parent. (createBlock)
98: Duplicate name given - names have to be unique for a given entity type & parent. (createBlock)
99: Duplicate name given - names have to be unique for a given entity type & parent. (createBlock)
Could you try this out or provide a code snippet that produces the error?
Best,
Jan
from nixpy.
Ups, at least half of my brain was asleep... However, the same is holds for multi_tags:
import numpy as np
import nix
f = nix.File.open('test.h5', nix.FileMode.Overwrite)
x = np.random.randn(1000)
b = f.create_block('Test', 'test')
da = b.create_data_array('test', 'test', data=x)
b.create_multi_tag('test','test_type', da)
for i in range(100):
try:
b.create_multi_tag('test', 'test_type', da)
except Exception, e:
print(str(i) + ': ' + str(e))
gives me 100 correct exceptions.
from nixpy.
Yes this I think is correct behaviour. The reason is as written in the message. Or do we misunderstand your problem?
from nixpy.
Hello Jan and Balint
Here is a small test class(testFile.py) and test script(testMultipleRuns.py).
https://copy.com/uqN1iXlyIQTR0s7G
It seems that the error message depends on the commands which are run before attempting to add a duplicate-name multitag.
Maybe there is something wrong in the way I am using NIX. If so, I would appeciate your suggestions.
Thanks and Cheers
Ajay
from nixpy.
Hi Ajay, after some digging I gave up on finding the cause for this problem. On the C++ side, the exceptions are correctly thrown and contain a correct error message. On the python side they sometimes loose their messages.
I created explicit transforms that map the nix::C++ exceptions to python errors. In case of empty messages, a standard error message is provided giving at least an idea what went wrong. (see pull request #119.
Thanks again for your bug report and the code!
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.