dss-extensions / DSS-Python

Native, "direct" Python bindings (interface) and misc tools for a custom implementation of OpenDSS (EPRI Distribution System Simulator). Based on CFFI, DSS C-API, aiming for full COM API-level compatibility on Windows, Linux and MacOS, while providing various extensions.
https://dss-extensions.org/DSS-Python/
BSD 3-Clause "New" or "Revised" License
60 stars 4 forks source link

Is there a way suppress "Progress: " printing to stdout #12

Closed kdheepak closed 5 years ago

kdheepak commented 6 years ago

It looks like there is already an option to do this in electricdss-src. If this is already exposed, can you point me to it? If there's not can we add a way to do this?

PMeira commented 6 years ago

I don't think there is a global switch fully implemented for all messages yet. We can reuse NoFormsAllowed though -- it seems there was an intent to implement this but it was never finished for the DDLL and OpenDSSCmd.

It's a small change (a couple of conditionals) and we'd end up with implementations for DSS.AllowForms in both dss_python and ODDpy. I'll work on this before the next release.

PMeira commented 6 years ago

Added an implementation for AllowForms: by default AllowForms is false (it already was before, but the there was no logic implemented to use it) but it can be toggled to show progress and misc messages in stdout.

Let's leave this open until the next release. I also implemented it for ODDpy in https://github.com/PMeira/OpenDSSDirect.py/commit/311c2cc5fa56eb6b080e81e46565b5dd6e6a4e9c and tested locally. Since it would fail at the moment, I'll make a PR as soon as the next DSS Python is released.