Skip to content

"Export Data Tables" = true in examples/monte_carlo leads to AttributeError: 'PyDssScenarioResults' object has no attribute '_elem_classes' #111

@nlaws-camus

Description

@nlaws-camus

If I change the simulation.toml in the examples/monte_carlo to have

"Export Data Tables" = true

I get

2022-10-14 11:56:33,245 - ERROR [PyDSS.pydss_project pydss_project.py:384] : Simulation failed
Traceback (most recent call last):
  File "/Users/nick/projects/pydss/PyDSS/PyDSS/pydss_project.py", line 378, in run
    scenario.export_data()
  File "/Users/nick/projects/pydss/PyDSS/PyDSS/pydss_results.py", line 350, in export_data
    self._export_element_timeseries(path, fmt, compress)
  File "/Users/nick/projects/pydss/PyDSS/PyDSS/pydss_results.py", line 356, in _export_element_timeseries
    for elem_class in self.list_element_classes():
  File "/Users/nick/projects/pydss/PyDSS/PyDSS/pydss_results.py", line 725, in list_element_classes
    return self._elem_classes[:]
AttributeError: 'PyDssScenarioResults' object has no attribute '_elem_classes'
Traceback (most recent call last):
  File "/Users/nick/projects/pydss/env/bin/pydss", line 33, in <module>
    sys.exit(load_entry_point('dsspy', 'console_scripts', 'pydss')())
  File "/Users/nick/projects/pydss/env/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/Users/nick/projects/pydss/env/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/Users/nick/projects/pydss/env/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/nick/projects/pydss/env/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/nick/projects/pydss/env/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/Users/nick/projects/pydss/PyDSS/PyDSS/cli/run.py", line 105, in run
    project.run(tar_project=tar_project, zip_project=zip_project, dry_run=dry_run)
  File "/Users/nick/projects/pydss/PyDSS/PyDSS/pydss_project.py", line 378, in run
    scenario.export_data()
  File "/Users/nick/projects/pydss/PyDSS/PyDSS/pydss_results.py", line 350, in export_data
    self._export_element_timeseries(path, fmt, compress)
  File "/Users/nick/projects/pydss/PyDSS/PyDSS/pydss_results.py", line 356, in _export_element_timeseries
    for elem_class in self.list_element_classes():
  File "/Users/nick/projects/pydss/PyDSS/PyDSS/pydss_results.py", line 725, in list_element_classes
    return self._elem_classes[:]
AttributeError: 'PyDssScenarioResults' object has no attribute '_elem_classes'

I did some debugging and discovered that this line:
https://github.com/NREL/PyDSS/blob/8a208ea5aa9d64919d60ce06854c14f1fa64eee7/PyDSS/pydss_results.py#L247
evaluates to True, which returns before PyDssScenarioResults._group and PyDssScenarioResults_elem_classes are defined.

Maybe not understanding the Exports options, which looks outdated. I was hoping to understand the Monte Carlo capability better and what I can get in the results exports.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions