Skip to content

Commit

Permalink
Fix Ruff linters
Browse files Browse the repository at this point in the history
- Don't use Union and instead use (a | b)
  • Loading branch information
Ali-Tehrani committed Feb 2, 2024
1 parent afb9a8e commit d6f7351
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions src/grid/molgrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"""Molecular grid class."""

from __future__ import annotations
from typing import Union

import numpy as np
import scipy.constants
Expand Down Expand Up @@ -53,7 +52,7 @@ def __init__(
self,
atnums: np.ndarray,
atgrids: list,
aim_weights: Union[callable, np.ndarray],
aim_weights: callable | np.ndarray,
store: bool = False,
):
r"""Initialize class.
Expand Down Expand Up @@ -286,9 +285,9 @@ def from_preset(
cls,
atnums: np.ndarray,
atcoords: np.ndarray,
preset: Union[str, list, dict],
rgrid: Union[OneDGrid, list, dict, None] = None,
aim_weights: Union[callable, np.ndarray] = None,
preset: str | list | dict,
rgrid: OneDGrid | list | dict | None = None,
aim_weights: callable | np.ndarray = None,
rotate: int = 37,
store: bool = False,
):
Expand Down Expand Up @@ -392,8 +391,8 @@ def from_size(
atnums: np.ndarray,
atcoords: np.ndarray,
size: int,
rgrid: Union[OneDGrid, None] = None,
aim_weights: Union[callable, np.ndarray] = None,
rgrid: OneDGrid | None = None,
aim_weights: callable | np.ndarray = None,
rotate: int = 37,
store: bool = False,
):
Expand Down Expand Up @@ -443,12 +442,12 @@ def from_pruned(
cls,
atnums: np.ndarray,
atcoords: np.ndarray,
radius: Union[float, list[float]],
r_sectors: Union[float, list[float]],
d_sectors: Union[list[int], None],
s_sectors: Union[list[int], None] = None,
rgrid: Union[OneDGrid, list, None] = None,
aim_weights: Union[callable, np.ndarray, None] = None,
radius: float | list[float],
r_sectors: float | list[float],
d_sectors: list[int] | None,
s_sectors: list[int] | None = None,
rgrid: OneDGrid | list | None = None,
aim_weights: callable | np.ndarray | None = None,
rotate: int = 37,
store: bool = False,
):
Expand Down

0 comments on commit d6f7351

Please sign in to comment.