Пример #1
0
def latestidd():
    """extract the latest idd installed"""
    pth, _ = run_functions.install_paths(version='8.8.0') # works with any value in version
    dirpth = os.path.dirname(pth)
    dirpth = os.path.dirname(dirpth)
    alldirs = os.listdir(dirpth)
    eplusdirs = [dir for dir in alldirs if dir.startswith('EnergyPlus')]
    maxapp = max(eplusdirs)
    ver = folder2ver(maxapp)
    return ver
Пример #2
0
def latestidd():
    """extract the latest idd installed"""
    pth, _ = run_functions.install_paths(version='8.8.0') # works with any value in version
    dirpth = os.path.dirname(pth)
    dirpth = os.path.dirname(dirpth)
    alldirs = os.listdir(dirpth)
    eplusdirs = [dir for dir in alldirs if dir.startswith('EnergyPlus')]
    maxapp = max(eplusdirs)
    ver = folder2ver(maxapp)
    return ver
Пример #3
0
def get_eplus_dirs(version=ep_version):
    """Returns EnergyPlus root folder for a specific version.

    Returns (Path): The folder path.

    Args:
        version (str): Version number in the form "9-2-0" to search for.
    """
    from eppy.runner.run_functions import install_paths

    eplus_exe, eplus_weather = install_paths(version)
    return Path(eplus_exe).dirname()
Пример #4
0
THIS_DIR = os.path.dirname(os.path.abspath(__file__))

RESOURCES_DIR = os.path.join(THIS_DIR, os.pardir, "eppy", "resources")

IDD_FILES = os.path.join(RESOURCES_DIR, "iddfiles")
IDF_FILES = os.path.join(RESOURCES_DIR, "idffiles")
try:
    VERSION = os.environ["ENERGYPLUS_INSTALL_VERSION"]  # used in CI files
except KeyError:
    VERSION = "8-9-0"  # current default for integration tests on local system
TEST_IDF = "V{}/smallfile.idf".format(VERSION[:3].replace("-", "_"))
TEST_EPW = "USA_CA_San.Francisco.Intl.AP.724940_TMY3.epw"
TEST_IDD = "Energy+V{}.idd".format(VERSION.replace("-", "_"))
TEST_OLD_IDD = "Energy+V7_2_0.idd"

eplus_exe, eplus_weather = install_paths(VERSION,
                                         os.path.join(IDD_FILES, TEST_IDD))


def has_severe_errors(results="run_outputs"):
    """Check for severe errors in the eplusout.end file."""
    end_filename = glob("{}/*.end".format(results))[0]
    with open(os.path.join(end_filename), "r") as end_file:
        end_txt = end_file.read()
    num_severe = int(re.findall(r" (\d*) Severe Error", end_txt)[0])
    return num_severe > 0


def test_version_reader():
    """Test that get the expected idd_version when reading an IDF/IDD."""
    # We need to reload modeleditor since the IDF class may have had an IDD
    # which causes problems.
Пример #5
0
THIS_DIR = os.path.dirname(os.path.abspath(__file__))

RESOURCES_DIR = os.path.join(THIS_DIR, os.pardir, 'resources')

IDD_FILES = os.path.join(RESOURCES_DIR, 'iddfiles')
IDF_FILES = os.path.join(RESOURCES_DIR, 'idffiles')
try:
    VERSION = os.environ["ENERGYPLUS_INSTALL_VERSION"]  # used in CI files
except KeyError:
    VERSION = '8-9-0'  # current default for integration tests on local system
TEST_IDF = "V{}/smallfile.idf".format(VERSION[:3].replace('-', '_'))
TEST_EPW = 'USA_CA_San.Francisco.Intl.AP.724940_TMY3.epw'
TEST_IDD = "Energy+V{}.idd".format(VERSION.replace('-', '_'))
TEST_OLD_IDD = 'Energy+V7_2_0.idd'

eplus_exe, eplus_weather = install_paths(VERSION, os.path.join(IDD_FILES, TEST_IDD))


def has_severe_errors(results='run_outputs'):
    """Check for severe errors in the eplusout.end file.
    """
    end_filename = glob('{}/*.end'.format(results))[0]
    with open(os.path.join(end_filename), 'r') as end_file:
        end_txt = end_file.read()
    num_severe = int(re.findall(r' (\d*) Severe Error', end_txt)[0])
    return num_severe > 0


def test_version_reader():
    """Test that get the expected idd_version when reading an IDF/IDD.
    """
Пример #6
0
THIS_DIR = os.path.dirname(os.path.abspath(__file__))

RESOURCES_DIR = os.path.join(THIS_DIR, os.pardir, 'resources')

IDD_FILES = os.path.join(RESOURCES_DIR, 'iddfiles')
IDF_FILES = os.path.join(RESOURCES_DIR, 'idffiles')
try:
    VERSION = os.environ["ENERGYPLUS_INSTALL_VERSION"]  # used in CI files
except KeyError:
    VERSION = '8-7-0'  # current default for integration tests on local system
TEST_IDF = "V{}/smallfile.idf".format(VERSION[:3].replace('-', '_'))
TEST_EPW = 'USA_CA_San.Francisco.Intl.AP.724940_TMY3.epw'
TEST_IDD = "Energy+V{}.idd".format(VERSION.replace('-', '_'))
TEST_OLD_IDD = 'Energy+V8_1_0.idd'

eplus_exe, eplus_weather = install_paths(VERSION)


def has_severe_errors(results='run_outputs'):
    """Check for severe errors in the eplusout.end file.
    """
    end_filename = glob('{}/*.end'.format(results))[0]
    with open(os.path.join(end_filename), 'r') as end_file:
        end_txt = end_file.read()
    num_severe = int(re.findall(r' (\d*) Severe Error', end_txt)[0])
    return num_severe > 0


def test_version_reader():
    """Test that get the expected idd_version when reading an IDF/IDD.
    """