From f04092a145090f8b0d1e76730f6a532535ac7572 Mon Sep 17 00:00:00 2001 From: scivision Date: Sun, 19 Feb 2023 10:36:21 -0500 Subject: [PATCH] lint --- src/lowtran/base.py | 6 +++--- src/lowtran/cmake.py | 4 ++-- src/lowtran/scenarios.py | 14 +++++++------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/lowtran/base.py b/src/lowtran/base.py index 6112020..0e2b9bc 100644 --- a/src/lowtran/base.py +++ b/src/lowtran/base.py @@ -45,7 +45,7 @@ def nm2lt7(short_nm: float, long_nm: float, step_cminv: float = 20) -> tuple[flo return short, long, N -def loopuserdef(c1: dict[str, Any]) -> xarray.Dataset: +def loopuserdef(c1: dict[str, Any]): """ golowtran() is for scalar parameters only (besides vector of wavelength, which Lowtran internally loops over) @@ -80,7 +80,7 @@ def loopuserdef(c1: dict[str, Any]) -> xarray.Dataset: return TR -def loopangle(c1: dict[str, Any]) -> xarray.Dataset: +def loopangle(c1: dict[str, Any]): """ loop over "ANGLE" """ @@ -95,7 +95,7 @@ def loopangle(c1: dict[str, Any]) -> xarray.Dataset: return TR -def golowtran(c1: dict[str, Any]) -> xarray.Dataset: +def golowtran(c1: dict[str, Any]): """directly run Fortran code""" # %% default parameters c1.setdefault("time", None) diff --git a/src/lowtran/cmake.py b/src/lowtran/cmake.py index 31d21c4..2befba0 100644 --- a/src/lowtran/cmake.py +++ b/src/lowtran/cmake.py @@ -6,14 +6,14 @@ __all__ = ["build"] -def build(source_dir: Path, build_dir: Path): +def build(source_dir: Path, build_dir: Path) -> None: """build with CMake""" cmake = shutil.which("cmake") if not cmake: raise FileNotFoundError("CMake not found. Try:\n pip install cmake") env = os.environ.copy() - if os.name == "nt" and not "CMAKE_GENERATOR" in env: + if os.name == "nt" and "CMAKE_GENERATOR" not in env: if shutil.which("ninja"): env["CMAKE_GENERATOR"] = "Ninja" elif shutil.which("mingw32-make"): diff --git a/src/lowtran/scenarios.py b/src/lowtran/scenarios.py index bd10c3b..9b15798 100644 --- a/src/lowtran/scenarios.py +++ b/src/lowtran/scenarios.py @@ -9,7 +9,7 @@ from .base import loopangle, loopuserdef, golowtran -def scatter(c1: dict[str, Any]) -> xarray.Dataset: +def scatter(c1: dict[str, Any]): # %% low-level Lowtran configuration for this scenario, don't change c1.update( { @@ -21,7 +21,7 @@ def scatter(c1: dict[str, Any]) -> xarray.Dataset: return loopangle(c1) -def irradiance(c1: dict[str, Any]) -> xarray.Dataset: +def irradiance(c1: dict[str, Any]): c1.update( { "itype": 3, # 3: observer to space @@ -32,7 +32,7 @@ def irradiance(c1: dict[str, Any]) -> xarray.Dataset: return loopangle(c1) -def radiance(c1: dict[str, Any]) -> xarray.Dataset: +def radiance(c1: dict[str, Any]): c1.update( { @@ -44,7 +44,7 @@ def radiance(c1: dict[str, Any]) -> xarray.Dataset: return loopangle(c1) -def transmittance(c1: dict[str, Any]) -> xarray.Dataset: +def transmittance(c1: dict[str, Any]): c1.update( { @@ -56,7 +56,7 @@ def transmittance(c1: dict[str, Any]) -> xarray.Dataset: return loopangle(c1) -def horizrad(infn: Path, outfn: Path, c1: dict[str, Any]) -> xarray.Dataset: +def horizrad(infn: Path, outfn: Path, c1: dict[str, Any]): """ read CSV, simulate, write, plot """ @@ -98,7 +98,7 @@ def horizrad(infn: Path, outfn: Path, c1: dict[str, Any]) -> xarray.Dataset: return TR -def horiztrans(c1: dict[str, Any]) -> xarray.Dataset: +def horiztrans(c1: dict[str, Any]): c1.update( { @@ -113,7 +113,7 @@ def horiztrans(c1: dict[str, Any]) -> xarray.Dataset: return golowtran(c1) -def userhoriztrans(c1: dict[str, Any]) -> xarray.Dataset: +def userhoriztrans(c1: dict[str, Any]): c1.update( {