Project 1 Plots

Last updated: April 27th, 20202020-04-27Project preview

DESTEST BUILDING SIMULATION COMPARISON

This notebook can be used to quickly compare your simulation results of the DESTEST building simulation

Requirements

There are no special requirements on your personal setup as this runs in the cloud, but for a direct and simple use, you need to provide your simulation results in the format explained here.

How to use it

If you want to use the comparison and plotting tool with your simulation results, you need to proceed with the following steps:

1. Upload your result.csv file in the input_data folder by change into the folder and upload them or simply drag and drop the file into it
2. Run the next cell with the **run** button above
3. Change the settings in the last cell to match what you want to plot, more explanation about the exact parameters will be explained during use of the notebook
4. Download output.zip for the plots or change directory to the output folder to investigate the plots
In [1]:
# Created November 2018
# Ina De Jaeger /Enora Garreau / Michael Mans / IBPSA Project 1 Workpackage 3

import functions
import os
import zipfile

Plotting and Comparison parameters

In the notebook cell below, you'll find a few parameters you can change for getting different plots

Currently, you can only compare libraries OR typologies OR ids OR insulation standards OR occupants. What you want to compare, needs to be None. The other parameters need to be fixed. You can choose which of e.g. the libraries to compare by specifying them as a list in the "selection" variable. E.g. not all libraries but only IDEAS and DIMOSIM or not all occupants but only 1, 2, 3

library :

String or list
"IDEAS", "Buildings", "AixLib", "BuildingSystems", "IDAICE", "DIMOSIM", "Trnsys" or a list of them e.g. ["IDEAS", " Buildings"]
In [2]:
inputDir = os.path.abspath("input_data")
outputDir = os.path.abspath("output")

# GENERAL CODE Using this script, you can create the plots you like. You have to
# choose what you'd like to compare

# Choose from: IDEAS, Buildings, AixLib, BuildingSystems, IDAICE, DIMOSIM, Trnsys
library = None

# Choose from: SFD
buildingTypology = "SFD"

# Choose from: 1
buildingID = "1"

# Choose from: 1980s
insulationStandard = "1980s"

# Choose from: ISO, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
occupant = "ISO"

# ['1', '5', '9', '13']  # If you only want certain variants, add here
selection = None

functions.compare_results(
    inputDir=inputDir,
    outputDir=outputDir,
    library=library,
    buildingTypology=buildingTypology,
    buildingID=buildingID,
    insulationStandard=insulationStandard,
    occupant=occupant,
    selection=selection,
)

# maybe we should provide more examples here?

print("IBSPA Project 1: That's it! :)")

print("Now we zip for easy download")

zipf = zipfile.ZipFile('output.zip', 'w', zipfile.ZIP_DEFLATED)
functions.zipdir('output/', zipf)
zipf.close()
['IDEAS_SFD_1_1980s_1.csv', 'DIMOSIM_SFD_1_1980s_1.csv', 'IDEAS_SFD_1_1980s_ISO.csv', '.ipynb_checkpoints', 'DIMOSIM_SFD_1_1980s_ISO.csv', 'Buildings_SFD_1_1980s_ISO.csv', 'AixLib_SFD_1_1980s_ISO.csv']
          Qheating_building_W  Tair_dayzone_K  Tair_nightzone_K
Datetime                                                       
0.0              12429.723633      277.906708        278.054504
600.0            16572.964844      280.197357        280.501404
1200.0           16572.964844      281.747284        282.265198
1800.0           16572.964844      282.739349        283.495667
2400.0           13793.128906      283.380554        284.107727
          Qheating_building_W  Tair_dayzone_K  Tair_nightzone_K
Datetime                                                       
0.0                3219.72400      291.734090        285.245762
600.0              2980.69516      291.635226        285.148868
1200.0             3044.32616      291.642233        285.155765
1800.0             3013.75060      291.634644        285.148295
2400.0             3018.75650      291.635691        285.149329
          Qheating_building_W  Tair_dayzone_K  Tair_nightzone_K
Datetime                                                       
0                 6036.634766      291.131165        293.124603
600               5119.908203      291.134522        293.127960
1200              4960.490234      291.135071        293.128571
1800              4856.508789      291.135376        293.129028
2400              4785.783691      291.135559        293.129364
---------------------------------------------------------------------------
IsADirectoryError                         Traceback (most recent call last)
<ipython-input-2-d4f6417c8268> in <module>
     23 selection = None
     24 
---> 25 functions.compare_results(
     26     inputDir=inputDir,
     27     outputDir=outputDir,

/app/functions.py in compare_results(inputDir, outputDir, library, buildingTypology, buildingID, insulationStandard, occupant, selection)
    538     print(fileNames)
    539     for fileName in fileNames:
--> 540         df = pd.read_csv(
    541             os.path.abspath(os.path.join(inputDir, fileName)),
    542             sep=",",

/usr/local/lib/python3.8/site-packages/pandas/io/parsers.py in parser_f(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, squeeze, prefix, mangle_dupe_cols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, skipfooter, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, dayfirst, cache_dates, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, doublequote, escapechar, comment, encoding, dialect, error_bad_lines, warn_bad_lines, delim_whitespace, low_memory, memory_map, float_precision)
    674         )
    675 
--> 676         return _read(filepath_or_buffer, kwds)
    677 
    678     parser_f.__name__ = name

/usr/local/lib/python3.8/site-packages/pandas/io/parsers.py in _read(filepath_or_buffer, kwds)
    446 
    447     # Create the parser.
--> 448     parser = TextFileReader(fp_or_buf, **kwds)
    449 
    450     if chunksize or iterator:

/usr/local/lib/python3.8/site-packages/pandas/io/parsers.py in __init__(self, f, engine, **kwds)
    878             self.options["has_index_names"] = kwds["has_index_names"]
    879 
--> 880         self._make_engine(self.engine)
    881 
    882     def close(self):

/usr/local/lib/python3.8/site-packages/pandas/io/parsers.py in _make_engine(self, engine)
   1124                     '"python-fwf")'
   1125                 )
-> 1126             self._engine = klass(self.f, **self.options)
   1127 
   1128     def _failover_to_python(self):

/usr/local/lib/python3.8/site-packages/pandas/io/parsers.py in __init__(self, f, **kwds)
   2262         self._comment_lines = []
   2263 
-> 2264         f, handles = get_handle(
   2265             f,
   2266             "r",

/usr/local/lib/python3.8/site-packages/pandas/io/common.py in get_handle(path_or_buf, mode, encoding, compression, memory_map, is_text)
    429         elif is_text:
    430             # No explicit encoding
--> 431             f = open(path_or_buf, mode, errors="replace", newline="")
    432         else:
    433             # Binary mode

IsADirectoryError: [Errno 21] Is a directory: '/app/input_data/.ipynb_checkpoints'
In [ ]:
 
Notebooks AI
Notebooks AI Profile20060