New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"integral field without a specified null value" in BINARY2 VOTable #16090
Comments
(Addressing astropy#16090) - Something possibly overlooked in the VOTable 1.3 support implementation Error in question that was fixed: astropy.io.votable.exceptions.W31: ?:?:?: W31: NaN given in an integral field without a specified null value In the `_write_binary` method, it seems we are ignoring the fact that the mask for binary2 serialization was already handled before unnecessarily passing the `array_mask` (making the handling useless). This causes an error that would make more sense to be shown in the case of a Binary serialization and not a Binary2 because the bit array indicating the mask is already written to the data stream.
Managed to get it to work, I think I found the problem here. It looks like in _write_binary, we are ignoring the fact that the mask for binary2 serialization was already handled before unnecessarily passing the array_mask (making the handling useless). I added a simple if-condition as a fix, and I can submit a pull request right now. |
thanks for reporting this !
I'm not an expert in VOTable but I had a look and I don't think that's going to be straightforward.
I thought about it in a vacuum, and I think a solution would be to subclass class IntBin2(Int):
null = ... # insert appropriate value and use this with |
Description
When writing VOTable, astropy refuses to write NULL integers with
even when serialising to BINARY2, which has been created specifically to avoid trouble of this sort.
Expected behavior
A VOTable should be written with the appropriate mask set.
How to Reproduce
Here's a reproducer; only the last four lines actually contain
interesting code, the rest is scaffolding:
The thing fails in the integer's binoutput:
Somehow, one would need to introduce a switch here so the inner condition only fires when not using BINARY2. I was hoping someone here knows a straightforward way to do that -- is there?
Versions
The text was updated successfully, but these errors were encountered: