From 890c9f56069a381a40f8c3ec8a556fd7353c83c7 Mon Sep 17 00:00:00 2001 From: Ricky O'Steen Date: Tue, 23 Apr 2024 15:46:14 -0400 Subject: [PATCH] Clarify docstrings --- specutils/spectra/spectral_region.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/specutils/spectra/spectral_region.py b/specutils/spectra/spectral_region.py index 62aa88fda..5d7df2877 100644 --- a/specutils/spectra/spectral_region.py +++ b/specutils/spectra/spectral_region.py @@ -117,6 +117,7 @@ def from_qtable(cls, table): Parameters ---------- table : `~astropy.table.QTable` + An `~astropy.table.QTable` object with ``lower_bound`` and ``upper_bound`` columns. Returns ------- @@ -132,12 +133,13 @@ def from_qtable(cls, table): @classmethod def read(cls, filename): """ - Read in the ecsv file format output by the SpectralRegion.write method. + Create a ``SpectralRegion`` from an ecsv file output by the + ``SpectralRegion.write`` method. Parameters ---------- filename : str - The name of the ecsv file on disk to be read in as a SpectralRegion. + The name of the ecsv file on disk to be read in as a ``SpectralRegion``. """ table = QTable.read(filename) return cls.from_qtable(table) @@ -386,11 +388,14 @@ def _table(self): return QTable([lower_bounds, upper_bounds], names=("lower_bound", "upper_bound")) def as_table(self): + """Returns an `~astropy.table.QTable` with the upper and lower bound + of each subregion in the ``SpectralRegion``.""" return self._table def write(self, filename="spectral_region.ecsv", overwrite=True): """ Write the SpectralRegion to an ecsv file using `~astropy.table.QTable`. + Overwrites by default. """ if not filename.endswith("ecsv"): raise ValueError("SpectralRegions can only be written out to ecsv files.")