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

Conversion issue form OpenDSS-G/OpenDSS to Gridlab-D #395

Open
Barsha96 opened this issue Jul 15, 2022 · 5 comments
Open

Conversion issue form OpenDSS-G/OpenDSS to Gridlab-D #395

Barsha96 opened this issue Jul 15, 2022 · 5 comments

Comments

@Barsha96
Copy link

Hello, I am trying to convert openDSS files (Using Master.dss) to the Gridlab-d glm file. I am using the following code:

ditto-cli convert --from opendss --input Master.dss --to gridlabd --output ./out

I can convert a IEEE_4_node.glm into opendss files but cannot convert the same dss files into a glm file. The Issues I get are:

Traceback (most recent call last):
  File "c:\python3.9\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\python3.9\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Python3.9\Scripts\ditto-cli.exe\__main__.py", line 7, in <module>
  File "C:\Users\bupadhy\AppData\Roaming\Python\Python39\site-packages\click\core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\bupadhy\AppData\Roaming\Python\Python39\site-packages\click\core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "C:\Users\bupadhy\AppData\Roaming\Python\Python39\site-packages\click\core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Users\bupadhy\AppData\Roaming\Python\Python39\site-packages\click\core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\bupadhy\AppData\Roaming\Python\Python39\site-packages\click\core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "C:\Users\bupadhy\AppData\Roaming\Python\Python39\site-packages\click\decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "c:\python3.9\lib\site-packages\ditto\cli.py", line 173, in convert
    Converter(
  File "c:\python3.9\lib\site-packages\ditto\converter.py", line 246, in convert
    self.reader.parse(self.m)
  File "c:\python3.9\lib\site-packages\ditto\readers\opendss\read.py", line 245, in parse
    self.parse_power_source(
  File "c:\python3.9\lib\site-packages\ditto\readers\opendss\read.py", line 52, in timed
    result = method(*args, **kw)
  File "c:\python3.9\lib\site-packages\ditto\readers\opendss\read.py", line 344, in parse_power_source
    sources = _dss_class_to_dict("Vsource")
  File "c:\python3.9\lib\site-packages\ditto\readers\opendss\read.py", line 2765, in _dss_class_to_dict
    return dss.utils.class_to_dataframe(class_name).to_dict(orient="index")
  File "c:\python3.9\lib\site-packages\opendssdirect\utils.py", line 125, in class_to_dataframe
    dss.Circuit.SetActiveClass("{class_name}".format(class_name=class_name))
  File "c:\python3.9\lib\site-packages\opendssdirect\Circuit.py", line 100, in SetActiveClass
    return CheckForError(lib.Circuit_SetActiveClass(ClassName))
  File "c:\python3.9\lib\site-packages\dss\_cffi_api_util.py", line 81, in CheckForError
    raise DSSException(error_num, self._get_string(self._lib.Error_Get_Description()))
dss._cffi_api_util.DSSException: (242, 'Redirect File: "C:\\Users\\bupadhy\\OneDrive.dss" Not Found.')

The system says OneDrive.dss is not found. The system seems to be automatically getting to that file that was not provided and that does not exist.

Is there anything that I might be doing wrong?

Thanks and Regards,
Barsha

@PMeira
Copy link

PMeira commented Jul 19, 2022

@Barsha96 Any chance you have spaces in your full file paths?

There's probably a pair of quotes missing in DiTTo.

@kdheepak
Copy link
Member

@PMeira where do you think a pair of quotes is missing?

@PMeira
Copy link

PMeira commented Jul 19, 2022

@kdheepak Right here:

self.function("redirect {master_file}".format(master_file=master_dss_file))

@Barsha96
Copy link
Author

Barsha96 commented Jul 21, 2022

@Barsha96 Any chance you have spaces in your full file paths?

There's probably a pair of quotes missing in DiTTo.

The issue was I had to give full path and quote those with spaces and dashes specially for the input. I had to give absolute path for the input but could give both absolute path and relative path fir the output location. Doing the following solved it.

ditto-cli convert --from opendss --input "C:\Users\bupadhy\OneDrive - UTol\Desktop\conversion\CampusModel\ModelDSS\Master.dss" --to gridlabd --output ./CampusModel/converted

@kdheepak
Copy link
Member

@PMeira I can make a PR for that. Thanks for pointing that out!

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

3 participants