Skip to content

Commit

Permalink
Fix bug in the default creation of VisMeta (#66)
Browse files Browse the repository at this point in the history
* Fixed bug in the default creation of VisMeta

* Add changelog file

* Fix changelog
  • Loading branch information
paolomassa authored May 28, 2024
1 parent 6fde63d commit dcd2a3e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 1 addition & 0 deletions changelog/66.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bug when creating :class:`~xrayvision.visibility.Visibilities` with default meta.
6 changes: 1 addition & 5 deletions xrayvision/visibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,6 @@ def __init__(
self._uv_key = "uv"
self._units_key = "units"

# Build meta. Make sure that phase center is included.
if not isinstance(meta, VisMetaABC):
meta = VisMeta(meta)

# Construct underlying data object.
dims = [f"dim{i}" for i in range(0, len(visibilities.shape))]
dims[_uv_axis] = self._uv_key
Expand All @@ -307,7 +303,7 @@ def __init__(
if phase_uncertainty is not None:
data[self._phase_uncert_key] = (dims, phase_uncertainty.to_value(phase.unit))
if meta is None:
meta = VisMeta(dict())
meta = VisMeta()
vis_labels = getattr(meta, "vis_labels", None)
if vis_labels is not None:
if len(vis_labels) != nvis:
Expand Down

0 comments on commit dcd2a3e

Please sign in to comment.