Skip to content

Commit

Permalink
Generate default Object IDs when label column is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
haticekaratay committed Dec 20, 2024
1 parent d7d7439 commit 7799594
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions jdaviz/configs/imviz/plugins/catalogs/catalogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,8 @@ def search(self, error_on_fail=False):
row_info = {
'Right Ascension (degrees)': row['sky_centroid'].ra.deg,
'Declination (degrees)': row['sky_centroid'].dec.deg,
'Object ID': str(row.get('label', 'N/A')),
'id': idx,
'Object ID': str(row.get('label', f"{idx + 1}")),
'id': idx+1,
'x_coord': x_coord,
'y_coord': y_coord,
}
Expand Down
2 changes: 1 addition & 1 deletion jdaviz/core/template_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4698,7 +4698,7 @@ def float_precision(column, item):
elif isinstance(item, (np.float32, np.float64)):
return float(item)
elif isinstance(item, u.Quantity):
return {"value": item.value.tolist() if item.size > 1 else item.value, "unit": str(item.unit)}
return {"value": item.value.tolist() if item.size > 1 else item.value, "unit": str(item.unit)} # noqa: E501
elif isinstance(item, np.bool_):
return bool(item)
elif isinstance(item, np.ndarray):
Expand Down

0 comments on commit 7799594

Please sign in to comment.