Skip to content

Commit

Permalink
🔧 Update pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
arafune committed Apr 24, 2024
1 parent c44ed88 commit 9f771c0
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 7 deletions.
27 changes: 26 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,36 @@ omit = [
exclude_lines = ["raise NotImplementedError", "pragma: no cover"]

[tool.pyright]
typeCheckingMode = "off"
exclude = [
"**/ALG_spin_TOF.py",
"**/fits_utils.py",
"**/Elettra_spectromicroscopy.py",
"**ALG_main.py",
"ANTARES.py",
"**/MAESTRO.py",
"**/BL10_SARPES.py",
"**/SSRF_NSRL.py",
"**/MGS.py",
"**/kaindl.py",
"**/merlin.py",
#
"**/fit_tool",
"**/qt_tool",
"**/qt_ktool",
"**/bz_tool",
"**/basic_tools",
"**/dynamic_tool.py",
"**/qt/",
]

typeCheckingMode = "standard" # "off", "basic" "standard" "strict"
include = ["src"]

pythonVersion = "3.11"
pythonPlatform = "All"

reportMissingTypeStubs = false

[tool.ruff]
lint.ignore = [
"PD", # pandas-vet
Expand Down
18 changes: 14 additions & 4 deletions src/arpes/analysis/moire.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import matplotlib.pyplot as plt
import numpy as np
from ase.cell import Cell
from ase.dft.bz import bz_plot
from ase.lattice import HEX2D
from scipy.spatial.distance import pdist
Expand All @@ -21,7 +22,6 @@
if TYPE_CHECKING:
from collections.abc import Generator

from ase.cell import Cell
from matplotlib.axes import Axes
from numpy.typing import NDArray

Expand Down Expand Up @@ -129,7 +129,17 @@ def calc_commensurate_moire_cell(
*,
swap_angle: bool = False,
) -> dict[str, Any]:
"""Calculates nearly commensurate moire unit cells for two hexagonal lattices."""
"""Calculates nearly commensurate moire unit cells for two hexagonal lattices.
Args:
underlayer_a: [TODO:description]
overlayer_a: [TODO:description]
relative_angle_rad: [TODO:description]
swap_angle: [TODO:description]
Returns:
[TODO:description]
"""
from ase.dft.bz import bz_vertices
from ase.dft.kpoints import get_special_points

Expand All @@ -151,8 +161,8 @@ def calc_commensurate_moire_cell(
if swap_angle:
moire_angle = -moire_angle

moire_cell = HEX2D(float(moire_a))
moire_cell = Rotation.from_rotvec([0, 0, moire_angle]).apply(moire_cell)
moire_cell = HEX2D(float(moire_a)).tocell()
moire_cell = Cell(Rotation.from_rotvec([0, 0, moire_angle]).apply(moire_cell))
moire_icell = moire_cell.reciprocal()

moire_bz_points = bz_vertices(moire_icell)[0][0][:, :2]
Expand Down
6 changes: 5 additions & 1 deletion src/arpes/utilities/region.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from __future__ import annotations

from enum import Enum
from typing import Literal

__all__ = ["REGIONS", "normalize_region", "DesignatedRegions"]

Expand Down Expand Up @@ -43,7 +44,10 @@ class DesignatedRegions(Enum):
}


def normalize_region(region: str | dict) -> dict[str, DesignatedRegions]:
def normalize_region(
region: Literal["copper_prior", "wide_angular", "narrow_angular"]
| dict[str, DesignatedRegions],
) -> dict[str, DesignatedRegions]:
"""Converts named regions to an actual region."""
if isinstance(region, str):
return REGIONS[region]
Expand Down
6 changes: 5 additions & 1 deletion src/arpes/xarray_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,11 @@ def meso_effective_selector(self) -> slice:
energy_edge = self.find_spectrum_energy_edges()
return slice(np.max(energy_edge) - 0.3, np.max(energy_edge) - 0.1)

def region_sel(self, *regions: Incomplete) -> XrTypes:
def region_sel(
self,
*regions: Literal["copper_prior", "wide_angular", "narrow_angular"]
| dict[str, DesignatedRegions],
) -> XrTypes:
def process_region_selector(
selector: slice | DesignatedRegions,
dimension_name: str,
Expand Down

0 comments on commit 9f771c0

Please sign in to comment.