Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make __all__ immutable #354

Merged
merged 1 commit into from
Jun 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion iodata/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
__version__ = "0.0.0.post0"


__all__ = []
__all__ = ()


DESCRIPTION = """\
Expand Down
2 changes: 1 addition & 1 deletion iodata/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
2 changes: 1 addition & 1 deletion iodata/attrutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions iodata/basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

from .attrutils import validate_shape

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

ANGMOM_CHARS = "spdfghiklmnoqrtuvwxyzabce"

Expand Down
4 changes: 2 additions & 2 deletions iodata/docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion iodata/formats/charmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from ..docstrings import document_load_one
from ..utils import LineIterator, LoadError, amu, angstrom

__all__ = []
__all__ = ()


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

__all__ = []
__all__ = ()


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

__all__ = []
__all__ = ()


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

__all__ = []
__all__ = ()


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

__all__ = []
__all__ = ()


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

__all__ = []
__all__ = ()


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

__all__ = []
__all__ = ()


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

__all__ = []
__all__ = ()


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

__all__ = []
__all__ = ()


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

__all__ = []
__all__ = ()


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

__all__ = []
__all__ = ()


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

__all__ = []
__all__ = ()


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

__all__ = []
__all__ = ()


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

__all__ = []
__all__ = ()


PATTERNS = ["*.mol2"]
Expand Down
2 changes: 1 addition & 1 deletion iodata/formats/molden.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion iodata/formats/molekel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion iodata/formats/mwfn.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from ..orbitals import MolecularOrbitals
from ..utils import LineIterator, LoadError, angstrom

__all__ = []
__all__ = ()


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

__all__ = []
__all__ = ()


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

__all__ = []
__all__ = ()


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

__all__ = []
__all__ = ()


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

__all__ = []
__all__ = ()

PATTERNS = ["*.qchemlog"]

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

__all__ = []
__all__ = ()


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

__all__ = []
__all__ = ()


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

__all__ = []
__all__ = ()

PATTERNS = ["*.wfx"]

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

__all__ = []
__all__ = ()


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

from ..iodata import IOData

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


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

__all__ = []
__all__ = ()


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

__all__ = []
__all__ = ()


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

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


@attrs.define
Expand Down
2 changes: 1 addition & 1 deletion iodata/overlap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]]:
Expand Down
2 changes: 1 addition & 1 deletion iodata/overlap_cartpure.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

import numpy as np

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

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

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


num2sym: dict[int, str] = {
Expand Down
4 changes: 2 additions & 2 deletions iodata/test/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down