hongyuanjia/eplusr: eplusr v0.13.0
Description
Idf$add()andIdf$set()have new features:# refer to field using '..' idf$add(Material = list(..1 = "mat", ..7 = 0.95)) idf$set(mat = list(..6 = 0.5)) # using vector field values idf$add(Material := list(..1 = sprintf("mat%i", 1:10))) idf$set(c(sprintf("mat%i", 1:10)) := list(..6 = runif(10)))Idf$to_table()gains a new parameterforce. The default value isFALSE. IfTRUE, you can convert object data from any classes into a wide data.table. This may be useful when you know that target classes have the exact same fields, e.g.Ceiling:AdiabaticandFloor:Adiabatic(#202).- A new method
Idf$purge()has been added (#223). It can be used to delete any resource objects that are not referenced by other objects. Here resource objects indicate all objects that can be referenced by other objects, e.g. all schedules.$purge()will ignore any inputs that are not resources. If inputs contain objects from multiple classes, references among them are also taken into account, which means purging is performed hierarchically. If both materials and constructions are specified, the latter will be purged first, because it is possible that input constructions reference input materials.Idf$purge()makes it quite straightforward to perform IDF cleaning. Actions like removing all materials, constructions and schedules can be easily achieved viaIdf$purge(class = c("Material", "Construction"), group = "Schedules") - New methods
Idf$duplicatd()andIdf$unique()have been added. They can be used to detect and remove duplicated objects, respectively. Here duplicated objects refer to objects whose field values are the same except the names. Object comments are ignored during comparison. These two methods can be useful when doing model cleaning (#227). - Now if
classis set toNULLinIdf$definition(), the underlyingIddobject is returned (#237). - Internal helper functions
with_option(),with_silent(),with_verbose(),with_speed()andwithout_checking()have been exported. They can be used to evaluate an expression with temporary eplusr options (#240). - Now
Idf$insert()can directly take anIdfobject or a list ofIdfobjects as input. And alsoVersionobjects in input will be directly skipped instead of giving an error (#245). - A new option
allhas been added inIdfObject$print()with default beingFALSE. IfTRUE, all fields defined in [Idd] are printed even they do not exist in current object (#247). - New S3 methods of
==for all classes are added, i.e.==.Idf,==.IdfObject,==.Idd,==.IddObject,==.Epw,==.EplusJob,==.EplusSql,==.EplusGroupJob,==.ParametricJob. The negate methods are also added. This makes it quite easy to check the equality of R6 objects of these types (#250). - A new Generic function
reload()is added. eplusr relies heavily on thedata.tablepackage. The core data of all main classes in eplusr are saved asdata.tables. This introduces a problem when loading savedIdfobjects or other class objects via an*.RDSand*.RDatafile on disk: the storeddata.tables lose their column over-allocation.reload()is a helper function that callsdata.table::setDT()on all internaldata.tables to make sure they are initialized properly. It is recommended to callreload()on eachIdd,Idfand other class object in eplusr loaded withreadRDS()orload(), to make sure all eplusr's functionaries works properly (#251). - The implementation of
EplusSql$report_data()has been refactored, resulting in a ~200% speed-up (#259). - Now
day_typeinEplusSql$report_data()has a few new options (#259): -"Weekday": All working days, i.e. from Monday to Friday -"Weekend": Saturday and Sunday -"DesignDay": Equivalent to"SummerDesignDay"plus"WinterDesignDay"-"CustomDay": CustomDay1 and CustomDay2 -"SpecialDay": Equivalent to"DesignDay"plus"CustomDay"-"NormalDay": Equivalent to"Weekday"and"Weekend"plus"Holiday" - Some internal functions have been exported. They are mainly useful for developers to handle internal IDD and IDF data more efficiently (#260).
- A new
IdfScheduleCompactclass is introduced. A constructor functionschedule_compact()is added.IdfScheduleCompactclass provides more detailed methods to add, modify and extract schedule values. For more details, seevignette("schedule")(#256). - New
IdfGeometryandIdfViewerclasses are introduced.IdfGeometryis designed to extract data for all geometry objects and perform geometric operations on them, whileIdfVieweris to view IDF geoemtry in 3D using the rgl package in a similar way as OpenStudio SketchUp Plugin.Idf$geometry()andIdf$view()methods are added to directly create anIdfGeometryandIdfViewerobject based on currentIdfobject, respectively (#296). - A
plot.Idfmethod is added which is basically a wrappper ofIdf$view()(#296). - Now eplusr can utilize the CSV output for report data extraction. Benifiting from the fantastic
data.table::fread, this approach can be as 3~10X faster compared to the SQLite approach. eplusr will still use the SQLite if the CSV output is not available.
The algorithm of object/field/value relation extraction has been completed refactored. Now it can correctly detect object recursive-reference and it's faster (#222, #223).
All relation-related methods now have an unified interface:
X$method(which, direction, object = NULL, class = NULL, group = NULL, depth = NULL, keep = FALSE)Where
whichis a class index or object ID,directionis the target relation direction to extract. All results can be further constrained via 3 extra arguments, i.e.object,classandobject.objectonly applicable toIdfandIdfObject. Thedepthargument is used to control the depth for searching recursive relations. Default value is0L, which means no recursive relations will be detected, whileNULLmeans to search all possible recursive relations.A new
keepparameter with default valueFALSEhas been added. IfTRUE, all input fields will be returned, even they may not have any relations. This is the default behavior of v0.12.0 and before. In this version, only fields that have relation with other objects will be returned.With this update, it is possible, for example, to directly know the structure of an air loop by using
idf$object_relation("AnAirLoop", depth = NULL)Moreover, a new argument
class_refcan be specified in methods of value-relation extraction. It can be used to specify how to handle class-name-references. Class name references refer to references in like fieldComponent 1 Object TypeinBranchobjects. Their value refers to other many class names of objects, instaed of refering to specific field values. There are 3 options in total, i.e."none","both"and"all", with"both"being the default."none": just ignore class-name-references. It is a reasonable option, as for most cases, class-name-references always come along with field value references. Ignoring class-name-references will not impact the most part of the relation structure."both": only include class-name-references if this object also reference field values of the same one. For example, if the value of fieldComponent 1 Object TypeisCoil:Heating:Water, only the object that is referenced in the next fieldComponent 1 Nameis treated as referenced byComponent 1 Object Type. This is the default option."all": include all class-name-references. For example, if the value of fieldComponent 1 Object TypeisCoil:Heating:Water, all objects inCoil:Heating:Waterwill be treated as referenced by that field. This is the most aggressive option.
read_epw()will proceed parsing for non-standard EPW header format (#236).- Now
EplusSql$report_data()will set the year values of day typeSummerDesignDayandWinterDesignDayto current year and theday_typevalue will be left unchanged (#258). - Now
read_idf()will always make sure all necessary fields are added during parsing (#267). [[.IdfObjectnow only accept standard field names. No underscore-style names are allowed.- The suffix of automatcially created names in
Idf$dup()has been changed from_XtoX. - The
warningparameter inread_epw(),Epw$add()andEpw$set()has been deprecated (#298).
EplusJob,EplusGroupJobandParametricJobwill not parse input EPW files, but only validate their existences and store the paths (#215)periodparameter inEplusSql$report_data()now works as expected (#259).run_idf()andrun_multi()now return additional element/column calledversionwhich contain the versions of EnergyPlus that are called during simulationsformat.Idd()now returns a single line string in format<EnergyPlus IDD v[Version] (Build) with X classes.- The column
datasourcereturned inEpw$data()has been renamed todata_source.
- Fix the bug caused by
ExpandObjectsexectuable that causesrun_idffails when running in parallel (#130) Idf$insert()now will remove all duplicated objects in input (#219).- Fix the bug in
install_eplus()on Windows (#230) - Fix the error in
$<-.Idfwhen input list ofIdfObjects are all from the sameIdfon the LHS (#238). - Now
Idf$insert()andIdf$load()can now successfully remove duplicated objects by comparing field values case-insensitively (#243) - Now
Epw$save()can work with emptyDESIGN CONDITIONS,TYPICAL/EXTREME PERIODSandGROUND TEMPERATURESheaders. Thanks @lukas-rokka for the bug report (#263). - Fix output directory creation error in
EplusGroupJob(#270). - Fix IDF header option parsing (#278).
- Trailing spaces after class names in IDF can be handled correctly (#294).
Files
hongyuanjia/eplusr-v0.13.0.zip
Files
(3.1 MB)
| Name | Size | Download all |
|---|---|---|
|
md5:9a67e29bd69440ef0968301d6a4458eb
|
3.1 MB | Preview Download |
Additional details
Related works
- Is supplement to
- https://github.com/hongyuanjia/eplusr/tree/v0.13.0 (URL)