question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

votable providing null string value, zeros getting chopped off

See original GitHub issue

Hi,

My colleague (@rjavila) has run into what might be a bug with the votable package… I’ve tried to track it down but I kind of ended up going in circles…

He’s setting up a votable column (actually multiple, but all have the same problem) and adding the values info as follows:

f160w_mag = tree.Field(myvotable,name='F160W',datatype='double',ucd='phot.mag;em.IR.H',unit='mag',width='6',precision='3')

f160w_mag.values = tree.Values(myvotable, f160w_mag,null='-99.000')

The problem is when he then writes out the votable to an xml file the .000 get’s chopped off to .0:

<FIELD ID="f160w_mag" datatype="double" name="f160w_mag" precision="3" ucd="phot.mag;em.IR.H" unit="mag" width="6"> <VALUES null="-99.0"/>

It seems like it might be an issue of python rounding, assuming it gets converted from string->double->string (not sure if that’s happening here)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
pllimcommented, Feb 3, 2017

Offline discussions came to the conclusion that Astropy is not the cause of the bug.

0reactions
pllimcommented, Feb 3, 2017

Just for the record, the data type is set as double, so null is converted to double. It is deliberately done in the code and does not appear to be a bug. @rjavila is going to investigate how the comparison is being done on his side.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - How can I pad nullable ints with zeros? - Stack Overflow
An int has never leading zeros, it just has a value. A string representation of an ìnt can have them. You can use...
Read more >
The option of handling NULL as zero values instead of pgx/sql ...
Hello, I'm sure this have been brought up numerous, numerous times as it's quite an issue with how Go traditionally deals with NULL...
Read more >
Null, empty string, or zero? - Tim Mitchell
In this post, ETL veteran Tim Mitchell describes the problems inherent in handling null, empty string, or zero values during and after the ......
Read more >
TOPCAT - Tool for OPerations on Catalogues And Tables
The default value is null (auto-determination). This usually works OK, but can get into trouble if all the columns look like string values....
Read more >
Comparing the Semantics of Null, Zero, and Empty String in ...
Much like Zero, an Empty String ("") differs from a NULL value in that the former specifically implies that the value was set...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found