From 3f265417bde8008db8c13a3c167df9fa7ed61dc5 Mon Sep 17 00:00:00 2001 From: Ryuichi Arafune Date: Wed, 4 Dec 2024 09:05:04 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=A4=96=20typo=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/arpes/analysis/shirley.py | 4 ++-- src/arpes/analysis/tarpes.py | 4 ++-- src/arpes/bootstrap.py | 2 +- src/arpes/correction/fermi_edge.py | 2 +- src/arpes/deep_learning/transforms.py | 2 +- src/arpes/endstations/__init__.py | 2 +- src/arpes/endstations/plugin/ALG_spin_ToF.py | 2 +- src/arpes/endstations/plugin/IF_UMCS.py | 4 ++-- src/arpes/endstations/plugin/MAESTRO.py | 4 ++-- src/arpes/endstations/plugin/Phelix.py | 12 +++++++----- src/arpes/endstations/plugin/fallback.py | 2 +- src/arpes/endstations/plugin/kaindl.py | 2 +- src/arpes/endstations/prodigy_xy.py | 4 ++-- src/arpes/fits/__init__.py | 2 +- src/arpes/fits/fit_models/x_model_mixin.py | 2 +- src/arpes/fits/utilities.py | 4 ++-- src/arpes/io.py | 2 +- src/arpes/plotting/dos.py | 2 +- src/arpes/plotting/holoviews.py | 2 +- src/arpes/preparation/axis_preparation.py | 2 +- src/arpes/simulation.py | 8 ++++---- src/arpes/utilities/bz.py | 2 +- src/arpes/utilities/conversion/grids.py | 4 ++-- src/arpes/utilities/xarray.py | 2 +- src/arpes/xarray_extensions.py | 12 ++++++------ tests/test_xarray_extensions.py | 6 +++--- 26 files changed, 49 insertions(+), 47 deletions(-) diff --git a/src/arpes/analysis/shirley.py b/src/arpes/analysis/shirley.py index 87e4ea3b..5277adc6 100644 --- a/src/arpes/analysis/shirley.py +++ b/src/arpes/analysis/shirley.py @@ -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) @@ -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) diff --git a/src/arpes/analysis/tarpes.py b/src/arpes/analysis/tarpes.py index f22bb61a..5c4b652f 100644 --- a/src/arpes/analysis/tarpes.py +++ b/src/arpes/analysis/tarpes.py @@ -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. @@ -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. diff --git a/src/arpes/bootstrap.py b/src/arpes/bootstrap.py index 9a17ff4d..5a149713 100644 --- a/src/arpes/bootstrap.py +++ b/src/arpes/bootstrap.py @@ -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) diff --git a/src/arpes/correction/fermi_edge.py b/src/arpes/correction/fermi_edge.py index 0c4112ee..7c356106 100644 --- a/src/arpes/correction/fermi_edge.py +++ b/src/arpes/correction/fermi_edge.py @@ -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 diff --git a/src/arpes/deep_learning/transforms.py b/src/arpes/deep_learning/transforms.py index c3a5596d..8ef76105 100644 --- a/src/arpes/deep_learning/transforms.py +++ b/src/arpes/deep_learning/transforms.py @@ -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" diff --git a/src/arpes/endstations/__init__.py b/src/arpes/endstations/__init__.py index e842dc8c..c5486384 100644 --- a/src/arpes/endstations/__init__.py +++ b/src/arpes/endstations/__init__.py @@ -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: diff --git a/src/arpes/endstations/plugin/ALG_spin_ToF.py b/src/arpes/endstations/plugin/ALG_spin_ToF.py index 64a89033..5ddb6d33 100644 --- a/src/arpes/endstations/plugin/ALG_spin_ToF.py +++ b/src/arpes/endstations/plugin/ALG_spin_ToF.py @@ -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") continue altered_dimension = dimensions[spectrum_name][0] diff --git a/src/arpes/endstations/plugin/IF_UMCS.py b/src/arpes/endstations/plugin/IF_UMCS.py index afb4b691..4796a85c 100644 --- a/src/arpes/endstations/plugin/IF_UMCS.py +++ b/src/arpes/endstations/plugin/IF_UMCS.py @@ -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, @@ -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..." raise RuntimeWarning(msg) return xr.Dataset({"spectrum": data}, attrs=data.attrs) diff --git a/src/arpes/endstations/plugin/MAESTRO.py b/src/arpes/endstations/plugin/MAESTRO.py index f0f58a55..c1af7800 100644 --- a/src/arpes/endstations/plugin/MAESTRO.py +++ b/src/arpes/endstations/plugin/MAESTRO.py @@ -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 @@ -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}`. diff --git a/src/arpes/endstations/plugin/Phelix.py b/src/arpes/endstations/plugin/Phelix.py index 04321b21..b7a37d03 100644 --- a/src/arpes/endstations/plugin/Phelix.py +++ b/src/arpes/endstations/plugin/Phelix.py @@ -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 @@ -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( + theta=np.deg2rad( + -data.theta - Phelix.NORMAL_EMISSION["theta"], + ) + ) + data = data.isel(theta=slice(None, None, -1)) return super().postprocess_final(data, scan_desc) diff --git a/src/arpes/endstations/plugin/fallback.py b/src/arpes/endstations/plugin/fallback.py index cad052fc..8035094c 100644 --- a/src/arpes/endstations/plugin/fallback.py +++ b/src/arpes/endstations/plugin/fallback.py @@ -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)) diff --git a/src/arpes/endstations/plugin/kaindl.py b/src/arpes/endstations/plugin/kaindl.py index 3f428a87..17b9fbce 100644 --- a/src/arpes/endstations/plugin/kaindl.py +++ b/src/arpes/endstations/plugin/kaindl.py @@ -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. diff --git a/src/arpes/endstations/prodigy_xy.py b/src/arpes/endstations/prodigy_xy.py index ad011bc3..d7a395b1 100644 --- a/src/arpes/endstations/prodigy_xy.py +++ b/src/arpes/endstations/prodigy_xy.py @@ -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) @@ -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") diff --git a/src/arpes/fits/__init__.py b/src/arpes/fits/__init__.py index 873295bd..4f92d9df 100644 --- a/src/arpes/fits/__init__.py +++ b/src/arpes/fits/__init__.py @@ -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. diff --git a/src/arpes/fits/fit_models/x_model_mixin.py b/src/arpes/fits/fit_models/x_model_mixin.py index 310f99a7..63fcb5c3 100644 --- a/src/arpes/fits/fit_models/x_model_mixin.py +++ b/src/arpes/fits/fit_models/x_model_mixin.py @@ -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() diff --git a/src/arpes/fits/utilities.py b/src/arpes/fits/utilities.py index 717027f5..c8f67a53 100644 --- a/src/arpes/fits/utilities.py +++ b/src/arpes/fits/utilities.py @@ -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: @@ -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. diff --git a/src/arpes/io.py b/src/arpes/io.py index 25e80303..3472838b 100644 --- a/src/arpes/io.py +++ b/src/arpes/io.py @@ -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) diff --git a/src/arpes/plotting/dos.py b/src/arpes/plotting/dos.py index c46c2ec5..661b340f 100644 --- a/src/arpes/plotting/dos.py +++ b/src/arpes/plotting/dos.py @@ -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. diff --git a/src/arpes/plotting/holoviews.py b/src/arpes/plotting/holoviews.py index b69afbcb..c532ecd3 100644 --- a/src/arpes/plotting/holoviews.py +++ b/src/arpes/plotting/holoviews.py @@ -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: diff --git a/src/arpes/preparation/axis_preparation.py b/src/arpes/preparation/axis_preparation.py index 648e575e..bf412b61 100644 --- a/src/arpes/preparation/axis_preparation.py +++ b/src/arpes/preparation/axis_preparation.py @@ -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, diff --git a/src/arpes/simulation.py b/src/arpes/simulation.py index 414bdc8c..e9b89907 100644 --- a/src/arpes/simulation.py +++ b/src/arpes/simulation.py @@ -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) @@ -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. @@ -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 super().__init__(k, omega, temperature) def digest_to_json(self) -> dict[str, Any]: diff --git a/src/arpes/utilities/bz.py b/src/arpes/utilities/bz.py index 517ed657..bb80336f 100644 --- a/src/arpes/utilities/bz.py +++ b/src/arpes/utilities/bz.py @@ -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". diff --git a/src/arpes/utilities/conversion/grids.py b/src/arpes/utilities/conversion/grids.py index 7147d967..bd832d88 100644 --- a/src/arpes/utilities/conversion/grids.py +++ b/src/arpes/utilities/conversion/grids.py @@ -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] diff --git a/src/arpes/utilities/xarray.py b/src/arpes/utilities/xarray.py index ee7ffdd3..a2736d27 100644 --- a/src/arpes/utilities/xarray.py +++ b/src/arpes/utilities/xarray.py @@ -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: diff --git a/src/arpes/xarray_extensions.py b/src/arpes/xarray_extensions.py index e4bca7e3..5f2376d9 100644 --- a/src/arpes/xarray_extensions.py +++ b/src/arpes/xarray_extensions.py @@ -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) @@ -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] @@ -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 @@ -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) @@ -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) @@ -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. diff --git a/tests/test_xarray_extensions.py b/tests/test_xarray_extensions.py index 0b73eb5c..e371e916 100644 --- a/tests/test_xarray_extensions.py +++ b/tests/test_xarray_extensions.py @@ -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."""