Code Monkey home page Code Monkey logo

Comments (6)

jamiebull1 avatar jamiebull1 commented on September 2, 2024

I think I've come across a better solution for this, and don't know why I didn't think of it before. Rather than replacing colons, we wrap every object name in double quotes. I'll have a look to see if there's an obvious place for this to happen.

See PyDot issue #28 and workaround.

from eppy.

santoshphilip avatar santoshphilip commented on September 2, 2024

I hand edited the Boiler.dot file and put the colons (:) back in. Then put double quotes around the strings. Looks like it will work.

from eppy.

jamiebull1 avatar jamiebull1 commented on September 2, 2024

OK. I think the simplest way to do this is to replace makeanode, makeabranch and makeendnode with the following:

def makeanode(name):
    name = escape_char(name, ':')
    return pydot.Node(name, shape="plaintext", label=name)

def makeabranch(name):
    name = escape_char(name, ':')
    return pydot.Node(name, shape="box3d", label=name)

def makeendnode(name):
    name = escape_char(name, ':')
    return pydot.Node(name, shape="doubleoctagon", label=name, 
        style="filled", fillcolor="#e4e4e4")

def escape_char(name, char):
    """escape strings which contain a specific character, char"""
    if char in name:
        return u"\"" + name + u"\""
    else:
        return name

For boiler.idf in resources\idffiles\V8_0_1 this produces the loop diagram attached which looks correct to me.

boiler

from eppy.

santoshphilip avatar santoshphilip commented on September 2, 2024

Can you make a branch i33_loopdiagram and push this code change in it.
I'll review and merge it develop (may happen after the license change release)

from eppy.

jamiebull1 avatar jamiebull1 commented on September 2, 2024

No problem. I've made the change in loopdiagram.py and in ex_loopdiagram.py too. Not sure which of those is current.

from eppy.

santoshphilip avatar santoshphilip commented on September 2, 2024

Jamie, I have merged this branch into develop
You have been added onto the copyright as follows

Copyright (c) 2015 Jamie Bull

Let me know if you need that updated (typos etc.)

from eppy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.