def test_run_olderv(clean_config, ep_version): """Will run eplus on a file that needs to be upgraded with one that does not""" ar.settings.use_cache = False files = [ "tests/input_data/problematic/nat_ventilation_SAMPLE0.idf", get_eplus_dirs(settings.ep_version) / "ExampleFiles" / "5ZoneNightVent1.idf", ] wf = "tests/input_data/CAN_PQ_Montreal.Intl.AP.716270_CWEC.epw" files = ar.copy_file(files) rundict = { file: dict( eplus_file=file, weather_file=wf, ep_version=ep_version, annual=True, prep_outputs=True, expandobjects=True, verbose="q", output_report="sql", ) for file in files } result = {file: ar.run_eplus(**rundict[file]) for file in files}
def test_to_json_std(): files = glob.glob("./input_data/STD/*idf") files = ar.copy_file(files) wf = './input_data/CAN_PQ_Montreal.Intl.AP.716270_CWEC.epw' a = ar.Template(files, wf) a.read() json = a.to_json(orient='records') print(json)
def test_example_idf(processors, expandobjects, annual, fresh_start, idf_source): """Will run all combinations of parameters defined above""" wf = './input_data/CAN_PQ_Montreal.Intl.AP.716270_CWEC.epw' idf = ar.copy_file(idf_source) return ar.run_eplus(idf, wf, processors=processors, annual=annual, expandobjects=expandobjects)
def test_necb(config, fresh_start): import glob files = glob.glob("/Users/samuelduchesne/Dropbox/Polytechnique/Doc" "/software/archetypal-dev/data/necb" "/NECB_2011_Montreal_idf/*idf") files = copy_file(files) wf = './input_data/CAN_PQ_Montreal.Intl.AP.716270_CWEC.epw' return ar.run_eplus(files, wf, expandobjects=True, annual=True)
def test_transition(self, config): """Tests the transition method for the CLI""" file = copy_file( "tests/input_data/problematic/ASHRAE90.1_ApartmentHighRise_STD2016_Buffalo.idf" ) runner = CliRunner() result = runner.invoke(cli, ["transition", file], catch_exceptions=False) log(result.stdout) assert result.exit_code == 0
def template(fresh_start, request): """Instantiate an umi template placeholder. Calls in the fresh_start function to clear the cache folder""" idf = glob.glob(request.param) idf = ar.copy_file(idf) # idf = './input_data/AdultEducationCenter.idf' wf = './input_data/CAN_PQ_Montreal.Intl.AP.716270_CWEC.epw' a = ar.Template(idf, wf) yield a
def test_template_withcache(): """Instantiate an umi template placeholder. Does note call fresh_start function so that caching can be used""" idf = glob.glob('/Users/samuelduchesne/Dropbox/Polytechnique/Doc/software' '/archetypal-dev/data/necb/NECB_2011_Montreal_idf/*.idf') idf = ar.copy_file(idf) # idf = './input_data/AdultEducationCenter.idf' wf = './input_data/CAN_PQ_Montreal.Intl.AP.716270_CWEC.epw' a = ar.Template(idf, wf) yield a
def test_small_home_data(clean_config): file = (get_eplus_dirs(settings.ep_version) / "ExampleFiles" / "BasicsFiles" / "AdultEducationCenter.idf") file = ar.copy_file(file) wf = "tests/input_data/CAN_PQ_Montreal.Intl.AP.716270_CWEC.epw" return ar.run_eplus(file, wf, prep_outputs=True, design_day=True, expandobjects=True, verbose="q")
def test_run(scratch_then_cache): f1 = './input_data/umi_samples/nat_ventilation_SAMPLE0.idf' f2 = './input_data/umi_samples' \ '/no_shed_ventilation_and_no_mech_ventilation_SAMPLE0.idf' f3 = './input_data/umi_samples/no_shed_ventilation_SAMPLE0.idf' f4 = './input_data/umi_samples/shed_ventilation_SAMPLE0.idf' files = copy_file([f1, f2, f3, f4]) wf = './input_data/CAN_PQ_Montreal.Intl.AP.716270_CWEC.epw' sql = ar.run_eplus(files, wf, expandobjects=True, annual=True, processors=-1) np = ar.nominal_people(sql)
def test_make_umi_schedule(config): """Tests only a single schedule name""" import matplotlib.pyplot as plt idf_file = "tests/input_data/schedules/schedules.idf" idf_file = copy_file(idf_file) idf = load_idf(idf_file) s = UmiSchedule(Name="POFF", idf=idf, start_day_of_the_week=0) ep_year, ep_weeks, ep_days = s.to_year_week_day() new = UmiSchedule(Name=ep_year.Name, idf=idf, start_day_of_the_week=s.startDayOfTheWeek) print(len(s.all_values)) print(len(new.all_values)) ax = s.plot(slice=("2018/01/01 00:00", "2018/01/07"), legend=True) new.plot(slice=("2018/01/01 00:00", "2018/01/07"), ax=ax, legend=True) plt.show() assert s.__class__.__name__ == "UmiSchedule" assert len(s.all_values) == len(new.all_values) assert (new.all_values == s.all_values).all()
def trnbuild_file(config, request): idf_file = get_eplus_dirs(settings.ep_version) / "ExampleFiles" / request.param idf_file = copy_file(idf_file, where=settings.cache_folder) yield idf_file
def test_std(config, fresh_start): import glob files = glob.glob("./input_data/STD/*idf") files = copy_file(files) wf = './input_data/CAN_PQ_Montreal.Intl.AP.716270_CWEC.epw' return ar.run_eplus(files, wf, expandobjects=True, annual=True)