openergy / opyplus

A package to work with EnergyPlus in python
Mozilla Public License 2.0
38 stars 13 forks source link

`No idd was found for version (9, 6, 0).` when running quickstart. #52

Closed kklein closed 2 years ago

kklein commented 2 years ago

Bug description When trying to execute the first two steps from the documentation's quickstart [0], the call to simulate throws a ValueError:

Traceback (most recent call last):
  File "/Users/kevin/Code/epautomation/test.py", line 21, in <module>
    s = op.simulate(idf_path, epw_path, "my-first-simulation")
  File "/usr/local/Caskroom/miniconda/base/envs/epautomation/lib/python3.10/site-packages/opyplus/simulation/simulation.py", line 513, in simulate
    s = Simulation.from_inputs(
  File "/usr/local/Caskroom/miniconda/base/envs/epautomation/lib/python3.10/site-packages/opyplus/simulation/simulation.py", line 188, in from_inputs
    epm = Epm.load(epm_or_buffer_or_path)  # we load epm (even if we will copy input file) to read e+ version
  File "/usr/local/Caskroom/miniconda/base/envs/epautomation/lib/python3.10/site-packages/opyplus/epm/epm.py", line 399, in load
    return cls().from_idf(
  File "/usr/local/Caskroom/miniconda/base/envs/epautomation/lib/python3.10/site-packages/opyplus/epm/epm.py", line 435, in from_idf
    return cls._create_from_buffer_or_path(
  File "/usr/local/Caskroom/miniconda/base/envs/epautomation/lib/python3.10/site-packages/opyplus/epm/epm.py", line 153, in _create_from_buffer_or_path
    return cls(
  File "/usr/local/Caskroom/miniconda/base/envs/epautomation/lib/python3.10/site-packages/opyplus/epm/epm.py", line 106, in __init__
    self._dev_idd = self._dev_idd_cls._dev_get_from_cache(version)
  File "/usr/local/Caskroom/miniconda/base/envs/epautomation/lib/python3.10/site-packages/opyplus/idd/idd.py", line 78, in _dev_get_from_cache
    idd = cls(version_or_buffer_or_path=version)
  File "/usr/local/Caskroom/miniconda/base/envs/epautomation/lib/python3.10/site-packages/opyplus/idd/idd.py", line 53, in __init__
    buffer_or_path = get_idd_path(version_or_buffer_or_path)
  File "/usr/local/Caskroom/miniconda/base/envs/epautomation/lib/python3.10/site-packages/opyplus/idd/resources/__init__.py", line 42, in get_idd_path
    raise ValueError(f"No idd was found for version {version}.")
ValueError: No idd was found for version (9, 6, 0).

To Reproduce Steps to reproduce the behavior:

  1. Create a conda environment with versions mentioned above.
  2. Run
    
    import os
    import opyplus as op

eplus_dir_path = op.get_eplus_base_dir_path((9, 6, 0))

idf path

idf_path = os.path.join( eplus_dir_path, "ExampleFiles", "1ZoneEvapCooler.idf" )

epw path

epw_path = os.path.join( eplus_dir_path, "WeatherData", "USA_CA_San.Francisco.Intl.AP.724940_TMY3.epw" )

run simulation

s = op.simulate(idf_path, epw_path, "my-first-simulation")



**Expected behavior**
Absence of an error. More concretely, I would expect the behavior described in the quickstart tutorial. Please note that the quickstart tutorial uses EnergyPlus version `(9, 0, 1)` - which, afaict, is not installed with the most recent `opyplus`release available for my system.

[0] https://opyplus.readthedocs.io/en/v1.2.1/quickstart/index.html
thomascerbelaud commented 2 years ago

Hello @kklein, thank you for raising this issue. I think PR #53 should resolve this. EnergyPlus IDD file for version 9.6 was not included in the resources until now, and this PR should make version 9.6 available. You may want to try to fork branch tc-energyplus_migration and see if it works if you cannot wait for the PR to be effective.

kklein commented 2 years ago

Just gave the PR a try, it works. Thanks a bunch! :)