commit/galaxy-central: jgoecks: Handle NaN values to produce correct JSON in data providers.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/82af6b933a0a/ changeset: 82af6b933a0a user: jgoecks date: 2012-01-05 00:01:04 summary: Handle NaN values to produce correct JSON in data providers. affected #: 1 file diff -r f46d856dc0db590109a59fbdddf892ddc8785679 -r 82af6b933a0af1c4af0958aa378af846e7efc449 lib/galaxy/visualization/tracks/data_providers.py --- a/lib/galaxy/visualization/tracks/data_providers.py +++ b/lib/galaxy/visualization/tracks/data_providers.py @@ -3,7 +3,7 @@ """ import sys, time -from math import ceil, log, sqrt +from math import ceil, log, sqrt, isnan import pkg_resources pkg_resources.require( "bx-python" ) if sys.version_info[:2] == (2, 4): @@ -1041,13 +1041,21 @@ # Add filter data to payload. for col in filter_cols: if col == "Score": - try: - payload.append( float( feature.score ) ) + try: + f = float( feature.score ) + if not math.isnan( f ): + payload.append( f ) + else: + payload.append( feature.score ) except: payload.append( feature.score ) elif col in feature.attributes: try: - payload.append( float( feature.attributes[col] ) ) + f = float( feature.attributes[col] ) + if not math.isnan( f ): + payload.append( f ) + else: + payload.append( feature.attributes[col] ) except: # Feature is not a float. payload.append( feature.attributes[col] ) Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket