Skip to content

Commit

Permalink
docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
astronomerritt committed May 14, 2024
1 parent 68f6d83 commit 3b25a26
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/adler/utilities/AdlerCLIArguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class AdlerCLIArguments:
"""
Class for storing abd validating Adler command-line arguments.
Attributes:
Attributes
-----------
args : argparse.Namespace object
argparse.Namespace object created by calling parse_args().
Expand Down
26 changes: 26 additions & 0 deletions src/adler/utilities/adler_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,32 @@ def setup_adler_logging(
log_file_info="adler.log",
log_file_error="adler.err",
):
"""Sets up two logs for Adler: info, which logs everything, and error, which logs warnings and errors.
Parameters
-----------
log_location : string
Filepath to directory in which to save logs.
log_format : string, optional
Format for log filename.
Default = "%(asctime)s %(name)-12s %(levelname)-8s %(message)s "
log_name : string, optional
Name of log. Default = ""
log_file_info : string, optional
Name with which to save info log. Default = "adler.log"
log_file_error : string, optional
Name with which to save error log. Default = "adler.err"
Returns
----------
log : logging object
Log object.
"""

log = logging.getLogger(log_name)
log_formatter = logging.Formatter(log_format)

Expand Down
16 changes: 16 additions & 0 deletions src/adler/utilities/readin_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@


def read_in_SSObjectID_file(readin_path):
"""Reads in a list of SSOIDs from a text file and performs basic validation.
Parameters
-----------
readin_path : str
String containing filepath to text file.
Returns
-----------
ssoid_list : list
A list of SSOIDs.
"""

with open(readin_path) as f:
ssoid_list = f.read().splitlines()

Expand Down
1 change: 1 addition & 0 deletions tests/adler/utilities/test_readin_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@


def test_read_in_SSObjectID_file():

from adler.utilities.readin_utilities import read_in_SSObjectID_file

good_ssoids = read_in_SSObjectID_file(get_test_data_filepath("test_SSOIDs.txt"))
Expand Down

0 comments on commit 3b25a26

Please sign in to comment.