File: pairs.py

package info (click to toggle)
python-shelxfile 10-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 6,548 kB
  • sloc: python: 5,610; sh: 9; makefile: 6
file content (16 lines) | stat: -rw-r--r-- 408 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class AtomPair():
    def __init__(self, atom1, atom2):
        self.atom1 = atom1
        self.atom2 = atom2

    def __repr__(self):
        if self.atom1 and self.atom2:
            return f'{self.atom1} {self.atom2}'
        else:
            return ''

    def __len__(self):
        if self.atom1 and self.atom2:
            return 2
        elif not self.atom1 or not self.atom2:
            return 0