Skip to content

Commit

Permalink
Merge branch 'daredevil' of github.com:arafune/arpes into daredevil
Browse files Browse the repository at this point in the history
  • Loading branch information
arafune committed Feb 9, 2024
2 parents e4b6778 + 4d59a65 commit 617cc57
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 1 addition & 2 deletions arpes/analysis/band_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,13 @@ def as_vector(model_fit: lf.ModelResult, prefix: str = "") -> NDArray[np.float_]
as_vector(closest_fit, closest_prefixes[j]),
)

best_arrangement = None
best_arrangement: tuple[int, ...] = tuple(range(len(prefixes)))
best_trace = float("inf")
for p in itertools.permutations(range(len(prefixes))):
trace = sum(dist_mat[i, p_i] for i, p_i in enumerate(p))
if trace < best_trace:
best_trace = trace
best_arrangement = p

ordered_prefixes = [closest_prefixes[p_i] for p_i in best_arrangement]
identified_by_coordinate[frozen_coord] = ordered_prefixes, fit_result
identified_band_results.loc[coordinate] = ordered_prefixes
Expand Down
8 changes: 8 additions & 0 deletions arpes/utilities/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import annotations

import warnings
from typing import TYPE_CHECKING

import xarray as xr
Expand All @@ -20,6 +21,13 @@ def normalize_to_spectrum(data: XrTypes | str) -> xr.DataArray:
import arpes.xarray_extensions # noqa: F401
from arpes.io import load_data

msg = "Remember to use a DataArray not a Dataset, "
msg += "attempting to extract spectrum and copy attributes."
warnings.warn(
msg,
stacklevel=2,
)

if isinstance(data, xr.Dataset):
if "up" in data.data_vars:
assert isinstance(data.up, xr.DataArray)
Expand Down

0 comments on commit 617cc57

Please sign in to comment.