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

dss._cffi_api_util.DSSException #40

Closed
BY-hash opened this issue Jan 25, 2022 · 2 comments
Closed

dss._cffi_api_util.DSSException #40

BY-hash opened this issue Jan 25, 2022 · 2 comments

Comments

@BY-hash
Copy link

BY-hash commented Jan 25, 2022

Hello,
I'm using dss-python library on linux, with:
import dss
dss_engine = dss.DSS
DSSText = dss_engine.Text

DSSText.Command works fine for editing elements etc. But when I try to use the parallel mechanism of DSS, I get the following errors:

    DSSText.Command =   "ClearAll"           
    DSSText.Command =   'Set Parallel=Yes'     

dss._cffi_api_util.DSSException: (302, 'Unknown Command: "ClearAll" \r\nClearAll ')
dss._cffi_api_util.DSSException: (130, 'Unknown parameter "Parallel" for Set Command ')

Why is this happening?

Second, I want to do a parallel for loop, where each for loop does many snap-hot solutions.
I have seen one issue here on parallel run, but not specifically on the use case of for loops.
Do you have any suggestion regarding such application?

Thank you !

@PMeira
Copy link
Member

PMeira commented Jan 26, 2022

Hi @BY-hash,
Currently those (actors in general, ClearAll and Set Parallel) are not supported.

We're working on implementing those right now. The building blocks are already implemented in the base Pascal library but not 100% ready yet.

Second, I want to do a parallel for loop, where each for loop does many snap-hot solutions.
I have seen one issue here on parallel run, but not specifically on the use case of for loops.
Do you have any suggestion regarding such application?

Since threading in Python is not great (GIL, etc.), usually we recommend either Python's built-in multiprocessing or tools like dask.distributed.
As you noted, we indeed already posted some examples both here on GitHub and in the official OpenDSS forum. Do you have any specific concern or doubt regarding those? If so, we can try to clarify and leave a move complete example for future users.

PS: I'll move this to the dss_python repo

@PMeira PMeira transferred this issue from dss-extensions/OpenDSSDirect.py Jan 26, 2022
@PMeira
Copy link
Member

PMeira commented Mar 9, 2022

@BY-hash Some more discussion on the topic at #42

And a first beta was uploaded to PyPI with support to the actor/parallel mechanism, if you'd like to try it:

pip install dss-python==0.12.0b1

Closing the issue since it's now addressed, but feel free to reopen if you see fit.

@PMeira PMeira closed this as completed Mar 9, 2022
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

2 participants