I2PC/xmipp

Union with empty set results in empty set

oierlauzi opened this issue · 4 comments

Performing xmipp_metadata_utility -i <md1> --set union <md2> with <md1> being an empty set and <md2> being a non-empty set results in an empty set. union_all also does the same. I don't know if this behavior is for some reason or it is a bug.

Mathematically this is not correct:
imagen

Here is a minimal case:
md1.xmd:

data_noname
loop_
_itemId

md2.xmd:

data_noname
loop_
_itemId
1
2
3
4

xmipp_metadata_utility -i md1.xmd --set union md2.xmd:

data_noname
loop_
_itemId

xmipp_metadata_utility -i md2.xmd --set union md1.xmd: (OK)

data_noname
loop_
_itemId
1
2
3
4

In fact, when adding -o <mdOut> parameter, the output file is not created if the input is empty. This is the actual root cause of the previous problem. For any empty input metadata, the output is not created, regardless of the operation performed.

Fixed #714
Issue closed.