Skip to content

Commit

Permalink
chore: 🤖 typo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
arafune committed Dec 4, 2024
1 parent 168fa09 commit 3f26541
Show file tree
Hide file tree
Showing 26 changed files with 49 additions and 47 deletions.
4 changes: 2 additions & 2 deletions src/arpes/analysis/shirley.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def calculate_shirley_background_full_range(
n_samples: The number of samples to use at the boundaries of the input data.
Returns:
A monotonic Shirley backgruond over the entire energy range.
A monotonic Shirley background over the entire energy range.
"""
xps_array = (
xps.copy(deep=True)
Expand Down Expand Up @@ -173,7 +173,7 @@ def calculate_shirley_background(
n_samples: The number of samples to use at the boundaries of the input data.
Returns:
A monotonic Shirley backgruond over the entire energy range.
A monotonic Shirley background over the entire energy range.
"""
if energy_range is None:
energy_range = slice(None, None)
Expand Down
4 changes: 2 additions & 2 deletions src/arpes/analysis/tarpes.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def build_crosscorrelation(
Args:
datalist (Sequence[xr.DataArray]): Data series from the cross-correlation experiments.
delayline_dim: the dimension name for "delay line", which must be in key of data.attrs
When this is the "position" dimention, the unit is assumed to be "mm". If the value has
When this is the "position" dimension, the unit is assumed to be "mm". If the value has
already been converted to "time" dimension, set convert_position_to_time=True
delayline_origin (float): The value corresponding to the delay zero.
convert_position_to_time: (bool) If true, no conversion into "delay" is processed.
Expand Down Expand Up @@ -189,7 +189,7 @@ def find_t_for_max_intensity(data: xr.DataArray, e_bound: float = 0.02) -> float
"""Finds the time corresponding to the maximum (integrated) intensity.
While the time returned can be used to "t=0" in pump probe exepriments, especially for
realtively slow (~ps) phenomena, but not always true.
relatively slow (~ps) phenomena, but not always true.
Args:
data: A spectrum with "eV" and "delay" dimensions.
Expand Down
2 changes: 1 addition & 1 deletion src/arpes/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def propagate_errors(f: Callable[P, R]) -> Callable[P, R]:
f: The inner function to wrap
Returns:
The wrapped function handling distributions tranparently.
The wrapped function handling distributions transparently.
"""

@functools.wraps(f)
Expand Down
2 changes: 1 addition & 1 deletion src/arpes/correction/fermi_edge.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def build_direct_fermi_edge_correction(
Args:
arr (xr.DataArray) : input DataArray
energy_range (slice): Energy range, which is used in xr.DataArray.sel(). defautl (-0.1, 0.1)
energy_range (slice): Energy range, which is used in xr.DataArray.sel(). default (-0.1, 0.1)
plot (bool): if True, show the plot
along (str): axis for non energy axis
Expand Down
2 changes: 1 addition & 1 deletion src/arpes/deep_learning/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def decodes_target(self, y: Incomplete) -> Incomplete:
return y

def __repr__(self) -> str:
"""Show both of the constitutent parts of this transform."""
"""Show both of the constituent parts of this transform."""
return (
self.__class__.__name__
+ "(\n\t"
Expand Down
2 changes: 1 addition & 1 deletion src/arpes/endstations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ def load_single_frame(
Returns:
xr.Dataset: The dataset containing the loaded spectrum data.
Load the single frame fro the file.
Load the single frame from the file.
"""
ext = Path(frame_path).suffix
if scan_desc is None:
Expand Down
2 changes: 1 addition & 1 deletion src/arpes/endstations/plugin/ALG_spin_ToF.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def load_SToF_fits(self, scan_desc: ScanDesc) -> xr.Dataset:
except Exception:
# we should probably zero pad in the case where the slices are not the right
# size
logger.exception("Exception Occure")
logger.exception("Exception Occur")

Check warning on line 248 in src/arpes/endstations/plugin/ALG_spin_ToF.py

View check run for this annotation

Codecov / codecov/patch

src/arpes/endstations/plugin/ALG_spin_ToF.py#L248

Added line #L248 was not covered by tests
continue

altered_dimension = dimensions[spectrum_name][0]
Expand Down
4 changes: 2 additions & 2 deletions src/arpes/endstations/plugin/IF_UMCS.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class IF_UMCSEndstation( # noqa: N801
LENS_MAPPING: ClassVar[dict[str, bool]] = {
"HighAngularDispersion": True,
"MediumAngularDispersion": True,
"LowAngularDispersion": True,
"LowAngularDispersion": True,
"WideAngleMode": True,
"LowMagnification": False,
"MediumMagnification": False,
Expand Down Expand Up @@ -77,7 +77,7 @@ def load_single_frame(
if file.suffix == ".xy":
data = load_xy(frame_path, **kwargs)
elif file.suffix == ".itx":
msg = "Not suported yet..."
msg = "Not supported yet..."

Check warning on line 80 in src/arpes/endstations/plugin/IF_UMCS.py

View check run for this annotation

Codecov / codecov/patch

src/arpes/endstations/plugin/IF_UMCS.py#L80

Added line #L80 was not covered by tests
raise RuntimeWarning(msg)
return xr.Dataset({"spectrum": data}, attrs=data.attrs)

Expand Down
4 changes: 2 additions & 2 deletions src/arpes/endstations/plugin/MAESTRO.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Common code is provided by a base class reflecting DAQ similarities between micro- and nanoARPES
at MAESTRO. This is subclassed for the individual experiments to handle some subtle differences
in how nanoARPES handles its spatial coordiantes (they are hierarchical) and in the spectrometers.
in how nanoARPES handles its spatial coordinates (they are hierarchical) and in the spectrometers.
"""

from __future__ import annotations
Expand Down Expand Up @@ -294,7 +294,7 @@ def update_hierarchical_coordinates(data: xr.Dataset) -> xr.Dataset:
high-resolution motion axis of a nano-ARPES system.
Working in two coordinate systems is frustrating, and it makes comparing data cumbersome. In
PyARPES x,y,z is always the total inferrable coordinate value,
PyARPES x,y,z is always the total inferable coordinate value,
i.e. (+/- long range +/- high resolution) as appropriate. You can still access the
underlying coordinates in this case as `long_{dim}` and `short_{dim}`.
Expand Down
12 changes: 7 additions & 5 deletions src/arpes/endstations/plugin/Phelix.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def postprocess_final(
- Calculate phi or x values depending on the lens mode.
- Add missing parameters.
- Rename keys and dimensions in particular the third dimension that
could be psi andle or theta angle in this endstation.
could be psi angle or theta angle in this endstation.
Args:
data(xr.Dataset): ARPES data
Expand Down Expand Up @@ -143,10 +143,12 @@ def postprocess_final(
if "psi" in data.coords:
data = data.assign_coords(psi=np.deg2rad(data.psi))
if "theta" in data.coords:
data = data.assign_coords(theta=np.deg2rad(
- data.theta - Phelix.NORMAL_EMISSION["theta"],
))
data = data.isel(theta=slice(None,None,-1))
data = data.assign_coords(

Check warning on line 146 in src/arpes/endstations/plugin/Phelix.py

View check run for this annotation

Codecov / codecov/patch

src/arpes/endstations/plugin/Phelix.py#L146

Added line #L146 was not covered by tests
theta=np.deg2rad(
-data.theta - Phelix.NORMAL_EMISSION["theta"],
)

Check failure on line 149 in src/arpes/endstations/plugin/Phelix.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (COM812)

src/arpes/endstations/plugin/Phelix.py:149:18: COM812 Trailing comma missing
)
data = data.isel(theta=slice(None, None, -1))

Check warning on line 151 in src/arpes/endstations/plugin/Phelix.py

View check run for this annotation

Codecov / codecov/patch

src/arpes/endstations/plugin/Phelix.py#L151

Added line #L151 was not covered by tests
return super().postprocess_final(data, scan_desc)


Expand Down
2 changes: 1 addition & 1 deletion src/arpes/endstations/plugin/fallback.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def find_first_file(cls: type[FallbackEndstation], file_number: int) -> Path:
"""Finds any file associated to this scan.
Instead actually using the superclass code here, we first try to determine
which loading pluging should be used. Then, we delegate to that class to
which loading plugin should be used. Then, we delegate to that class to
find the first associated file.
"""
associated_loader = cls.determine_associated_loader(str(file_number))
Expand Down
2 changes: 1 addition & 1 deletion src/arpes/endstations/plugin/kaindl.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def postprocess_final(
data: xr.Dataset,
scan_desc: ScanDesc | None = None,
) -> xr.Dataset:
"""Peforms final data preprocessing for the Kaindl lab Tr-ARPES setup.
"""Performs final data preprocessing for the Kaindl lab Tr-ARPES setup.
This is very similar to what happens at BL4/MERLIN because the code was adopted
from an old version of the DAQ on that beamline.
Expand Down
4 changes: 2 additions & 2 deletions src/arpes/endstations/prodigy_xy.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Second dimension "nonenegy" is perpendicular to the energy on the MCP detector,
stored as # NonEnergyOrdinate in each block of the data.
This could be both: angular (phi angle) or spacial (along the slit direction).
This could be both: angular (phi angle) or spatial (along the slit direction).
Third dimension/parameter could be:
- the deflector shift (psi angle)
Expand Down Expand Up @@ -96,7 +96,7 @@ def parse(self, list_from_xy_file: list[str]) -> None:
else:
num_of_en = int(self.params["values_curve"])

kinetic_ef_energy = np.linspace(energies[0], energies[num_of_en-1], num_of_en)
kinetic_ef_energy = np.linspace(energies[0], energies[num_of_en - 1], num_of_en)
# first dimension is always energy
self.axis_info["d1"] = (kinetic_ef_energy, "eV")

Expand Down
2 changes: 1 addition & 1 deletion src/arpes/fits/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@ class ParametersArgs(TypedDict, total=False):
vary: bool # Whether the parameter is varied during the fit
min: float # Lower bound for value (default, -np.inf)
max: float # Upper bound for value (default np.inf)
expr: str # Mathematical expression to contstrain the value.
expr: str # Mathematical expression to constrain the value.
brute_step: float # step size for grid points in the brute method.
2 changes: 1 addition & 1 deletion src/arpes/fits/fit_models/x_model_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def _prep_parameters(
Returns:
lf.Parameters
Note that lf.Paramters class not, lf.Parameter
Note that lf.Parameters class not, lf.Parameter
Notes:
Example of lf.Parameters()
Expand Down
4 changes: 2 additions & 2 deletions src/arpes/fits/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def result_to_hints(
defaults: Returned if `model_result` is None, useful for cell re-evaluation in Jupyter
Returns:
A dict containing parameter specifications in key-value rathar than `lmfit.Parameter`
A dict containing parameter specifications in key-value rather than `lmfit.Parameter`
format, as you might pass as `params=` to PyARPES fitting code.
"""
if model_result is None:
Expand Down Expand Up @@ -170,7 +170,7 @@ def broadcast_model( # noqa: PLR0913
prefixes: Prefix for the parameter name. Pass to MPWorker that pass to
broadcast_common.compile_model. When prefixes are specified, the number of prefixes must
be same as the number of models for fitting. If not specified, the prefix automatically is
determined as "a\_", "b\_",.... (We recommend to specifiy them explicitly.)
determined as "a\_", "b\_",.... (We recommend to specify them explicitly.)
window: A specification of cuts/windows to apply to each curve fit
parallelize: Whether to parallelize curve fits, defaults to True if unspecified and more
than 20 fits were requested.
Expand Down
2 changes: 1 addition & 1 deletion src/arpes/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def _df_or_list_to_files(
assert not isinstance(
df_or_list,
list | tuple,
), "Expected an interable for a list of the scans to stitch together"
), "Expected an iterable for a list of the scans to stitch together"
return list(df_or_list)


Expand Down
2 changes: 1 addition & 1 deletion src/arpes/plotting/dos.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def plot_dos(
Args:
data: ARPES data to plot.
out (str | Path): Path to the figure.
orientation (Literal["horizontal", "vetical"]): Orientation of the figures.
orientation (Literal["horizontal", "vertical"]): Orientation of the figures.
figsize: The figure size (arg of plt.figure())
kwargs: Pass to the original data.
Expand Down
2 changes: 1 addition & 1 deletion src/arpes/plotting/holoviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def _fix_xarray_to_fit_with_holoview(dataarray: xr.DataArray) -> xr.DataArray:
dataarray (xr.DataArray): input Dataarray
Returns:
xr.DataArray, whose coordinates is regularly orderd determined by dataarray.dims.
xr.DataArray, whose coordinates is regularly ordered determined by dataarray.dims.
"""
for coord_name in dataarray.coords:
if coord_name not in dataarray.dims:
Expand Down
2 changes: 1 addition & 1 deletion src/arpes/preparation/axis_preparation.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def sort_axis(data: xr.DataArray, axis_name: str) -> xr.DataArray:

@update_provenance("Flip data along axis")
def flip_axis(
arr: xr.DataArray, # valuse is used
arr: xr.DataArray, # values is used
axis_name: str,
*,
flip_data: bool = True,
Expand Down
8 changes: 4 additions & 4 deletions src/arpes/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def __init__(
k: The momentum axis.
omega: The energy axis.
temperature: The temperature to use for the calculation. Defaults to None.
mfl_parameter (tuple[float, float]): The MFL paramter ('a', and 'b').
mfl_parameter (tuple[float, float]): The MFL parameter ('a', and 'b').
Defaults to (10.0, 1.0)
"""
super().__init__(k, omega, temperature)
Expand All @@ -451,7 +451,7 @@ def __init__(
k: NDArray[np.float64] | None = None,
omega: NDArray[np.float64] | None = None,
temperature: float = 20,
gap_paramters: tuple[float, float, float] = (50, 30, 0),
gap_parameters: tuple[float, float, float] = (50, 30, 0),
) -> None:
"""Initializes from parameters.
Expand All @@ -460,10 +460,10 @@ def __init__(
omega: The energy axis.
temperature: The temperature to use for the calculation. Defaults to None.
delta: The gap size.
gap_paramters (tuple[float, float, float]): Gap paramter of the BSSCO,
gap_parameters (tuple[float, float, float]): Gap parameter of the BSSCO,
Delta, and two Gamma pamaramters (s- and p-wave)
"""
self.delta, self.gamma_s, self.gamma_p = gap_paramters
self.delta, self.gamma_s, self.gamma_p = gap_parameters

Check warning on line 466 in src/arpes/simulation.py

View check run for this annotation

Codecov / codecov/patch

src/arpes/simulation.py#L466

Added line #L466 was not covered by tests
super().__init__(k, omega, temperature)

def digest_to_json(self) -> dict[str, Any]:
Expand Down
2 changes: 1 addition & 1 deletion src/arpes/utilities/bz.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def process_kpath(
path: str,
cell: Cell,
) -> NDArray[np.float64]:
"""Converts paths consiting of point definitions to raw coordinates.
"""Converts paths consisting of point definitions to raw coordinates.
Args:
path: String that represents the high symmetry points such as "GMK".
Expand Down
4 changes: 2 additions & 2 deletions src/arpes/utilities/conversion/grids.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@


def is_dimension_convertible_to_momentum(dimension_name: str) -> bool:
"""Determine whether a dimension can paticipate in the momentum conversion.
"""Determine whether a dimension can participate in the momentum conversion.
if dimension name is in {"phi", "theta", "beta", "chi", "psi", "hv"}, return True.
Originally, is_dimension_unconvertible(dimension_name: str) is defined.
{"phi", "theta", "beta", "chi", "psi", "hv"} can be converted to momemtum.
{"phi", "theta", "beta", "chi", "psi", "hv"} can be converted to momentum.
Args:
dimension_name (str): [description]
Expand Down
2 changes: 1 addition & 1 deletion src/arpes/utilities/xarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def apply_dataarray(
Args:
arr (xr.DataArray): original DataArray.
f (Callable): Function to apple the DataArray.
args: argments for "f".
args: arguments for "f".
kwargs: keyword arguments for "f"
Returns:
Expand Down
12 changes: 6 additions & 6 deletions src/arpes/xarray_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ def switch_energy_notation(self, nonlinear_order: int = 1) -> None:
)
self._obj.attrs["energy_notation"] = "Binding"
else:
msg = "Not impremented yet."
msg = "Not implemented yet."
raise RuntimeError(msg)


Expand Down Expand Up @@ -939,7 +939,7 @@ def short_history(self, key: str = "by") -> list:
"""Return the short version of history.
Args:
key (str): key str in recored dict of self.history. (default: "by")
key (str): key str in recorded dict of self.history. (default: "by")
"""
return [h["record"][key] if isinstance(h, dict) else h for h in self.history] # type: ignore[literal-required]

Expand Down Expand Up @@ -1129,7 +1129,7 @@ class ARPESProperty(ARPESPropertyBase):

@staticmethod
def dict_to_html(d: Mapping[str, float | str]) -> str:
"""Returnn html format of dict object.
"""Return html format of dict object.
Args:
d: dict object
Expand Down Expand Up @@ -1333,7 +1333,7 @@ def transpose_to_front(self, dim: str) -> XrTypes:
Returns: (XrTypes)
Transposed ARPES data
Tooo:
Todo:
Test
"""
dims = list(self._obj.dims)
Expand All @@ -1350,7 +1350,7 @@ def transpose_to_back(self, dim: str) -> XrTypes:
Returns: (XrTypes)
Transposed ARPES data.
Tooo:
Todo:
Test
"""
dims = list(self._obj.dims)
Expand Down Expand Up @@ -2512,7 +2512,7 @@ def iter_coords(
*,
reverse: bool = False,
) -> Iterator[dict[Hashable, float]]:
"""Iterator for cooridinates along the axis.
"""Iterator for coordinates along the axis.
Args:
dim_names (Sequence[Hashable]): Dimensions for iteration.
Expand Down
6 changes: 3 additions & 3 deletions tests/test_xarray_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,14 +284,14 @@ def test_switch_energy_notation(

with pytest.raises(RuntimeError) as e:
hv_map.S.switch_energy_notation()
assert str(e.value) == "Not impremented yet."
assert str(e.value) == "Not implemented yet."

with pytest.raises(RuntimeError) as e:
hv_map.S.switch_energy_notation()
assert str(e.value) == "Not impremented yet."
assert str(e.value) == "Not implemented yet."
with pytest.raises(RuntimeError) as e:
hv_map.spectrum.S.switch_energy_notation()
assert str(e.value) == "Not impremented yet."
assert str(e.value) == "Not implemented yet."

def test_spectrum_type(self, dataarray_cut: xr.DataArray) -> None:
"""Test spectrum_type."""
Expand Down

0 comments on commit 3f26541

Please sign in to comment.