Skip to content

Commit 1f1e09c

Browse files
authored
Merge pull request #147 from BuildingSync/fix-Should-write-the-same-IDF-file-as-previously-generated
Fix develop tests
2 parents e5c6b97 + d7d55b4 commit 1f1e09c

6 files changed

Lines changed: 20 additions & 15 deletions

File tree

.github/workflows/continuous_integration.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
uses: actions/checkout@v2
1515
- name: Setup
1616
run: |
17-
gem install bundler
17+
gem install bundler -v 2.4.22
1818
bundle install
1919
- name: Building Section Spec
2020
run: bundle exec rspec spec/tests/model_articulation_test/building_section_spec.rb
@@ -63,7 +63,7 @@ jobs:
6363
uses: actions/checkout@v2
6464
- name: Setup
6565
run: |
66-
gem install bundler
66+
gem install bundler -v 2.4.22
6767
bundle install
6868
- name: Translator Example Spec
6969
run: bundle exec rspec spec/tests/translator_spec.rb
@@ -87,7 +87,7 @@ jobs:
8787
uses: actions/checkout@v2
8888
- name: Setup
8989
run: |
90-
gem install bundler
90+
gem install bundler -v 2.4.22
9191
bundle install
9292
- name: Report Spec
9393
run: bundle exec rspec spec/tests/report_spec.rb
@@ -120,7 +120,7 @@ jobs:
120120
uses: actions/checkout@v2
121121
- name: Setup
122122
run: |
123-
gem install bundler
123+
gem install bundler -v 2.4.22
124124
bundle install
125125
- name: BuildingSync Spec
126126
run: bundle exec rspec spec/tests/building_sync_spec.rb

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
- name: Install and Build
2020
run: |
21-
gem install bundler
21+
gem install bundler -v 2.4.22
2222
bundle install
2323
bundle exec yard - README.md
2424
SITEMAP_BASEURL=https://buildingsync-gem.buildingsync.net bundle exec yard doc --plugin sitemap

spec/files/filecomparison/originalfiles/in.idf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
Version,
3-
9.6; !- Version Identifier
3+
22.1; !- Version Identifier
44

55
Timestep,
66
6; !- Number of Timesteps per Hour
@@ -2603,11 +2603,11 @@ RunPeriod,
26032603
Run Period 1, !- Name
26042604
1, !- Begin Month
26052605
1, !- Begin Day of Month
2606-
2022, !- Begin Year
2606+
2024, !- Begin Year
26072607
12, !- End Month
26082608
31, !- End Day of Month
2609-
2022, !- End Year
2610-
Saturday, !- Day of Week for Start Day
2609+
2024, !- End Year
2610+
Monday, !- Day of Week for Start Day
26112611
No, !- Use Weather File Holidays and Special Days
26122612
No, !- Use Weather File Daylight Saving Period
26132613
No, !- Apply Weekend Holiday Rule

spec/files/filecomparison/originalfiles/in.osm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ OS:SizingPeriod:DesignDay,
122122

123123
OS:YearDescription,
124124
{d0fcec5a-533c-4ae5-96ad-48cf821a3afd}, !- Handle
125-
2023, !- Calendar Year
125+
2024, !- Calendar Year
126126
, !- Day of Week for Start Day
127127
; !- Is Leap Year
128128

spec/tests/model_articulation_test/loads_system_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@
7878
# 1. Before the schedule is adjusted
7979
# 2. After the schedule is adjusted
8080
# And why we expect the new values
81-
expect(help_calculate_hours(default_schedule_set.numberofPeopleSchedule, cut_off_value).round(1)).to eql 33.3
81+
expect(help_calculate_hours(default_schedule_set.numberofPeopleSchedule, cut_off_value).round(1)).to eql 47.9
8282
expect(help_calculate_hours(default_schedule_set.hoursofOperationSchedule, cut_off_value).round(1)). to eql 40.0
8383
expect(help_calculate_hours(default_schedule_set.peopleActivityLevelSchedule, cut_off_value).round(1)). to eql 168.0
84-
expect(help_calculate_hours(default_schedule_set.lightingSchedule, cut_off_value).round(1)). to eql 41.2
85-
expect(help_calculate_hours(default_schedule_set.electricEquipmentSchedule, cut_off_value).round(1)).to eql 52.7
84+
expect(help_calculate_hours(default_schedule_set.lightingSchedule, cut_off_value).round(1)). to eql 67.4
85+
expect(help_calculate_hours(default_schedule_set.electricEquipmentSchedule, cut_off_value).round(1)).to eql 78.0
8686
expect(help_calculate_hours(default_schedule_set.gasEquipmentSchedule, cut_off_value).round(1)).to eql 0.0
8787
expect(help_calculate_hours(default_schedule_set.hotWaterEquipmentSchedule, cut_off_value).round(1)).to eql 0.0
8888
expect(help_calculate_hours(default_schedule_set.infiltrationSchedule, cut_off_value).round(1)).to eql 168.0

spec/tests/model_articulation_test/site_spec.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,19 +102,24 @@
102102

103103
it 'Should write the same IDF file as previously generated' do
104104
# We don't compare OSM files because the GUIDs change
105+
# generate site
105106
g = BuildingSync::Generator.new
106-
@osm_file_path = File.join(SPEC_FILES_DIR, 'filecomparison')
107107
@site = g.create_minimum_site('Retail', '1980', 'Gross', '20000')
108108
@site.determine_open_studio_standard(ASHRAE90_1)
109+
110+
# generate osm on site
109111
epw_file_path = File.join(SPEC_WEATHER_DIR, 'CZ01RV2.epw')
110112
@site.generate_baseline_osm(epw_file_path, ASHRAE90_1)
113+
114+
# write site osm and idf
115+
@osm_file_path = File.join(SPEC_FILES_DIR, 'filecomparison')
111116
@site.write_osm(@osm_file_path)
112117

113118
generate_idf_file(@site.get_model)
114119

120+
# ensure it equals ground truth
115121
new_idf = "#{@osm_file_path}/in.idf"
116122
original_idf = "#{@osm_file_path}/originalfiles/in.idf"
117-
118123
line_not_match_counter = compare_two_idf_files(original_idf, new_idf)
119124

120125
expect(line_not_match_counter == 0).to be true

0 commit comments

Comments
 (0)