How to use diagrams - 10 common examples

To help you get started, we’ve selected a few diagrams examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github santoshphilip / eppy / diagrams / s_adu2uncontr1.py View on Github external
idd = eplus_functions.Idd(commdct, commlst, theidd, block)
        idfw = eplus_functions.IdfWrapper(data, idd)
        print "%s | %s | %s" % (zonename, aduname, uunitname)
        adu2unctr(idfw, zonename, aduname, uunitname)
        data = idfw.idf
        txt = `data`
        open(outfile, 'w').write(txt)
        # #--------------------------
        # fname = "../idffiles/doas2.idf"
        # zonename = "ZN_1_FLR_2_SEC_1"
        # aduname = "ZN_1_FLR_2_SEC_1 ATU"
        # uunitname = "ZN_1_FLR_2_SEC_1 uncontrolled"
        # outname = "../idffiles/doas2_1.idf"
        # #--------------------------

    except Usage, err:
        print >> sys.stderr, sys.argv[0].split("/")[-1] + ": " + str(err.msg)
        print >> sys.stderr, "\t for help use --help"
        return 2
github santoshphilip / eppy / diagrams / s_airloop3.py View on Github external
if option in ("-o", "--output"):
                output = value
                
        iddfile = "../iddfiles/Energy+V6_0.idd"
        fname = args[0]
        iddfile = "../iddfiles/Energy+V6_0.idd"
        data, commdct = readidf.readdatacommdct(fname, iddfile=iddfile)
        print "constructing the loops"
        edges = maketheairloop(data, commdct)
        print "making the diagram"
        g = makethediagram(edges)
        dotname = '%s.dot' % (os.path.splitext(fname)[0])
        pngname = '%s.png' % (os.path.splitext(fname)[0])
        g.write(dotname)
        g.write_png(pngname)
    except Usage, err:
        print >> sys.stderr, sys.argv[0].split("/")[-1] + ": " + str(err.msg)
        print >> sys.stderr, "\t for help use --help"
        return 2
github santoshphilip / eppy / diagrams / s_airplantloop2.py View on Github external
iddfile = "../iddfiles/Energy+V6_0.idd"
        fname = args[0]
        iddfile = "../iddfiles/Energy+V6_0.idd"
        print "readingfile"
        data, commdct = readidf.readdatacommdct(fname, iddfile=iddfile)
        print "constructing the loops"
        edges = makeairplantloop(data, commdct)
        edges = diagram.cleanedges(edges)
        print "making the diagram"
        g = diagram.makediagram(edges)
        dotname = '%s.dot' % (os.path.splitext(fname)[0])
        pngname = '%s.png' % (os.path.splitext(fname)[0])
        g.write(dotname)
        g.write_png(pngname)
    except Usage, err:
        print >> sys.stderr, sys.argv[0].split("/")[-1] + ": " + str(err.msg)
        print >> sys.stderr, "\t for help use --help"
        return 2
github santoshphilip / eppy / diagrams / s_branchdiagrams.py View on Github external
def main(argv=None):
    if argv is None:
        argv = sys.argv
    try:
        try:
            opts, args = getopt.getopt(argv[1:], "ho:v", ["help", "output="])
        except getopt.error, msg:
            raise Usage(msg)
    
        # option processing
        for option, value in opts:
            if option == "-v":
                verbose = True
            if option in ("-h", "--help"):
                raise Usage(help_message)
            if option in ("-o", "--output"):
                output = value
        # ====================        
        iddfile = "../iddfiles/Energy+V6_0.idd"
        fname = args[0]
        makesavebranchdiagrams(fname, iddfile)
        # ====================        
    except Usage, err:
        print >> sys.stderr, sys.argv[0].split("/")[-1] + ": " + str(err.msg)
github santoshphilip / eppy / diagrams / s_branchdiagrams.py View on Github external
def main(argv=None):
    if argv is None:
        argv = sys.argv
    try:
        try:
            opts, args = getopt.getopt(argv[1:], "ho:v", ["help", "output="])
        except getopt.error, msg:
            raise Usage(msg)
    
        # option processing
        for option, value in opts:
            if option == "-v":
                verbose = True
            if option in ("-h", "--help"):
                raise Usage(help_message)
            if option in ("-o", "--output"):
                output = value
        # ====================        
        iddfile = "../iddfiles/Energy+V6_0.idd"
        fname = args[0]
        makesavebranchdiagrams(fname, iddfile)
        # ====================        
    except Usage, err:
        print >> sys.stderr, sys.argv[0].split("/")[-1] + ": " + str(err.msg)
        print >> sys.stderr, "\t for help use --help"
        return 2
github santoshphilip / eppy / diagrams / s_cleanfile.py View on Github external
def main(argv=None):
    if argv is None:
        argv = sys.argv
    try:
        try:
            opts, args = getopt.getopt(argv[1:], "ho:v", ["help", "output="])
        except getopt.error, msg:
            raise Usage(msg)
    
        # option processing
        for option, value in opts:
            if option == "-v":
                verbose = True
            if option in ("-h", "--help"):
                raise Usage(help_message)
            if option in ("-o", "--output"):
                output = value
                
        iddfile = "../iddfiles/Energy+V6_0.idd"
        fname = args[0]
        newname = '%s_clean.idf' % (os.path.splitext(fname)[0])
        block,commlst,commdct=parse_idd.extractidddata(iddfile)
        theidd=eplusdata.idd(block,2)
        data, commdct = readidf.readdatacommdct(fname, iddfile=theidd,
                                    commdct=commdct)

        txt = `data`
        open(newname, 'w').write(txt)
    
    except Usage, err:
        print >> sys.stderr, sys.argv[0].split("/")[-1] + ": " + str(err.msg)
github santoshphilip / eppy / diagrams / s_plantloop1.py View on Github external
def main(argv=None):
    if argv is None:
        argv = sys.argv
    try:
        try:
            opts, args = getopt.getopt(argv[1:], "ho:v", ["help", "output="])
        except getopt.error, msg:
            raise Usage(msg)
    
        # option processing
        for option, value in opts:
            if option == "-v":
                verbose = True
            if option in ("-h", "--help"):
                raise Usage(help_message)
            if option in ("-o", "--output"):
                output = value
                
        iddfile = "../iddfiles/Energy+V6_0.idd"
        fname = args[0]
        g = makeplantloop(iddfile, fname)
        g.write('%s.dot' % (os.path.splitext(fname)[0]))
        g.write_png('%s.png' % (os.path.splitext(fname)[0]))
    
    except Usage, err:
        print >> sys.stderr, sys.argv[0].split("/")[-1] + ": " + str(err.msg)
        print >> sys.stderr, "\t for help use --help"
        return 2
github santoshphilip / eppy / diagrams / s_plantloop2.py View on Github external
def main(argv=None):
    if argv is None:
        argv = sys.argv
    try:
        try:
            opts, args = getopt.getopt(argv[1:], "ho:v", ["help", "output="])
        except getopt.error, msg:
            raise Usage(msg)
    
        # option processing
        for option, value in opts:
            if option == "-v":
                verbose = True
            if option in ("-h", "--help"):
                raise Usage(help_message)
            if option in ("-o", "--output"):
                output = value
                
        iddfile = "../iddfiles/Energy+V6_0.idd"
        fname = args[0]
        print "make main loop"
        g = makeplantloop(iddfile, fname)
        g.write('%s.dot' % (os.path.splitext(fname)[0]))
        g.write_png('%s.png' % (os.path.splitext(fname)[0]))
        print "diagram each branch. "
        makesavebranchdiagrams(fname, iddfile)
    except Usage, err:
        print >> sys.stderr, sys.argv[0].split("/")[-1] + ": " + str(err.msg)
        print >> sys.stderr, "\t for help use --help"
        return 2
github santoshphilip / eppy / diagrams / s_rename_name.py View on Github external
print args
        fname, objkey, oldname, newname, newfname = args
        objkey = objkey.upper()
        iddfile = "../iddfiles/Energy+V6_0.idd"
        block,commlst,commdct=parse_idd.extractidddata(iddfile)
        theidd=eplusdata.idd(block,2)
        data, commdct = readidf.readdatacommdct(fname, iddfile=theidd,
                                    commdct=commdct)
        idd = eplus_functions.Idd(commdct, commlst, theidd, block)
        idfw = eplus_functions.IdfWrapper(data, idd)
        # ---
        eplus_functions.rename_name(idfw, key, oldname, newname)
        txt = `data`
        open(newfname, 'w').write(txt)
    
    except Usage, err:
        print >> sys.stderr, sys.argv[0].split("/")[-1] + ": " + str(err.msg)
        print >> sys.stderr, "\t for help use --help"
        return 2
github PyCon / pycon / diagrams / overview.py View on Github external
def main():
    if len(sys.argv) != 2:
        print >>sys.stderr, 'usage: overview.py destination_directory'
        sys.exit(2)
    with open('overview.tpl') as f:
        template_text = f.read()
    for day, end_time in zip(range(1, 6), [1730, 2030, 2045, 2045, 2045]):
        random.seed(day)
        scope = dict(
            day=day,
            t=Time((800 if day < 3 else 700), end_time, 2),
            )
        output = template(template_text, **scope)
        path = os.path.join(sys.argv[1], 'overview{}.svg'.format(day))
        with open(path, 'w') as f:
            f.write(output.encode('utf-8'))