From 69f3a35ca88d4db9957a3681c16e6f300c1dae34 Mon Sep 17 00:00:00 2001 From: Pierre Beaujean Date: Thu, 5 Oct 2023 16:49:07 +0200 Subject: [PATCH] no Self (py<3.11) --- just_psf/geometry.py | 8 ++++---- just_psf/topology.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/just_psf/geometry.py b/just_psf/geometry.py index 12852ef..cc5d8d5 100644 --- a/just_psf/geometry.py +++ b/just_psf/geometry.py @@ -1,6 +1,6 @@ import numpy -from typing import TextIO, Self +from typing import TextIO from just_psf import logger @@ -17,8 +17,8 @@ def __init__(self, symbols: list, positions: numpy.ndarray): def __len__(self) -> int: return len(self.symbols) - def copy(self) -> Self: - """Copy itself. Involves a copy of positions, symbols, and unit cell. + def copy(self) -> 'Geometry': + """Copy itself. Involves a copy of positions and symbols. """ return Geometry( @@ -27,7 +27,7 @@ def copy(self) -> Self: ) @classmethod - def from_xyz(cls, f: TextIO) -> Self: + def from_xyz(cls, f: TextIO) -> 'Geometry': """Read geometry from a XYZ file """ diff --git a/just_psf/topology.py b/just_psf/topology.py index 79d36f4..f724936 100644 --- a/just_psf/topology.py +++ b/just_psf/topology.py @@ -1,7 +1,7 @@ import numpy from numpy.typing import NDArray -from typing import TextIO, List, Self, Optional +from typing import TextIO, List, Optional class Topology: @@ -59,7 +59,7 @@ def __len__(self) -> int: return len(self.symbols) @classmethod - def from_psf(cls, f: TextIO) -> Self: + def from_psf(cls, f: TextIO) -> 'Topology': """Read topology from a NAMD PSF file""" from just_psf.psf_parser import PSFParser