Skip to content

BUG: stylesheets are not included in GUI release #264

@ahobeost

Description

@ahobeost

When trying to run the old processing of the Solar_dhw_GUI example, the following error occurred:

C:\pytrnsys_versions\pytrnsys-gui-master-gui_3d40b5b-pytrnsys_6dbe3fb-2025-09-18T10_35_54+00_00\pytrnsys_gui_data\examples\solar_dhw_GUI
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
File C:\pytrnsys_versions\pytrnsys-gui-master-gui_ccb6bc7-pytrnsys_4a22341-2026-02-03T16_09_07+00_00\site-packages\matplotlib\style\core.py:137, in use(style)
    136 try:
--> 137     style = _rc_params_in_file(style)
    138 except OSError as err:

File C:\pytrnsys_versions\pytrnsys-gui-master-gui_ccb6bc7-pytrnsys_4a22341-2026-02-03T16_09_07+00_00\site-packages\matplotlib\__init__.py:879, in _rc_params_in_file(fname, transform, fail_on_error)
    878 rc_temp = {}
--> 879 with _open_file_or_url(fname) as fd:
    880     try:

File contextlib.py:137, in __enter__(self)

File C:\pytrnsys_versions\pytrnsys-gui-master-gui_ccb6bc7-pytrnsys_4a22341-2026-02-03T16_09_07+00_00\site-packages\matplotlib\__init__.py:856, in _open_file_or_url(fname)
    855 fname = os.path.expanduser(fname)
--> 856 with open(fname, encoding='utf-8') as f:
    857     yield f

FileNotFoundError: [Errno 2] No such file or directory: 'C:\\pytrnsys_versions\\pytrnsys-gui-master-gui_ccb6bc7-pytrnsys_4a22341-2026-02-03T16_09_07+00_00\\site-packages\\pytrnsys\\plot\\.\\\\stylesheets\\word.mplstyle'

The above exception was the direct cause of the following exception:

OSError                                   Traceback (most recent call last)
File C:\pytrnsys_versions\pytrnsys-gui-master-gui_3d40b5b-pytrnsys_6dbe3fb-2025-09-18T10_35_54+00_00\pytrnsys_gui_data\examples\solar_dhw_GUI\process.py:17
     15 tool = pParallelTrnsys.ProcessParallelTrnsys()
     16 tool.readConfig(pathBase, configName)
---> 17 tool.process()

File C:\pytrnsys_versions\pytrnsys-gui-master-gui_ccb6bc7-pytrnsys_4a22341-2026-02-03T16_09_07+00_00\site-packages\pytrnsys\psim\processParallelTrnsys.py:277, in ProcessParallelTrnsys.process(self)
    275 else:
    276     newPath = pathFolder
--> 277 processTrnsysDf = self._createProcessTrnsysDf(newPath, name)
    279 self.logger.info("%s will be processed" % name)
    280 processingCase = self._createProcessingCase(processTrnsysDf, pathFolder, name)

File C:\pytrnsys_versions\pytrnsys-gui-master-gui_ccb6bc7-pytrnsys_4a22341-2026-02-03T16_09_07+00_00\site-packages\pytrnsys\psim\processParallelTrnsys.py:180, in ProcessParallelTrnsys._createProcessTrnsysDf(self, pathFolder, fileName)
    179 def _createProcessTrnsysDf(self, pathFolder: str, fileName: str) -> processTrnsys.ProcessTrnsysDf:
--> 180     return processTrnsys.ProcessTrnsysDf(pathFolder, fileName, individualFile=self.individualFile)

File C:\pytrnsys_versions\pytrnsys-gui-master-gui_ccb6bc7-pytrnsys_4a22341-2026-02-03T16_09_07+00_00\site-packages\pytrnsys\psim\processTrnsysDf.py:68, in ProcessTrnsysDf.__init__(self, _path, _name, language, individualFile)
     65 self.rootPath = os.getcwd()
     67 self.doc = latex.LatexReport(self.outputPath, self.fileName)
---> 68 self.plot = plot.PlotMatplotlib(language=language)
     70 self.plot.setPath(self.outputPath)
     72 self.pltB = pltB.PlotBokeh()

File C:\pytrnsys_versions\pytrnsys-gui-master-gui_ccb6bc7-pytrnsys_4a22341-2026-02-03T16_09_07+00_00\site-packages\pytrnsys\plot\plotMatplotlib.py:39, in PlotMatplotlib.__init__(self, language, stylesheet, extensionPlot)
     37 else:
     38     self.stylesheet = os.path.join(self.root, r".\\stylesheets", stylesheet)
---> 39 plt.style.use(self.stylesheet)
     40 self.extensionPlot = extensionPlot
     41 self.yearlyFactor = 10

File C:\pytrnsys_versions\pytrnsys-gui-master-gui_ccb6bc7-pytrnsys_4a22341-2026-02-03T16_09_07+00_00\site-packages\matplotlib\style\core.py:139, in use(style)
    137         style = _rc_params_in_file(style)
    138     except OSError as err:
--> 139         raise OSError(
    140             f"{style!r} is not a valid package style, path of style "
    141             f"file, URL of style file, or library style name (library "
    142             f"styles are listed in `style.available`)") from err
    143 filtered = {}
    144 for k in style:  # don't trigger RcParams.__getitem__('backend')

OSError: 'C:\\pytrnsys_versions\\pytrnsys-gui-master-gui_ccb6bc7-pytrnsys_4a22341-2026-02-03T16_09_07+00_00\\site-packages\\pytrnsys\\plot\\.\\\\stylesheets\\word.mplstyle' is not a valid package style, path of style file, URL of style file, or library style name (library styles are listed in `style.available`)

The problem is, that this style sheet is not included in the release, nor is the stylesheets folder.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions