Exemple #1
0
def gridLabToDSS(args):
	''' Convert gridlab file to dss. ''' 
	m = Store()
	reader = GReader(input_file=args.infile)
	writer = GWriter(output_path='.')
	reader.parse(m)
	writer.write(m)
	print ("DSS FILE WRITTEN")
Exemple #2
0
def test_gld_reader():
    gridlabd_models_dir = os.path.join(current_directory, 'data',
                                       'small_cases', 'gridlabd')
    gridlabd_models = [
        f for f in os.listdir(gridlabd_models_dir) if not f.startswith('.')
    ]
    from ditto.readers.gridlabd.read import Reader
    for modelfile in gridlabd_models:
        m = Store()
        r = Reader(input_file=os.path.join(gridlabd_models_dir, modelfile))
        r.parse(m)
Exemple #3
0
def test_gld_reader():
    gridlabd_models_dir = os.path.join(current_directory, "data",
                                       "small_cases", "gridlabd")
    gridlabd_models = [
        f for f in os.listdir(gridlabd_models_dir) if not f.startswith(".")
    ]
    from ditto.readers.gridlabd.read import Reader

    for model in gridlabd_models:
        m = Store()
        r = Reader(
            input_file=os.path.join(gridlabd_models_dir, model, "node.glm"))
        r.parse(m)
Exemple #4
0
def test_cyme_reader():
    '''
    TODO
    '''
    from ditto.readers.cyme.read import Reader
    from ditto.store import Store
    cyme_models_dir = os.path.join(current_directory, 'data', 'small_cases',
                                   'cyme')
    cyme_models = [
        f for f in os.listdir(cyme_models_dir) if not f.startswith('.')
    ]
    for model in cyme_models:
        m = Store()
        r = Reader(data_folder_path=os.path.join(cyme_models_dir, model))
        r.parse(m)
        #TODO: Log properly
        print('>Cyme model {model} parsed.\n'.format(model=model))
Exemple #5
0
def test_cyme_reader():
    """
    TODO
    """
    from ditto.readers.cyme.read import Reader
    from ditto.store import Store

    cyme_models_dir = os.path.join(current_directory, "data", "small_cases",
                                   "cyme")
    cyme_models = [
        f for f in os.listdir(cyme_models_dir) if not f.startswith(".")
    ]
    for model in cyme_models:
        m = Store()
        r = Reader(data_folder_path=os.path.join(cyme_models_dir, model))
        r.parse(m)
        # TODO: Log properly
        print(">Cyme model {model} parsed.\n".format(model=model))
Exemple #6
0
def test_opendss_reader():
    '''
    TODO
    '''
    from ditto.readers.opendss.read import Reader
    from ditto.store import Store
    opendss_models_dir = os.path.join(current_directory, 'data', 'small_cases',
                                      'opendss')
    opendss_models = [
        f for f in os.listdir(opendss_models_dir) if not f.startswith('.')
    ]
    for model in opendss_models:
        m = Store()
        r = Reader(master_file=os.path.join(opendss_models_dir, model,
                                            'master.dss'),
                   buscoordinates_file=os.path.join(opendss_models_dir, model,
                                                    'buscoord.dss'))
        r.parse(m)
        #TODO: Log properly
        print('>OpenDSS model {model} parsed.\n'.format(model=model))
Exemple #7
0
def test_opendss_reader():
    """
    TODO
    """
    from ditto.readers.opendss.read import Reader
    from ditto.store import Store

    opendss_models_dir = os.path.join(current_directory, "data", "small_cases",
                                      "opendss")
    opendss_models = [
        f for f in os.listdir(opendss_models_dir) if not f.startswith(".")
    ]
    for model in opendss_models:
        m = Store()
        r = Reader(
            master_file=os.path.join(opendss_models_dir, model, "master.dss"),
            buscoordinates_file=os.path.join(opendss_models_dir, model,
                                             "buscoord.dss"),
        )
        r.parse(m)
        # TODO: Log properly
        print(">OpenDSS model {model} parsed.\n".format(model=model))
Exemple #8
0
def test_gridlabd_to_ephasor():
    from ditto.readers.gridlabd.read import Reader
    from ditto.store import Store
    from ditto.writers.ephasor.write import Writer

    gridlabd_models = [
        f for f in os.listdir(
            os.path.join(current_directory, 'data/small_cases/gridlabd/'))
        if not f.startswith('.')
    ]
    for model in gridlabd_models:
        m = Store()
        r = Reader()
        r.parse(m)
        m.set_names()
        #TODO: Log properly
        print('>Gridlab-D model {model} read...'.format(model=model))
        output_path = tempfile.TemporaryDirectory()
        w = Writer(output_path=output_path.name, log_path=output_path)
        w.write(m)
        #TODO: Log properly
        print('>...and written to Ephasorsim.\n')