Skip to content

Commit

Permalink
Merge pull request #147 from BuildingSync/fix-Should-write-the-same-I…
Browse files Browse the repository at this point in the history
…DF-file-as-previously-generated

Fix develop tests
  • Loading branch information
haneslinger authored Feb 7, 2024
2 parents e5c6b97 + d7d55b4 commit 1f1e09c
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 15 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
uses: actions/checkout@v2
- name: Setup
run: |
gem install bundler
gem install bundler -v 2.4.22
bundle install
- name: Building Section Spec
run: bundle exec rspec spec/tests/model_articulation_test/building_section_spec.rb
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
uses: actions/checkout@v2
- name: Setup
run: |
gem install bundler
gem install bundler -v 2.4.22
bundle install
- name: Translator Example Spec
run: bundle exec rspec spec/tests/translator_spec.rb
Expand All @@ -87,7 +87,7 @@ jobs:
uses: actions/checkout@v2
- name: Setup
run: |
gem install bundler
gem install bundler -v 2.4.22
bundle install
- name: Report Spec
run: bundle exec rspec spec/tests/report_spec.rb
Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:
uses: actions/checkout@v2
- name: Setup
run: |
gem install bundler
gem install bundler -v 2.4.22
bundle install
- name: BuildingSync Spec
run: bundle exec rspec spec/tests/building_sync_spec.rb
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

- name: Install and Build
run: |
gem install bundler
gem install bundler -v 2.4.22
bundle install
bundle exec yard - README.md
SITEMAP_BASEURL=https://buildingsync-gem.buildingsync.net bundle exec yard doc --plugin sitemap
Expand Down
8 changes: 4 additions & 4 deletions spec/files/filecomparison/originalfiles/in.idf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

Version,
9.6; !- Version Identifier
22.1; !- Version Identifier

Timestep,
6; !- Number of Timesteps per Hour
Expand Down Expand Up @@ -2603,11 +2603,11 @@ RunPeriod,
Run Period 1, !- Name
1, !- Begin Month
1, !- Begin Day of Month
2022, !- Begin Year
2024, !- Begin Year
12, !- End Month
31, !- End Day of Month
2022, !- End Year
Saturday, !- Day of Week for Start Day
2024, !- End Year
Monday, !- Day of Week for Start Day
No, !- Use Weather File Holidays and Special Days
No, !- Use Weather File Daylight Saving Period
No, !- Apply Weekend Holiday Rule
Expand Down
2 changes: 1 addition & 1 deletion spec/files/filecomparison/originalfiles/in.osm
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ OS:SizingPeriod:DesignDay,

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

Expand Down
6 changes: 3 additions & 3 deletions spec/tests/model_articulation_test/loads_system_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@
# 1. Before the schedule is adjusted
# 2. After the schedule is adjusted
# And why we expect the new values
expect(help_calculate_hours(default_schedule_set.numberofPeopleSchedule, cut_off_value).round(1)).to eql 33.3
expect(help_calculate_hours(default_schedule_set.numberofPeopleSchedule, cut_off_value).round(1)).to eql 47.9
expect(help_calculate_hours(default_schedule_set.hoursofOperationSchedule, cut_off_value).round(1)). to eql 40.0
expect(help_calculate_hours(default_schedule_set.peopleActivityLevelSchedule, cut_off_value).round(1)). to eql 168.0
expect(help_calculate_hours(default_schedule_set.lightingSchedule, cut_off_value).round(1)). to eql 41.2
expect(help_calculate_hours(default_schedule_set.electricEquipmentSchedule, cut_off_value).round(1)).to eql 52.7
expect(help_calculate_hours(default_schedule_set.lightingSchedule, cut_off_value).round(1)). to eql 67.4
expect(help_calculate_hours(default_schedule_set.electricEquipmentSchedule, cut_off_value).round(1)).to eql 78.0
expect(help_calculate_hours(default_schedule_set.gasEquipmentSchedule, cut_off_value).round(1)).to eql 0.0
expect(help_calculate_hours(default_schedule_set.hotWaterEquipmentSchedule, cut_off_value).round(1)).to eql 0.0
expect(help_calculate_hours(default_schedule_set.infiltrationSchedule, cut_off_value).round(1)).to eql 168.0
Expand Down
9 changes: 7 additions & 2 deletions spec/tests/model_articulation_test/site_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,19 +102,24 @@

it 'Should write the same IDF file as previously generated' do
# We don't compare OSM files because the GUIDs change
# generate site
g = BuildingSync::Generator.new
@osm_file_path = File.join(SPEC_FILES_DIR, 'filecomparison')
@site = g.create_minimum_site('Retail', '1980', 'Gross', '20000')
@site.determine_open_studio_standard(ASHRAE90_1)

# generate osm on site
epw_file_path = File.join(SPEC_WEATHER_DIR, 'CZ01RV2.epw')
@site.generate_baseline_osm(epw_file_path, ASHRAE90_1)

# write site osm and idf
@osm_file_path = File.join(SPEC_FILES_DIR, 'filecomparison')
@site.write_osm(@osm_file_path)

generate_idf_file(@site.get_model)

# ensure it equals ground truth
new_idf = "#{@osm_file_path}/in.idf"
original_idf = "#{@osm_file_path}/originalfiles/in.idf"

line_not_match_counter = compare_two_idf_files(original_idf, new_idf)

expect(line_not_match_counter == 0).to be true
Expand Down

0 comments on commit 1f1e09c

Please sign in to comment.