Пример #1
0
 def test_multiple_branch_links(self):
     for _ in iter_eplus_versions(self):
         idf = Epm(
             os.path.join(CONF.eplus_base_dir_path, "ExampleFiles",
                          "5ZoneAirCooled.idf"))
         bl = idf.BranchList.one(
             lambda x: x.name == "heating supply side branches")
         b3 = idf.Branch.one(
             lambda x: x.name == "heating supply bypass branch")
         self.assertEqual(bl[3], b3)
Пример #2
0
import os
import tempfile

from oplus.configuration import CONF
from oplus import Epm

idf = Epm(
    os.path.join(CONF.eplus_base_dir_path, "ExampleFiles",
                 "1ZoneEvapCooler.idf"))
zone = idf["Zone"].one(lambda x: x["name"] == "Main Zone")
building = idf["Building"].one(lambda x: x["name"] == "Bldg")

# check info
if True:
    print(idf.get_info(sort_by_group=False, detailed=True))

if True:
    print(zone.get_info(detailed=False))

# check to_str
if True:
    zone.set_head_comment("Hello\n\n\nhello!!")
    zone.set_tail_comment(
        "Here is my tail comment\nwritten on several lines...")
    zone.set_field_comment(
        0,
        zone.get_field_comment(0) + " **modified with\nline\nbreaks**")
    print(zone.to_idf(style="console"))  # idf, console

# check save_as
if True:
Пример #3
0
 def test_simple_read(self):
     for _ in iter_eplus_versions(self):
         for idf_name in ("4ZoneWithShading_Simple_1", ):
             Epm(
                 os.path.join(CONF.eplus_base_dir_path, "ExampleFiles",
                              f"{idf_name}.idf"))
Пример #4
0
 def get_idf():
     return Epm(os.path.join(CONF.eplus_base_dir_path, "ExampleFiles", "1ZoneEvapCooler.idf"))