mangadap.util.parser module
Provides a set of parsing utility functions.
Todo
Add function that will parse the default MaNGA fits file name (see
mangadap.config.defaults.manga_fits_root()
).
Copyright © 2019, SDSS-IV/MaNGA Pipeline Group
- class mangadap.util.parser.DefaultConfig(f=None, interpolate=False)[source]
Bases:
object
A wrapper for the ConfigParser class that handles None values and provides some convenience functions.
- mangadap.util.parser.arginp_to_list(inp, evaluate=False, quiet=True)[source]
Separate a list of comma-separated values in the input string to a
list
.- Parameters:
inp (
str
,list
) – Input string with a list of comma-separated valuesevaluate (
bool
, optional) – Attempt to evaluate the elements in the list using eval.quiet (
bool
, optional) – Suppress terminal output.
- Returns:
The list of the comma-separated values
- Return type:
list
- mangadap.util.parser.list_to_csl_string(flist)[source]
Convert a list to a comma-separated string; i.e. perform the inverse of
arginp_to_list()
.- Parameters:
flist (
list
) – List to convert to a comma-separated string- Returns:
String with the values in the input list converted to strings separated by commas
- Return type:
str