Skip to content

Commit

Permalink
stricter ruff due to py311
Browse files Browse the repository at this point in the history
  • Loading branch information
tjlane committed Oct 30, 2024
1 parent 7890103 commit 30a6e33
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ __pycache__/
*.so

# Distribution / packaging
_version.py
.Python
build/
develop-eggs/
Expand Down
3 changes: 3 additions & 0 deletions meteor/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
__all__ = ["__version__", "version"]

from ._version import __version__, version
2 changes: 1 addition & 1 deletion meteor/diffmaps.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import Sequence
from collections.abc import Sequence

import numpy as np
import reciprocalspaceship as rs
Expand Down
2 changes: 1 addition & 1 deletion meteor/iterative.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import Callable
from collections.abc import Callable

import numpy as np
import pandas as pd
Expand Down
3 changes: 2 additions & 1 deletion meteor/rsmap.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from __future__ import annotations

from collections.abc import Callable
from pathlib import Path
from typing import Any, Callable, ClassVar, Literal, overload
from typing import Any, ClassVar, Literal, overload

import gemmi
import numpy as np
Expand Down
4 changes: 1 addition & 3 deletions meteor/scale.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
from __future__ import annotations

from typing import Tuple

import numpy as np
import pandas as pd
import reciprocalspaceship as rs
import scipy.optimize as opt

from .rsmap import Map

ScaleParameters = Tuple[float, float, float, float, float, float, float]
ScaleParameters = tuple[float, float, float, float, float, float, float]
""" 7x float tuple to hold anisotropic scaling parameters """


Expand Down
3 changes: 2 additions & 1 deletion meteor/tv.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from __future__ import annotations

import json
from collections.abc import Sequence
from dataclasses import asdict, dataclass
from pathlib import Path
from typing import Literal, Sequence, overload
from typing import Literal, overload

import numpy as np
from skimage.restoration import denoise_tv_chambolle
Expand Down
2 changes: 1 addition & 1 deletion meteor/validate.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import Callable, Sequence
from collections.abc import Callable, Sequence

import numpy as np
from scipy.optimize import minimize_scalar
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ tests = [
"meteor.phaseboost" = "meteor.scripts.compute_iterative_tv_map:main"

[tool.setuptools_scm]
version_file = "meteor/__init__.py"
version_file = "meteor/_version.py"

[tool.mypy]
disallow_untyped_calls = true
Expand Down
3 changes: 2 additions & 1 deletion test/unit/scripts/test_compute_iterative_tv_map.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from __future__ import annotations

import argparse
from collections.abc import Sequence
from pathlib import Path
from typing import Any, Sequence
from typing import Any
from unittest import mock

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion test/unit/test_diffmaps.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Callable
from collections.abc import Callable

import numpy as np
import pandas as pd
Expand Down
2 changes: 1 addition & 1 deletion test/unit/test_io.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import Callable
from collections.abc import Callable

import pytest

Expand Down
2 changes: 1 addition & 1 deletion test/unit/test_tv.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from __future__ import annotations

from collections.abc import Sequence
from dataclasses import asdict
from pathlib import Path
from typing import Sequence

import numpy as np
import pandas as pd
Expand Down

0 comments on commit 30a6e33

Please sign in to comment.