Skip to content

Commit

Permalink
Fixes : Trnsys misc
Browse files Browse the repository at this point in the history
- adds log message to parallel_process() when a fail occurs
- code cleanup (cosmetic)
- Fixes wring windowlib path for macos/linux tests
  • Loading branch information
samuelduchesne committed May 14, 2019
1 parent 4f58732 commit 3ba7026
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 6 deletions.
1 change: 1 addition & 0 deletions archetypal/idf.py
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,7 @@ def parallel_process(in_dict, function, processors, use_kwargs=True):
else:
out[key] = futures[key]
except Exception as e:
log(str(e), lg.ERROR)
out[futures[key]] = e
return out

Expand Down
6 changes: 3 additions & 3 deletions archetypal/trnsys.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
# Web: https://github.com/samuelduchesne/archetypal
################################################################################

import io
import logging as lg
import os
import re
import shutil
import subprocess
import sys
import time
import io
from collections import OrderedDict

import numpy as np
Expand Down Expand Up @@ -1048,12 +1048,12 @@ def convert_idf_to_trnbuild(idf_file, window_lib=None, return_b18=True,
# If tolerance was not respected to find a window, write in log a warning
if len(window) > 11:
log(
"WARNING : window tolerance was not respected. Final tolerance= "
"Window tolerance was not respected. Final tolerance = "
"{:,.2f}".format(
window[-1]), lg.WARNING)
# Write in log (info) the characteristics of the window
log(
"Characterisitics of the chosen window are: u_value= {:,.2f}, "
"Characterisitics of the chosen window are: u_value = {:,.2f}, "
"SHGC= {:,.2f}, t_vis= {:,.2f}".format(window[3], window[4], window[7]),
lg.INFO)

Expand Down
24 changes: 24 additions & 0 deletions docker/trnsidf/readme.1st
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
***********************************************************
* TRNsIDF.EXE - translater from IDF created by Trnsys3d to B18
***********************************************************
This program sorts and renumbers the IDF file and writes
a B18 file based on the geometric information of the IDF file and
the template B17 file. In addition, an template DCK file can be generated.


CALL:

TRNSIDF.EXE %1 %2 %3 %4 %5 %6 %7 %8 %9
%1 absolute path\filename.idf
%2 absoluter path\NewFileTemplate.d18
%3 /dck create a template DCK
%4 /nonum (optional: no renumeration of surfaces)
%5 /N (optional: BatchJob Modus)
%6 /geo_floor=0.6 (optional: generates GEOSURF values for distributing direct solar radiation where 60 % is directed to the floor, the rest to walls/windows)
%7 /refarea (optional: floor reference area of airnodes is updated)
%8 /volume (optional: volume of airnodes is updated)
%9 /capacitance (optional: capacitance of airnodes is updated)

Note: if no path is defined, the directory of TRNSIDF.EXE is asumed.


Binary file added docker/trnsidf/trnsidf.exe
Binary file not shown.
3 changes: 0 additions & 3 deletions tests/test_trnsys.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,11 @@ def test_trnbuild_from_idf_parallel_darwin_or_linux(config):
file_upper_path = os.path.join('tests', 'input_data', 'trnsys')
files = ["NECB 2011 - Warehouse.idf", "NECB 2011 - Small Office.idf"]

window_file = 'W74-lib.dat'
window_filepath = os.path.join(file_upper_path, window_file)

# prepare args (key=value). Key is a unique id for the runs (here the
# file basename is used). Value is a dict of the function arguments
in_dict = {os.path.basename(file): dict(
idf_file=os.path.join(file_upper_path, file),
window_lib=window_filepath,
template="tests/input_data/trnsys/NewFileTemplate.d18",
trnidf_exe_dir='docker/trnsidf/trnsidf.exe') for
file in files}
Expand Down

0 comments on commit 3ba7026

Please sign in to comment.