Browse Source

Merge pull request #60 from fphammerle/dependabot/pip/pylint-2.11.1

https://github.com/fphammerle/freesurfer-surface/pull/60
Fabian Peter Hammerle 2 years ago
parent
commit
786a9f70f1
2 changed files with 18 additions and 17 deletions
  1. 9 8
      Pipfile.lock
  2. 9 9
      freesurfer_surface/__init__.py

+ 9 - 8
Pipfile.lock

@@ -75,11 +75,11 @@
         },
         "astroid": {
             "hashes": [
-                "sha256:3b680ce0419b8a771aba6190139a3998d14b413852506d99aff8dc2bf65ee67c",
-                "sha256:dc1e8b28427d6bbef6b8842b18765ab58f558c42bb80540bd7648c98412af25e"
+                "sha256:dcc06f6165f415220013801642bd6c9808a02967070919c4b746c6864c205471",
+                "sha256:fe81f80c0b35264acb5653302ffbd935d394f1775c5e4487df745bf9c2442708"
             ],
             "markers": "python_version ~= '3.6'",
-            "version": "==2.7.3"
+            "version": "==2.8.0"
         },
         "attrs": {
             "hashes": [
@@ -159,7 +159,7 @@
                 "sha256:f0b278ce10936db1a37e6954e15a3730bea96a0997c26d7fee88e6c396c2086d",
                 "sha256:f11642dddbb0253cc8853254301b51390ba0081750a8ac03f20ea8103f0c56b6"
             ],
-            "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4.0'",
+            "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'",
             "version": "==5.5"
         },
         "importlib-metadata": {
@@ -182,7 +182,7 @@
                 "sha256:9c2ea1e62d871267b78307fe511c0838ba0da28698c5732d54e2790bf3ba9899",
                 "sha256:e17d6e2b81095c9db0a03a8025a957f334d6ea30b26f9ec70805411e5c7c81f2"
             ],
-            "markers": "python_version < '4.0' and python_full_version >= '3.6.1'",
+            "markers": "python_version < '4' and python_full_version >= '3.6.1'",
             "version": "==5.9.3"
         },
         "lazy-object-proxy": {
@@ -297,11 +297,11 @@
         },
         "pylint": {
             "hashes": [
-                "sha256:6758cce3ddbab60c52b57dcc07f0c5d779e5daf0cf50f6faacbef1d3ea62d2a1",
-                "sha256:e178e96b6ba171f8ef51fbce9ca30931e6acbea4a155074d80cc081596c9e852"
+                "sha256:0f358e221c45cbd4dad2a1e4b883e75d28acdcccd29d40c76eb72b307269b126",
+                "sha256:2c9843fff1a88ca0ad98a256806c82c5a8f86086e7ccbdb93297d86c3f90c436"
             ],
             "index": "pypi",
-            "version": "==2.10.2"
+            "version": "==2.11.1"
         },
         "pylint-import-requirements": {
             "hashes": [
@@ -430,6 +430,7 @@
                 "sha256:d8226d10bc02a29bcc81df19a26e56a9647f8b0a6d4a83924139f4a8b01f17b7",
                 "sha256:f1d25edafde516b146ecd0613dabcc61409817af4766fbbcfb8d1ad4ec441a34"
             ],
+            "markers": "python_version < '3.10'",
             "version": "==3.10.0.2"
         },
         "wrapt": {

+ 9 - 9
freesurfer_surface/__init__.py

@@ -116,12 +116,12 @@ class Vertex(numpy.ndarray):
 
     def __format_coords(self) -> str:
         return ", ".join(
-            "{}={}".format(name, getattr(self, name))
+            f"{name}={getattr(self, name)}"
             for name in ["right", "anterior", "superior"]
         )
 
     def __repr__(self) -> str:
-        return "{}({})".format(type(self).__name__, self.__format_coords())
+        return f"{type(self).__name__}({self.__format_coords()})"
 
     def distance_mm(
         self, others: typing.Union["Vertex", typing.Iterable["Vertex"], numpy.ndarray]
@@ -185,7 +185,7 @@ class LineSegment(PolygonalCircuit):
         assert len(self.vertex_indices) == 2
 
     def __repr__(self) -> str:
-        return "LineSegment(vertex_indices={})".format(self.vertex_indices)
+        return f"LineSegment(vertex_indices={self.vertex_indices})"
 
 
 class Triangle(PolygonalCircuit):
@@ -194,7 +194,7 @@ class Triangle(PolygonalCircuit):
         assert len(self.vertex_indices) == 3
 
     def __repr__(self) -> str:
-        return "Triangle(vertex_indices={})".format(self.vertex_indices)
+        return f"Triangle(vertex_indices={self.vertex_indices})"
 
 
 class PolygonalChainsNotOverlapingError(ValueError):
@@ -220,7 +220,7 @@ class PolygonalChain:
         )
 
     def __repr__(self) -> str:
-        return "PolygonalChain(vertex_indices={})".format(tuple(self.vertex_indices))
+        return f"PolygonalChain(vertex_indices={tuple(self.vertex_indices)})"
 
     def connect(self, other: "PolygonalChain") -> None:
         if self.vertex_indices[-1] == other.vertex_indices[0]:
@@ -277,11 +277,11 @@ class Label:
 
     @property
     def hex_color_code(self) -> str:
-        return "#{:02x}{:02x}{:02x}".format(self.red, self.green, self.blue)
+        return f"#{self.red:02x}{self.green:02x}{self.blue:02x}"
 
     def __str__(self) -> str:
-        return "Label(name={}, index={}, color={})".format(
-            self.name, self.index, self.hex_color_code
+        return (
+            f"Label(name={self.name}, index={self.index}, color={self.hex_color_code})"
         )
 
     def __repr__(self) -> str:
@@ -433,7 +433,7 @@ class Surface:
 
     @classmethod
     def _triangular_strftime(cls, creation_datetime: datetime.datetime) -> bytes:
-        padded_day = "{:>2}".format(creation_datetime.day)
+        padded_day = f"{creation_datetime.day:>2}"
         fmt = cls._DATETIME_FORMAT.replace("%d", padded_day)
         with setlocale("C"):
             return creation_datetime.strftime(fmt).encode()