Skip to content

Commit

Permalink
✏️
Browse files Browse the repository at this point in the history
arafune committed Mar 11, 2024
1 parent e192b5b commit 21b1a6e
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/arpes/endstations/plugin/ANTARES.py
Original file line number Diff line number Diff line change
@@ -146,7 +146,7 @@ def load_top_level_scan(
except IndexError:
pass

ds = xr.Dataset(dict([[f"spectrum-{spectrum_index}", dr]]))
ds = xr.Dataset({f"spectrum-{spectrum_index}": dr})

for binding in bindings:
binding.write_to_dataset(ds)
2 changes: 1 addition & 1 deletion src/arpes/endstations/plugin/MAESTRO.py
Original file line number Diff line number Diff line change
@@ -323,7 +323,7 @@ def lookup(name: str):
scan_coord_name = long

if scan_coord_name:
data = data.rename(dict([[scan_coord_name, d_name]]))
data = data.rename({scan_coord_name: d_name})
data = data.assign_coords(
**{
d_name: -c_short - c_long,
2 changes: 1 addition & 1 deletion src/arpes/endstations/plugin/kaindl.py
Original file line number Diff line number Diff line change
@@ -241,7 +241,7 @@ def attach_attr(data: xr.Dataset, attr_name: str, as_name: str) -> xr.Dataset:
dims=non_spectrometer_dims,
)

data = xr.merge([data, xr.Dataset(dict([[as_name, attributes_arr]]))])
data = xr.merge([data, xr.Dataset({as_name: attributes_arr})])

return data

2 changes: 1 addition & 1 deletion src/arpes/io.py
Original file line number Diff line number Diff line change
@@ -203,7 +203,7 @@ def stitch(
value = loaded_file.attrs[attr_or_axis]
elif attr_or_axis in loaded_file.coords:
value = loaded_file.coords[attr_or_axis]
loaded_file = loaded_file.assign_coords(dict([[built_axis_name, value]]))
loaded_file = loaded_file.assign_coords({built_axis_name: value})
if sort:
loaded.sort(key=lambda x: x.coords[built_axis_name])
assert isinstance(loaded, Iterable)
2 changes: 1 addition & 1 deletion src/arpes/utilities/qt/data_array_image_view.py
Original file line number Diff line number Diff line change
@@ -62,7 +62,7 @@ def __init__(
axis_or = "bottom" if orientation == PlotOrientation.Horizontal else "left"
self._coord_axis = CoordAxis(dim_index=0, orientation=axis_or)

super().__init__(*args, axisItems=dict([[axis_or, self._coord_axis]]), **kwargs)
super().__init__(*args, axisItems={axis_or: self._coord_axis}, **kwargs)

def plot(
self,
4 changes: 2 additions & 2 deletions src/arpes/widgets.py
Original file line number Diff line number Diff line change
@@ -274,12 +274,12 @@ def handle_select(self, event_click: MouseEvent, event_release: MouseEvent) -> N
x1, x2 = min(x1, x2), max(x1, x2)
y1, y2 = min(y1, y2), max(y1, y2)

region = dict([[dims[1], slice(x1, x2)], [dims[0], slice(y1, y2)]])
region = {dims[1]: slice(x1, x2), dims[0]: slice(y1, y2)}
else:
x1, x2 = event_click, event_release
x1, x2 = min(x1, x2), max(x1, x2)

region = dict([[self.data.dims[0], slice(x1, x2)]])
region = {self.data.dims[0]: slice(x1, x2)}

self._inner_on_select(region)

0 comments on commit 21b1a6e

Please sign in to comment.