Skip to content

Commit

Permalink
Merge pull request #354 from tovrstra/all-immutable
Browse files Browse the repository at this point in the history
Make __all__ immutable
tovrstra authored Jun 29, 2024
2 parents cedf12b + da392b4 commit 0ca750f
Showing 38 changed files with 41 additions and 41 deletions.
2 changes: 1 addition & 1 deletion iodata/__main__.py
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@
__version__ = "0.0.0.post0"


__all__ = []
__all__ = ()


DESCRIPTION = """\
2 changes: 1 addition & 1 deletion iodata/api.py
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@
WriteInputError,
)

__all__ = ["load_one", "load_many", "dump_one", "dump_many", "write_input"]
__all__ = ("load_one", "load_many", "dump_one", "dump_many", "write_input")


def _find_format_modules():
2 changes: 1 addition & 1 deletion iodata/attrutils.py
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@

import numpy as np

__all__ = ["convert_array_to", "validate_shape"]
__all__ = ("convert_array_to", "validate_shape")


def convert_array_to(dtype):
4 changes: 2 additions & 2 deletions iodata/basis.py
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@

from .attrutils import validate_shape

__all__ = [
__all__ = (
"angmom_sti",
"angmom_its",
"Shell",
@@ -44,7 +44,7 @@
"iter_cart_alphabet",
"HORTON2_CONVENTIONS",
"CCA_CONVENTIONS",
]
)

ANGMOM_CHARS = "spdfghiklmnoqrtuvwxyzabce"

4 changes: 2 additions & 2 deletions iodata/docstrings.py
Original file line number Diff line number Diff line change
@@ -20,13 +20,13 @@

from typing import Callable, Optional

__all__ = [
__all__ = (
"document_load_one",
"document_load_many",
"document_dump_one",
"document_dump_many",
"document_write_input",
]
)


def _document_load(
2 changes: 1 addition & 1 deletion iodata/formats/charmm.py
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@
from ..docstrings import document_load_one
from ..utils import LineIterator, LoadError, amu, angstrom

__all__ = []
__all__ = ()


PATTERNS = ["*.crd"]
2 changes: 1 addition & 1 deletion iodata/formats/chgcar.py
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@
from ..periodic import sym2num
from ..utils import Cube, LineIterator, angstrom, volume

__all__ = []
__all__ = ()


PATTERNS = ["CHGCAR*", "AECCAR*"]
2 changes: 1 addition & 1 deletion iodata/formats/cp2klog.py
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@
from ..overlap import factorial2
from ..utils import LineIterator, LoadError

__all__ = []
__all__ = ()


PATTERNS = ["*.cp2k.out"]
2 changes: 1 addition & 1 deletion iodata/formats/cube.py
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@
from ..iodata import IOData
from ..utils import Cube, LineIterator

__all__ = []
__all__ = ()


PATTERNS = ["*.cube", "*.cub"]
2 changes: 1 addition & 1 deletion iodata/formats/extxyz.py
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@
from ..utils import LineIterator, amu, angstrom, strtobool
from .xyz import load_one as load_one_xyz

__all__ = []
__all__ = ()


PATTERNS = ["*.extxyz"]
2 changes: 1 addition & 1 deletion iodata/formats/fchk.py
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@
from ..orbitals import MolecularOrbitals
from ..utils import DumpError, LineIterator, LoadError, PrepareDumpError, amu

__all__ = []
__all__ = ()


PATTERNS = ["*.fchk", "*.fch"]
2 changes: 1 addition & 1 deletion iodata/formats/fcidump.py
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@
from ..iodata import IOData
from ..utils import LineIterator, LoadError, set_four_index_element

__all__ = []
__all__ = ()


PATTERNS = ["*FCIDUMP*"]
2 changes: 1 addition & 1 deletion iodata/formats/gamess.py
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@
from ..docstrings import document_load_one
from ..utils import LineIterator, LoadError, angstrom

__all__ = []
__all__ = ()


PATTERNS = ["*.dat"]
2 changes: 1 addition & 1 deletion iodata/formats/gaussianinput.py
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@
from ..periodic import sym2num
from ..utils import LineIterator, LoadError, angstrom

__all__ = []
__all__ = ()


PATTERNS = ["*.com", "*.gjf"]
2 changes: 1 addition & 1 deletion iodata/formats/gaussianlog.py
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@
from ..docstrings import document_load_one
from ..utils import LineIterator, set_four_index_element

__all__ = []
__all__ = ()


PATTERNS = ["*.log"]
2 changes: 1 addition & 1 deletion iodata/formats/gromacs.py
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@
from ..docstrings import document_load_many, document_load_one
from ..utils import LineIterator, nanometer, picosecond

__all__ = []
__all__ = ()


PATTERNS = ["*.gro"]
2 changes: 1 addition & 1 deletion iodata/formats/json.py
Original file line number Diff line number Diff line change
@@ -573,7 +573,7 @@
from ..periodic import num2sym, sym2num
from ..utils import DumpError, DumpWarning, LineIterator, LoadError, LoadWarning, PrepareDumpError

__all__ = []
__all__ = ()


PATTERNS = ["*.json"]
2 changes: 1 addition & 1 deletion iodata/formats/locpot.py
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@
from ..utils import LineIterator, electronvolt
from .chgcar import _load_vasp_grid

__all__ = []
__all__ = ()


PATTERNS = ["LOCPOT*"]
2 changes: 1 addition & 1 deletion iodata/formats/mol2.py
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@
from ..periodic import bond2num, num2bond, num2sym, sym2num
from ..utils import LineIterator, LoadError, LoadWarning, angstrom

__all__ = []
__all__ = ()


PATTERNS = ["*.mol2"]
2 changes: 1 addition & 1 deletion iodata/formats/molden.py
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@
from ..prepare import prepare_unrestricted_aminusb
from ..utils import DumpError, LineIterator, LoadError, LoadWarning, PrepareDumpError, angstrom

__all__ = []
__all__ = ()


PATTERNS = ["*.molden.input", "*.molden"]
2 changes: 1 addition & 1 deletion iodata/formats/molekel.py
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@
from ..utils import DumpError, LineIterator, LoadError, LoadWarning, PrepareDumpError, angstrom
from .molden import CONVENTIONS, _fix_molden_from_buggy_codes

__all__ = []
__all__ = ()


PATTERNS = ["*.mkl"]
2 changes: 1 addition & 1 deletion iodata/formats/mwfn.py
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
from ..orbitals import MolecularOrbitals
from ..utils import LineIterator, LoadError, angstrom

__all__ = []
__all__ = ()


PATTERNS = ["*.mwfn"]
2 changes: 1 addition & 1 deletion iodata/formats/orcalog.py
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
from ..docstrings import document_load_one
from ..utils import LineIterator

__all__ = []
__all__ = ()


PATTERNS = ["*.out"]
2 changes: 1 addition & 1 deletion iodata/formats/pdb.py
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@
from ..periodic import bond2num, num2sym, sym2num
from ..utils import LineIterator, LoadError, LoadWarning, angstrom

__all__ = []
__all__ = ()


PATTERNS = ["*.pdb"]
2 changes: 1 addition & 1 deletion iodata/formats/poscar.py
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@
from ..utils import LineIterator, angstrom
from .chgcar import _load_vasp_header

__all__ = []
__all__ = ()


PATTERNS = ["POSCAR*"]
2 changes: 1 addition & 1 deletion iodata/formats/qchemlog.py
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@
from ..periodic import sym2num
from ..utils import LineIterator, angstrom, calmol, kcalmol, kjmol, strtobool

__all__ = []
__all__ = ()

PATTERNS = ["*.qchemlog"]

2 changes: 1 addition & 1 deletion iodata/formats/sdf.py
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@
from ..periodic import num2sym, sym2num
from ..utils import LineIterator, LoadError, angstrom

__all__ = []
__all__ = ()


PATTERNS = ["*.sdf"]
2 changes: 1 addition & 1 deletion iodata/formats/wfn.py
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@
from ..prepare import prepare_unrestricted_aminusb
from ..utils import LineIterator, LoadError, PrepareDumpError

__all__ = []
__all__ = ()


PATTERNS = ["*.wfn"]
2 changes: 1 addition & 1 deletion iodata/formats/wfx.py
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@
from ..utils import LineIterator, LoadError, LoadWarning, PrepareDumpError
from .wfn import CONVENTIONS, build_obasis, get_mocoeff_scales

__all__ = []
__all__ = ()

PATTERNS = ["*.wfx"]

2 changes: 1 addition & 1 deletion iodata/formats/xyz.py
Original file line number Diff line number Diff line change
@@ -68,7 +68,7 @@
from ..periodic import num2sym, sym2num
from ..utils import LineIterator, angstrom

__all__ = []
__all__ = ()


PATTERNS = ["*.xyz"]
2 changes: 1 addition & 1 deletion iodata/inputs/common.py
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@

from ..iodata import IOData

__all__ = ["write_input_base"]
__all__ = ("write_input_base",)


def write_input_base(
2 changes: 1 addition & 1 deletion iodata/inputs/gaussian.py
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
from ..utils import angstrom
from .common import write_input_base

__all__ = []
__all__ = ()


default_template = """\
2 changes: 1 addition & 1 deletion iodata/inputs/orca.py
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
from ..utils import angstrom
from .common import write_input_base

__all__ = []
__all__ = ()


default_template = """\
2 changes: 1 addition & 1 deletion iodata/iodata.py
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@
from .orbitals import MolecularOrbitals
from .utils import Cube

__all__ = ["IOData"]
__all__ = ("IOData",)


@attrs.define
2 changes: 1 addition & 1 deletion iodata/overlap.py
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@
from .basis import MolecularBasis, Shell, convert_conventions, iter_cart_alphabet
from .overlap_cartpure import tfs

__all__ = ["OVERLAP_CONVENTIONS", "compute_overlap", "gob_cart_normalization"]
__all__ = ("OVERLAP_CONVENTIONS", "compute_overlap", "gob_cart_normalization")


def factorial2(n: Union[int, NDArray[int]]) -> Union[int, NDArray[int]]:
2 changes: 1 addition & 1 deletion iodata/overlap_cartpure.py
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@

import numpy as np

__all__ = ["tfs"]
__all__ = ("tfs",)

# fmt: off
tf0 = np.array([
2 changes: 1 addition & 1 deletion iodata/periodic.py
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
# --
"""Periodic table module."""

__all__ = ["num2sym", "sym2num"]
__all__ = ("num2sym", "sym2num")


num2sym: dict[int, str] = {
4 changes: 2 additions & 2 deletions iodata/test/common.py
Original file line number Diff line number Diff line change
@@ -35,14 +35,14 @@
from ..overlap import compute_overlap
from ..utils import LoadWarning

__all__ = [
__all__ = (
"compute_mulliken_charges",
"compute_1rdm",
"compare_mols",
"check_orthonormal",
"load_one_warning",
"create_generalized",
]
)


def compute_1rdm(iodata):

0 comments on commit 0ca750f

Please sign in to comment.