The previous section talks about EpBunch, which deals with a single object from Energyplus. Here we put all the pieces together so that we have the entire IDF file
IDF0 is the first class that was written. As the code was refined, it was further refined to by subclassing to IDF1, IDF2, IDF3. Finally the following was set as IDF = IDF3
Some important methods in IDF0
This method has a decorator @classmethod
. This decorator makes the method a class method. From a stackoverflow comment, I found a brief description of when this should be used.
"Class methods are essential when you are doing set-up or computation that precedes the creation of an actual instance, because until the instance exists you obviously cannot use the instance as the dispatch point for your method calls"
Having said that, I am outside my comfort zone on trying to explain this in any depth. I will simply explain what I am doing with this here. Below is a brief explanation intent.
The class method allows us to achieve the objective:
IDF.setiddname(iddfilename)
idf = IDF(idffilename)
. This can be done multiple times, creating multiple instances and they will all use the same idd fileIDF is initialized by passing it the idf file name. I would look like this:
setiddname()
will be read too.The read function is called when the class IDF is initialized. The read function calls routines from the original EPlusInterface program to do the actual read. The read get the values for the following variables:
The functions within EPlusInterface are not documented here. I wrote them in 2004 and I have no idea how I did them. they have been working really well with some minor updates. I don't intent to poke at that code yet.
The other functions in IDF0, IDF1, IDF2 and IDF3 not too complicated. It should be possible to understand them by reading the code.
Sometime in the future, these functions will be documented later in more detail