# Path: frbpoppy/misc.py
# def pprint(*s, output=True):
#     """Hack to make for more informative print statements."""
#     f = inspect.stack()[1][1].split('/')[-1]
#     m = '{:13.13} |'.format(f)
# 
#     if output:
#         print(m, *s)
#     else:
#         lines = []
#         for e in s:
#             lines.append('\n'.join([f'{m} {f}' for f in e.split('\n')]))
#         return '\n'.join(lines)
# 
# Path: frbpoppy/paths.py
# class Paths():
#     def __init__(self):
#     def __str__(self):
#     def check(self, path):
#     def store(self, name, default, *args):
#     def data(self, *args):
#     def populations(self, *args):
#     def surveys(self, *args):
#     def models(self, *args):
#     def frbcat(self, *args):


import os
import subprocess
import sys
from frbpoppy.misc import pprint
from frbpoppy.paths import paths
        files (list, optional): List of population files to plot.
        tns (bool, optional): Whether to plot tns parameters. Defaults to
            True
        show (bool, optional): Whether to display the plot or not. Mainly used
            for debugging purposes. Defaults to True.
        mute (bool): Show output from Bokeh or not
        port (int): The port on which to launch Bokeh
        print_command (bool): Whether to show the command do_plot is running

    """
    if len(pops) > 0:

        # Save populations
        for pop in pops:

            if type(pop) == str:
                name = pop
            else:
                # Check whether empty population
                if pop.n_sources() < 1:
                    pprint(f'Skipping {pop.name} population as no sources')
                    continue
                pop.name = pop.name.lower()
                if '_for_plotting' not in pop.name:
                    pop.name += '_for_plotting'
                name = pop.name
                pop.save()

            # Save location
            file_name = name + '.p'

# Path: frbpoppy/misc.py
# def pprint(*s, output=True):
#     """Hack to make for more informative print statements."""
#     f = inspect.stack()[1][1].split('/')[-1]
#     m = '{:13.13} |'.format(f)
# 
#     if output:
#         print(m, *s)
#     else:
#         lines = []
#         for e in s:
#             lines.append('\n'.join([f'{m} {f}' for f in e.split('\n')]))
#         return '\n'.join(lines)
# 
# Path: frbpoppy/paths.py
# class Paths():
#     def __init__(self):
#     def __str__(self):
#     def check(self, path):
#     def store(self, name, default, *args):
#     def data(self, *args):
#     def populations(self, *args):
#     def surveys(self, *args):
#     def models(self, *args):
#     def frbcat(self, *args):


# Path: frbpoppy/do_plot.py
import os
import subprocess
import sys
from frbpoppy.misc import pprint
from frbpoppy.paths import paths

        files (list, optional): List of population files to plot.
        tns (bool, optional): Whether to plot tns parameters. Defaults to
            True
        show (bool, optional): Whether to display the plot or not. Mainly used
            for debugging purposes. Defaults to True.
        mute (bool): Show output from Bokeh or not
        port (int): The port on which to launch Bokeh
        print_command (bool): Whether to show the command do_plot is running

    """
    if len(pops) > 0:

        # Save populations
        for pop in pops:

            if type(pop) == str:
                name = pop
            else:
                # Check whether empty population
                if pop.n_sources() < 1:
                    pprint(f'Skipping {pop.name} population as no sources')
                    continue
                pop.name = pop.name.lower()
                if '_for_plotting' not in pop.name:
                    pop.name += '_for_plotting'
                name = pop.name
                pop.save()

            # Save location
            file_name = name + '.p'

            out = os.path.join(paths.populations(), file_name)