Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

network result summary fails if time horizon > 1 #7

Open
djohnsonbaugh opened this issue Jul 5, 2017 · 1 comment
Open

network result summary fails if time horizon > 1 #7

djohnsonbaugh opened this issue Jul 5, 2017 · 1 comment

Comments

@djohnsonbaugh
Copy link

Traceback (most recent call last):
File "main_10bus_id6.py", line 1021, in
print(network.results.summary())
File "C:\Program Files (x86)\Python35-32\lib\site-packages\dem\network.py", line 213, in summary
retval += "%-20s %10.4f\n" % (label, value)
TypeError: only length-1 arrays can be converted to Python scalars

@djohnsonbaugh
Copy link
Author

djohnsonbaugh commented Jul 5, 2017

`
Possible update?

def summary(self):
    retval = "Status: " + self.status if self.status else "none"
    if self.status != cvx.OPTIMAL:
        return retval

    retval += "\n"
    retval += "%-40s %10s\n" % ("Terminal", "Power")
    retval += "%-40s %10s\n" % ("--------", "-----")
    for device_terminal, value in self.power.items():
        label = "%s[%d]" % (device_terminal[0].name, device_terminal[1])
        retval += "%-40s" % (label)
        if type(value) == np.float64:
            retval += " %10.4f" % (value)
            retval += "\n"
        else:
            for v in value:
                retval += " %10.4f" % (v)
            retval += "\n"

    retval += "\n"
    retval += "%-20s %10s\n" % ("Net", "Price")
    retval += "%-20s %10s\n" % ("---", "-----")
    for net, value in self.price.items():
        retval += "%-20s" % (net.name)
        if type(value) == np.float64:
            retval += " %10.4f" % (value)
            retval += "\n"
        else:
            for v in value:
                retval += " %10.4f" % (v)
            retval += "\n"
    return retval

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant