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()).


License

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.

all_required(keys)[source]
get(key, default=None)[source]
getbool(key, default=None)[source]
getfloat(key, default=None)[source]
getint(key, default=None)[source]
getlist(key, evaluate=False, default=None)[source]
keyword_specified(key)[source]
read(f)[source]
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 values

  • evaluate (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