Source code for pyratbay.opacity.alkali
# Copyright (c) 2021-2025 Cubillos & Blecic
# Pyrat Bay is open-source software under the GNU GPL-2.0 license (see LICENSE)
"""Alkali resonant-line models."""
from .alkali import *
__all__ = alkali.__all__ + ['get_model']
[docs]
def get_model(name, *args, **kwargs):
"""Get an alkali model by its name."""
if name == 'sodium_vdw':
return SodiumVdW(*args, **kwargs)
if name == 'potassium_vdw':
return PotassiumVdW(*args, **kwargs)
# Clean up top-level namespace--delete everything that isn't in __all__
# or is a magic attribute, and that isn't a submodule of this package
for varname in dir():
if not ((varname.startswith('__') and varname.endswith('__')) or
varname in __all__):
del locals()[varname]
del(varname)