MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / test_data

Method test_data

ruby/test/EpwFile_Test.rb:41–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39 end
40
41 def test_data
42 path = @epwDir / OpenStudio::Path.new("USA_CO_Golden-NREL.724666_TMY3.epw")
43 epw = OpenStudio::EpwFile::load(path.to_s).get
44 data = epw.data
45 assert_equal(8760, data.size)
46 dataPoint = data[8759];
47 assert(dataPoint.is_a? OpenStudio::EpwDataPoint)
48 assert_equal(4, dataPoint.dryBulbTemperature.get)
49 assert_equal(81100, dataPoint.atmosphericStationPressure.get)
50 assert_equal(-1.0,dataPoint.getFieldByName("Dew Point Temperature").get)
51 field = "Dew Point Temperature".to_EpwDataField
52 assert_equal(-1.0,dataPoint.getField(field).get)
53 known = [ "1996", "12", "31", "24", "0",
54 "?9?9?9?9E0?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9*9*9?9*9*9", "4.0", "-1.0",
55 "69", "81100", "0", "0", "294", "0.000000", "0", "0", "0", "0", "0",
56 "0", "130", "6.200000", "9", "9", "48.3", "7500", "9", "999999999",
57 "60", "0.0310", "0", "88", "0.210", "999", "99" ]
58 epwStrings = dataPoint.toEpwStrings
59 assert_equal(35, epwStrings.size)
60 (0..34).each do |i|
61 assert_equal(known[i], epwStrings[i])
62 end
63 end
64
65 def test_time_series
66 path = @epwDir / OpenStudio::Path.new("USA_CO_Golden-NREL.724666_TMY3.epw")

Callers

nothing calls this directly

Calls 10

to_sMethod · 0.80
dryBulbTemperatureMethod · 0.80
getFieldByNameMethod · 0.80
toEpwStringsMethod · 0.80
getMethod · 0.45
loadMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
getFieldMethod · 0.45

Tested by

no test coverage detected