Giter VIP home page Giter VIP logo

eplusr's Introduction

eplusr

R build status codecov CRAN_Status_Badge CRAN Checks CRAN Download Badge

A Toolkit for Using EnergyPlus in R.

eplusr provides a rich toolkit of using whole building energy simulation program EnergyPlus directly in R, which enables programmatic navigation, modification of EnergyPlus, conducts parametric simulations and retrieves outputs. More information about EnergyPlus can be found at its website.

A comprehensive introduction to eplusr can be found using vignette("eplusr"). There is also an online slides here (Interfacing EnergyPlus Using R). You can learn more about eplusr at https://hongyuanjia.github.io/eplusr/, along with full package documentation.

How to cite

citation("eplusr")
#> 
#> To cite eplusr in publications use:
#> 
#>   Hongyuan Jia, Adrian Chong (2021). eplusr: A framework for
#>   integrating building energy simulation and data-driven analytics.
#>   Energy and Buildings 237: 110757.
#>   https://doi.org/10.1016/j.enbuild.2021.110757
#> 
#> A BibTeX entry for LaTeX users is
#> 
#>   @Article{,
#>     title = {eplusr: A framework for integrating building energy simulation and data-driven analytics},
#>     author = {Hongyuan Jia and Adrian Chong},
#>     year = {2020},
#>     journal = {Energy and Buildings},
#>     volume = {237},
#>     url = {https://CRAN.R-project.org/package=eplusr},
#>     doi = {10.1016/j.enbuild.2021.110757},
#>   }

Installation

You can install the latest stable release of eplusr from CRAN.

install.packages("eplusr")

Alternatively, you can install the development version from GitHub.

install.packages("eplusr", repos = "https://hongyuanjia.r-universe.dev")

Since running the IDF files requires EnergyPlus (https://energyplus.net), EnergyPlus has to be installed if you want to run EnergyPlus models in R. There are helper functions in eplusr to download and install it automatically on major operating systems (Windows, macOS and Linux):

# install the latest version (currently v23.1.0)
eplusr::install_eplus("latest")

# OR download the latest version (currently v23.1.0) and run the installer
# manually by yourself
eplusr::download_eplus("latest", dir = tempdir())

Note that the installation process in install_eplus() requires administrative privileges. You have to run R with administrator (or with sudo if you are on macOS or Linux) to make it work if you are not in interactive mode.

Features

  • Download, install EnergyPlus in R
  • Read, parse and modify EnergyPlus:
    • Input Data File (IDF)
    • Weather File (EPW)
    • Report Data Dictionary (RDD) & Meter Data Dictionary (MDD)
    • Error File (ERR)
  • Modify multiple versions of IDFs and run corresponding EnergyPlus both in the background and in the front
  • Rich-featured interfaces to query and modify IDFs
  • Automatically handle referenced fields and validate input during modification
  • Take fully advantage of most common used data structure for data science in R – data.frame
    • Extract model, weather data into data.frames
    • Modify multiple objects via data.frames input
    • Query output via SQL in Tidy format which is much better for data analysis and visualization
  • Provide a simple yet extensible prototype of conducting parametric simulations and collect all results in one go
  • A pure R-based version updater which is more than 20X faster than VersionUpdater distributed with EnergyPlus
  • Fast 3D geometry visualization

View IDF geometry in 3D

Turn RStudio into a model editor via autocompletion

Query and modify weather file

Query output via SQL in Tidy format which is much better for data analysis

Resources

Articles

Vignettes

Please see these vignettes and articles about {eplusr}

Slides

Additional resources

Acknowledgement

I would like to thank many open source projects who have heavily inspired the development of eplusr package, especially these below:

  • EnergyPlus: A whole building energy simulation program.
  • OpenStudio: A cross-platform collection of software tools to support whole building energy modeling using EnergyPlus and advanced daylight analysis using Radiance.
  • eppy: Scripting language for E+, EnergyPlus.
  • JEplus: An EnergyPlus simulation manager for parametrics.

Author

Hongyuan Jia and Adrian Chong

License

The project is released under the terms of MIT License.

Copyright © 2016-2023 Hongyuan Jia and Adrian Chong


Please note that the ‘eplusr’ project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

eplusr's People

Contributors

dmurdoch avatar hongyuanjia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

eplusr's Issues

Can I just output the successful run results in param runing?

elec0 <- param$report_data(name = "Electricity:Facility")
Error: Some of jobs completed unsuccessfully:
2|UNSUCCESSFUL --> [IDF]set_parameters_2.idf + [EPW]IA_DES-MOINES-IAP_725460_10.epw
4|UNSUCCESSFUL --> [IDF]set_parameters_4.idf + [EPW]IA_DES-MOINES-IAP_725460_10.epw
7|UNSUCCESSFUL --> [IDF]set_parameters_7.idf + [EPW]IA_DES-MOINES-IAP_725460_10.epw
8|UNSUCCESSFUL --> [IDF]set_parameters_8.idf + [EPW]IA_DES-MOINES-IAP_725460_10.epw

How can I get the other successful running models' results? Or are there any way to export which pairs unsuccessful?

Thanks

`copy_external` did not work

job <- idf$run(epw, tempdir())
#> Error: object of type 'closure' is not subsettable
traceback()
#> 9: dirname(dir$old_full_path)
#> 8: path.expand(path)
#> 7: normalizePath(dirname(dir$old_full_path))
#> 6: set(val, NULL, "same_dir", normalizePath(dirname(dir$old_full_path)) == 
#>        new_dir)
#> 5: resolve_idf_external_link(idd_env, idf_env, oldpath, path, copy_external)
#> 4: save_idf(private$idd_env(), private$idf_env(), private$m_log$order, 
#>        path = path, in_ip = private$m_log$view_in_ip, format = format, 
#>     ...
#> 3: idf_save(self, private, path_idf, overwrite = TRUE, copy_external = copy_external)
#> 2: idf_run(self, private, weather, dir, wait, force, copy_external = copy_external)
#> 1: idf$run(epw, tempdir())

The problem is here: dir is a typo. Should be val.

set(val, NULL, "same_dir", normalizePath(dirname(dir$old_full_path)) == new_dir)

Verbose info is always printed when using `$del()`

Even target objects are not referred by any other objects, and neither ref_by nor ref_to is set, the message below is always printed.

idf$del(idf$object_id("RunPeriod", simplify = TRUE))
#> -- Info ------------------------------------------------------------------------
#> Deleting object(s) [ID: 8, 9]
#> 
#> Object relation is shown below:
#>  -- Referred by Others ----------------------------------------------------------
#>  Target(s) is not referred by any other field.
#> 

some demo example and relate document request

Hi, hongyuanjia.
I am followed Jiangyu Wang's introduction to Github. I knew eplusr is so powerful package for EnergyPlus simulation and visualization.But some demo example is not available for the beginner. And there is no document to teach user how to use eplusr in the practical project.
So please add some demo example and relate document!!!

File size limitation?

There appears to be a limitation on the size of idf that you can import using read_idf. I just tried a fairly large file (~13 MB) and it fails as follows:

model<-read_idf("Test_20181115_182003.idf")
Start parsing...
Error: file must be a string, raw vector or a connection.

I tried changing the file name but no difference.

Regards,
Benson

Release eplusr 0.10.3

Prepare for release:

  • devtools::check()
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • revdepcheck::revdep_check(num_workers = 4)
  • Polish NEWS
  • Polish pkgdown reference index

Submit to CRAN:

  • usethis::use_version('patch')
  • Update cran-comments.md
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • Tweet

`download_eplus` does not work on Linux and MacOS

download_eplus() and install_eplus() did not work on Linux and MacOS, as the download file extension was fixed as "exe".

download_eplus()

#> Errir in if (file.exists(dest)) unlink(dest) : argument is of length zero

replace value

Dear Hongyuan,

I saw a function in the documents called $replace_value(), but I cannot find it in current packages. Will you add it in the future?

image

Release eplusr 0.10.2

Prepare for release:

  • devtools::check()
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • revdepcheck::revdep_check(num_workers = 4)
  • Polish NEWS
  • Polish pkgdown reference index

Submit to CRAN:

  • usethis::use_version('patch')
  • Update cran-comments.md
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • Tweet

EPW date parsing error for 10th and weekday type

epw_date("3.10")
# should be "Mar 10"
# [1] "Mar 01"

epw_date(c("2nd Sunday in March", "1st Sunday in November"))
# should be "2nd Sunday in March", "1st Sunday in November"
# [1] "2nd Wednesday in March" "1st Sunday in November"

Issue in reading in model

I have an issue when I read in an IDF file.
The code is

model <- read_idf(read_path,idd)

I use EnergyPlus v8.9, and the IDF file can work in EP-launch.

The error shows like this:

Error in vecseq(f__, len__, if (allow.cartesian || notjoin || !anyDuplicated(f__,  : 
  Join results in 41937 rows; more than 39329 = nrow(x)+nrow(i). Check for duplicate key values in i each of which join to the same group in x over and over again. If that's ok, try by=.EACHI to run j for each group to avoid the large allocation. If you are sure you wish to proceed, rerun with allow.cartesian=TRUE. Otherwise, please search for this error message in the FAQ, Wiki, Stack Overflow and data.table issue tracker for advice.

Here is the IDF file I used:
file.zip

`use_eplus` did not work.

use_eplus did not work if input is an EnergyPlus installation path which did not follow EnergyPlus Windows installation path.

Idf class should not modify $clone() method

In this code, the Idf class modifies the clone() method. This is not something that is supported by R6. If users arbitrarily modify the internal code from the R6 clone method, it would be make it impossible to ever change or fix that method in the R6 package.

The reason that this comes up is because it fails with the current development version of R6, which has extensive changes to the clone method in order to fix some bugs. Please fix this; I will be submitting R6 to CRAN in the next week or so.

Can I use variable for Field in set_value?

For my case, I can change the value of a field like this:

model6012Try$"Coil:Cooling:DX:SingleSpeed"$Thermal_Zone_ComputerRoom1_Coil_Cooling_DX_Single_Speed$set_value("Gross_Rated_Cooling_COP"=1.2)
Or
model6012Try$"Coil:Cooling:DX:SingleSpeed"$Thermal_Zone_ComputerRoom1_Coil_Cooling_DX_Single_Speed$set_value(Gross_Rated_Cooling_COP=2.2)

But I cannot do like this in a loop which automatically get the field name from a csv file:
AAA1="Gross_Rated_Cooling_COP";
model6012Try$"Coil:Cooling:DX:SingleSpeed"$Thermal_Zone_ComputerRoom1_Coil_Cooling_DX_Single_Speed$set_value(AAA1=3.2);

Could I know any solution for my case?
Thanks a lot.

Weather file not deleted after check

Check Details
Version: 0.10.2 
Check: for non-standard things in the check directory 
Result: NOTE 
    Found the following files/directories:
     USA_CA_Los.Angeles.Intl.AP.722950_TMY3.epw 
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc

Version: 0.10.2 
Check: for non-standard things in the check directory 
Result: NOTE 
    Found the following files/directories:
     ‘USA_CA_Los.Angeles.Intl.AP.722950_TMY3.epw’ 
Flavors: r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc

Year column not used when creating datetime column

epw <- read_epw(file.path(eplus_config(8.8)$dir, "WeatherData", "USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw"))
epw$abnormal_data(keep_all = FALSE)
#       line          datetime year month day hour minute albedo
#    1:    9  9-01-01 01:00:00 1986     1   1    1      0    999
#    2:   10  9-01-01 02:00:00 1986     1   1    2      0    999
#    3:   11  9-01-01 03:00:00 1986     1   1    3      0    999
#    4:   12  9-01-01 04:00:00 1986     1   1    4      0    999
#    5:   13  9-01-01 05:00:00 1986     1   1    5      0    999
#   ---                                                         
# 8037: 8764  9-12-31 20:00:00 1981    12  31   20      0    999
# 8038: 8765  9-12-31 21:00:00 1981    12  31   21      0    999
# 8039: 8766  9-12-31 22:00:00 1981    12  31   22      0    999
# 8040: 8767  9-12-31 23:00:00 1981    12  31   23      0    999
# 8041: 8768 10-01-01 00:00:00 1981    12  31   24      0    999
#       liquid_precip_depth liquid_precip_rate
#    1:                 999                 99
#    2:                 999                 99
#    3:                 999                 99
#    4:                 999                 99
#    5:                 999                 99
#   ---                                       
# 8037:                 999                 99
# 8038:                 999                 99
# 8039:                 999                 99
# 8040:                 999                 99
# 8041:                 999                 99

Errors in reporting data

I have some problems in reporting data a successful model running

When I used:
job$report_data(name = "Electricity:Facility")

I got errors like this:

Error: Invalid date introduced with input start year:
Original: 1-31 24:0 --> New year: 2019
Original: 1-31 24:0 --> New year: 2019
Original: 2-28 24:0 --> New year: 2019
Original: 2-28 24:0 --> New year: 2019
Original: 3-31 24:0 --> New year: 2019
Original: 3-31 24:0 --> New year: 2019
...

When I typed:
job$report_data("Electricity:Facility")

But I cannot extract any information:

Empty data.table (0 rows and 6 cols): case,datetime,key_value,name,units,value

What I want is to extract the electricity facilities' energy use simulation results from the meter data.

delete an object in schedule

I want to renew the schedule information in the current IDF files and use:

model$del_object(38)

It reported like this:

Error: Deleting an object that is referenced by others is prohibited in final validation level. Failed to delete target object [ID:38]:
1: Object [ID:38] was referenced by other objects [ID:124 and 125].

I saw the guidence in (https://cran.r-project.org/web/packages/eplusr/vignettes/eplusr.html) have a function shows as below:

model$del("mat-clng-1", .force = TRUE)

But I cannot use ".force=T" in the current package version.

Do you have any suggestion to solve this problem?

Thanks,
Yating

Release eplusr 0.10.1

Prepare for release:

  • devtools::check()
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • revdepcheck::revdep_check(num_workers = 4)
  • Polish NEWS
  • Polish pkgdown reference index

Submit to CRAN:

  • usethis::use_version('patch')
  • Update cran-comments.md
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • Tweet

`$paste()` does not work

add_joined_cols(idd_env$field, parsed$value, "field_id", "field_index")

Due to missing field_name column in the input, validation cannot be performed. Should add field_name before validation.

idf$paste()
# Error in `[.data.table`(env_in$object[, .SD, .SDcols = c("object_id",  : 
#   Some items of .SDcols are not column names: [field_name] 

Error when extract default values using `$value_possible()`

idf <- eplusr::read_idf("model.idf")
#> IDD v9.0.1 has not been parsed before.
#> Try to locate `Energy+.idd` in EnergyPlus v9.0.1 installation folder `C:/EnergyPlusV9-0-1`.
#> IDD file found: `C:\EnergyPlusV9-0-1\Energy+.idd`.
#> Start parsing...
#> Parsing completed.
idf$`ZoneHVAC:EquipmentList`$`ZoneHVAC-EquipList-ZoneB`$value_possible()
#> Error in if (any(res[num & !is_double] != val[num & !is_double])) {: missing value where TRUE/FALSE needed

Created on 2019-05-30 by the reprex package (v0.3.0)

`$run` failed on Linux.

$run uses the underlying package processx to call external programs from R, which works well on Windows. But it seems like that even though $run has reset the working directory to the target model dir, the args in processx::process will have a prefix of the current working directory, which makes EnergyPlus complain missing input weather file.

Different running status between single run and param run

I applied some changes to one IDF model with parallel running and choosing one of them as my result IDF file. But when I use the result IDF model, it can not work with a severe error. Do the package have any difference in running between single work and parallel work?

Thanks

Sorting report data using environment type

Taking below as an example, it is tricky to exclude design day results from the output using $report_data() in EplusSql class. It would be good if we can directly using environment_type for subsetting.

#    environment_period_index simulation_index
# 1:                        1                1
# 2:                        2                1
# 3:                        3                1
# 4:                        4                1
#                                              environment_name environment_type
# 1:     CHICAGO_IL_USA ANNUAL HEATING 99% DESIGN CONDITIONS DB                1
# 2: CHICAGO_IL_USA ANNUAL COOLING 1% DESIGN CONDITIONS DB/MCWB                1
# 3:              Chicago Ohare Intl Ap IL USA TMY3 WMO#=725300                3
# 4:              Chicago Ohare Intl Ap IL USA TMY3 WMO#=725300                3

From EnergyPlus doc, the meaning of environment type values:

An enumeration of the environment type. (1 = Design Day, 2 = Design Run Period, 3 = Weather Run Period)

Right now did not have a solid idea whether using integer values or strings to subset.

error in run_idf and run function

Hi

I try to run Eplus model by model$run and run_idf, but error occurs like:

job <- model$run( weather = './idf/run/test.epw', dir = NULL)
Error in process_initialize(self, private, command, args, stdin, stdout,  : 
  STRING_ELT() can only be applied to a 'character vector', not a 'environment'
run_idf(model = './idf/run/schedule.idf',weather = './idf/run/test.epw')
Error in process_initialize(self, private, command, args, stdin, stdout,  : 
  STRING_ELT() can only be applied to a 'character vector', not a 'environment'

I have use use_eplus(eplus = 'D:/EnergyPlusV8-5-0' ) to specify my eplus path and the read_idf function also works well.

The problem seems not come from the IDF file because I can run the IDF file by EnergyPlus software.

There is my session info:

sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=Chinese (Simplified)_China.936  LC_CTYPE=Chinese (Simplified)_China.936   
[3] LC_MONETARY=Chinese (Simplified)_China.936 LC_NUMERIC=C                              
[5] LC_TIME=Chinese (Simplified)_China.936    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] eplusr_0.9.3

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.18        pillar_1.3.0        compiler_3.5.1      later_0.7.5        
 [5] git2r_0.23.0        prettyunits_1.0.2   base64enc_0.1-3     tools_3.5.1        
 [9] progress_1.2.0      uuid_0.1-2          digest_0.6.15       packrat_0.4.9-3    
[13] bit_1.1-14          tibble_1.4.2        lubridate_1.7.4     RSQLite_2.1.1      
[17] memoise_1.1.0       pkgconfig_2.0.1     rlang_0.3.0         DBI_1.0.0          
[21] cli_1.0.1           rstudioapi_0.8      curl_3.2            withr_2.1.2        
[25] httr_1.3.1          stringr_1.3.1       knitr_1.20          devtools_1.13.6    
[29] hms_0.4.2           bit64_0.9-7         fasttime_1.0-2      data.table_1.11.8  
[33] R6_2.3.0            processx_3.2.0.9000 readr_1.1.1         callr_3.0.0        
[37] blob_1.1.1          magrittr_1.5        units_0.6-1         ps_1.1.0           
[41] assertthat_0.2.0    stringi_1.2.4       crayon_1.3.4       

The attachment is the package of my IDF and epw file.

Regards,
JY
run.zip

Object WaterHeater:Mixed is not recognized

Hello

I'm trying to read in an idf that has a WaterHeater:Mixed object in it. I get the following error.

model<-read_idf("HeatRecovery.idf")
Error: IDF PARSING ERROR.
===================================================================
[ Error Type ]: Object type not recognized
[Total Number]: 6

Line 5143: HHW_Loop Supply Side HR Branch,
Line 5217: HHW_Loop Supply Side HR Branch,
Line 5278: HHW_Loop Supply Side HR Branch,
Line 7150: WaterHeater:Mixed,
Line 7331: WaterHeater:Mixed,
Line 7389: WaterHeater:Mixed,

The object is valid in energyplus. What is even more strange is that if I format the IDF properly using the save feature in IDF Editor, it reads in perfectly fine! It is workable but the formatting shouldn't really matter in my opinion.

I've attached the IDF file as text.

HeatRecovery.txt

Regards,
Benson

Week day is not right at the first hour of each day

EnergyPlus uses 0 - 24 hour notation instead of 0 - 23. This makes the week days output from $report_data() is offset by one day for the first hour of each day. For example:

#               datetime month day hour minute  day_type      wday
# 1: 2019-01-02 23:00:00     1   2   23      0 Wednesday Wednesday
# 2: 2019-01-02 23:15:00     1   2   23     15 Wednesday Wednesday
# 3: 2019-01-02 23:30:00     1   2   23     30 Wednesday Wednesday
# 4: 2019-01-02 23:45:00     1   2   23     45 Wednesday Wednesday
# 5: 2019-01-03 00:00:00     1   2   24      0 Wednesday  Thursday
# 6: 2019-01-03 00:15:00     1   3    0     15  Thursday  Thursday
# 7: 2019-01-03 00:30:00     1   3    0     30  Thursday  Thursday

I don't think this is easy to fix and needed to be fixed. But instead should be noted in the documentation.

Error in `$set()` when `$add_unit()` is performed in Epw class

library(eplusr)
epw <- read_epw(file.path(eplus_config(9.0)$dir, "WeatherData/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw"))
#> Multiple versions found for EnergyPlus v9.0: `v9.0.0` and `v9.0.1`. The last patched version v9.0.1 will be used. Please explicitly give the full version if you want to use the other versions.
epw$add_unit()
data <- epw$data()
epw$set(data, warning = FALSE)
#> Error in Ops.units(x, range$minimum): both operands of the expression should be "units" objects

Created on 2019-07-10 by the reprex package (v0.2.1)

Calling NodeList returns unnamed list

While calling objects of class NodeList, the list returned is not a correctly name list. The NodeList names in the list returned are "NA". This does not allow NodeList objects to be called by their unique name.
See attached image "NodeList.png".
nodelist

This works correctly for the other EnergyPlus objects that I've called so far. See example of Branch object "Branch.png".
branch

I'm not sure if this affects any other classes.

Regards,
Benson

Skip renaming if new name is the same as the original

idf <- eplusr::read_idf(system.file("extdata/1ZoneUncontrolled.idf", package = "eplusr"))
#> IDD v8.8.0 has not been parsed before.
#> Try to locate `Energy+.idd` in EnergyPlus v8.8.0 installation folder `C:/EnergyPlusV8-8-0`.
#> IDD file found: `C:\EnergyPlusV8-8-0\Energy+.idd`.
#> Start parsing...
#> Parsing completed.
idf$rename(AlwaysOn = "AlwaysOn")
#> Error: Failed to rename object(s).
#> 
#>  x [2] Errors found during validation.
#> =========================================================================================
#> 
#> -- [2] Conflicted Object Names ----------------------------------------------------------
#>    Objects below have the same name:
#> 
#>     Class: <Schedule:Constant>
#>     +- Object [ID:Input #1] <AlwaysOn>
#>     |  \- 1: "AlwaysOn";    !- Name
#>     |  
#>     \- Object [ID:53] <AlwaysOn>
#>        +- 1: "AlwaysOn",    !- Name
#>        |- 2: "On/Off",      !- Schedule Type Limits Name
#>        \- 3: 1;             !- Hourly Value
#> 

Created on 2019-05-30 by the reprex package (v0.3.0)

Can not change efficiency in IDF

When I use set_object() to modify Burner Efficiency in class Coil:Heating:Fuel, the model can not run with several severe and fatal errors. But it can run under manually changing in IDF editor.

Parametric Job ingore `which` argument in $status and others

There is a bug in $status(), $output_dir() and $local_output() which did not respect which argument.

# after parametric simulation
param$status()
#> Error in i_param_job_from_which(self, private, which) : 
#>   argument "which" is missing, with no default

param$output_dir()
#> Error in i_param_job_from_which(self, private, which) : 
#>   argument "which" is missing, with no default

param$locate_output()
#> Error: Invalid job name found for current Parametric: `.err`.

`$set_value` in `IdfObject` and `$set_object` in `Idf` does not delete empty fields

$set_value in IdfObject and $set_object in Idf can set field values to NA. However, the empty fields will still be kept which makes it impossible to reassign some of those fields.

idf <- read_idf(here::here("data-raw/model/model.idf"))
equip_list <- idf$ZoneHVAC_EquipmentList$ZoneHVAC_EquipList_ZoneB
val <- equip_list$get_value()
#> $name
#> [1] "ZoneHVAC-EquipList-ZoneB"
#> 
#> $zone_equipment_1_object_type
#> [1] "ZoneHVAC:LowTemperatureRadiant:ConstantFlow"
#> 
#> $zone_equipment_1_name
#> [1] "LowTRadCF-RadCeiling1-SecCW-Demand-Load-SysB"
#> 
#> $zone_equipment_1_cooling_sequence
#> [1] 1
#> 
#> $zone_equipment_1_heating_or_no_load_sequence
#> [1] 1
#> 
#> $zone_equipment_2_object_type
#> [1] "ZoneHVAC:LowTemperatureRadiant:ConstantFlow"
#> 
#> $zone_equipment_2_name
#> [1] "LowTRadCF-RadCeiling2-SecCW-Demand-Load-SysB"
#> 
#> $zone_equipment_2_cooling_sequence
#> [1] 2
#> 
#> $zone_equipment_2_heating_or_no_load_sequence
#> [1] 2
#> 
#> $zone_equipment_3_object_type
#> [1] "ZoneHVAC:LowTemperatureRadiant:ConstantFlow"
#> 
#> $zone_equipment_3_name
#> [1] "LowTRadCF-RadCeiling3-SecCW-Demand-Load-SysB"
#> 
#> $zone_equipment_3_cooling_sequence
#> [1] 3
#> 
#> $zone_equipment_3_heating_or_no_load_sequence
#> [1] 3
#> 
#> $zone_equipment_4_object_type
#> [1] "ZoneHVAC:LowTemperatureRadiant:ConstantFlow"
#> 
#> $zone_equipment_4_name
#> [1] "LowTRadCF-RadFloor1-SecCW-Demand-Load-SysB"
#> 
#> $zone_equipment_4_cooling_sequence
#> [1] 4
#> 
#> $zone_equipment_4_heating_or_no_load_sequence
#> [1] 4
#> 
#> $zone_equipment_5_object_type
#> [1] "ZoneHVAC:LowTemperatureRadiant:ConstantFlow"
#> 
#> $zone_equipment_5_name
#> [1] "LowTRadCF-RadFloor2-SecCW-Demand-Load-SysB"
#> 
#> $zone_equipment_5_cooling_sequence
#> [1] 5
#> 
#> $zone_equipment_5_heating_or_no_load_sequence
#> [1] 5
#> 
#> $zone_equipment_6_object_type
#> [1] "ZoneHVAC:LowTemperatureRadiant:ConstantFlow"
#> 
#> $zone_equipment_6_name
#> [1] "LowTRadCF-RadFloor3-SecCW-Demand-Load-SysB"
#> 
#> $zone_equipment_6_cooling_sequence
#> [1] 6
#> 
#> $zone_equipment_6_heating_or_no_load_sequence
#> [1] 6
#> 
#> $zone_equipment_7_object_type
#> [1] "ZoneHVAC:LowTemperatureRadiant:ConstantFlow"
#> 
#> $zone_equipment_7_name
#> [1] "LowTRadCF-RadFloor4-SecCW-Demand-Load-SysB"
#> 
#> $zone_equipment_7_cooling_sequence
#> [1] 7
#> 
#> $zone_equipment_7_heating_or_no_load_sequence
#> [1] 7
#> 
#> $zone_equipment_8_object_type
#> [1] "ZoneHVAC:LowTemperatureRadiant:ConstantFlow"
#> 
#> $zone_equipment_8_name
#> [1] "LowTRadCF-RadFloor5-SecCW-Demand-Load-SysB"
#> 
#> $zone_equipment_8_cooling_sequence
#> [1] 8
#> 
#> $zone_equipment_8_heating_or_no_load_sequence
#> [1] 8
#> 
#> $zone_equipment_9_object_type
#> [1] "ZoneHVAC:LowTemperatureRadiant:ConstantFlow"
#> 
#> $zone_equipment_9_name
#> [1] "LowTRadCF-RadFloor6-SecCW-Demand-Load-SysB"
#> 
#> $zone_equipment_9_cooling_sequence
#> [1] 9
#> 
#> $zone_equipment_9_heating_or_no_load_sequence
#> [1] 9
#> 
#> $zone_equipment_10_object_type
#> [1] "ZoneHVAC:LowTemperatureRadiant:ConstantFlow"
#> 
#> $zone_equipment_10_name
#> [1] "LowTRadCF-RadFloor7-SecCW-Demand-Load-SysB"
#> 
#> $zone_equipment_10_cooling_sequence
#> [1] 10
#> 
#> $zone_equipment_10_heating_or_no_load_sequence
#> [1] 10
#> 
#> $zone_equipment_11_object_type
#> [1] "AirTerminal:SingleDuct:Uncontrolled"
#> 
#> $zone_equipment_11_name
#> [1] "DirectAir-ZoneB"
#> 
#> $zone_equipment_11_cooling_sequence
#> [1] 11
#> 
#> $zone_equipment_11_heating_or_no_load_sequence
#> [1] 11
#> 

# Delete the last 8 equipment
val[14:45] <- rep(list(NA_character_, NA_character_, NA_integer_, NA_integer_), times = 8)

idf$set_object("ZoneHVAC-EquipList-ZoneB", val)
#> $ZoneHVAC_EquipList_ZoneB
#> <<[ID:456] `ZoneHVAC-EquipList-ZoneB`>> ZoneHVAC:EquipmentList
#> ------------------------------- * FIELDS * ------------------------------
#> * 1: ZoneHVAC-EquipList-ZoneB,  !- Name
#> * 2: ZoneHVAC:LowTemperatureRadiant:ConstantFlow,  !- Zone Equipment 1 Object Type
#> * 3: LowTRadCF-RadCeiling1-SecCW-Demand-Load-SysB,  !- Zone Equipment 1 Name
#> * 4: 1,                 !- Zone Equipment 1 Cooling Sequence
#> * 5: 1,                 !- Zone Equipment 1 Heating or No-Load Sequence
#>   6: ZoneHVAC:LowTemperatureRadiant:ConstantFlow,  !- Zone Equipment 2 Object Type
#>   7: LowTRadCF-RadCeiling2-SecCW-Demand-Load-SysB,  !- Zone Equipment 2 Name
#>   8: 2,                 !- Zone Equipment 2 Cooling Sequence
#>   9: 2,                 !- Zone Equipment 2 Heating or No-Load Sequence
#>  10: ZoneHVAC:LowTemperatureRadiant:ConstantFlow,  !- Zone Equipment 3 Object Type
#>  11: LowTRadCF-RadCeiling3-SecCW-Demand-Load-SysB,  !- Zone Equipment 3 Name
#>  12: 3,                 !- Zone Equipment 3 Cooling Sequence
#>  13: 3,                 !- Zone Equipment 3 Heating or No-Load Sequence
#>  14: <Blank>,           !- Zone Equipment 4 Object Type
#>  15: <Blank>,           !- Zone Equipment 4 Name
#>  16: <Blank>,           !- Zone Equipment 4 Cooling Sequence
#>  17: <Blank>,           !- Zone Equipment 4 Heating or No-Load Sequence
#>  18: <Blank>,           !- Zone Equipment 5 Object Type
#>  19: <Blank>,           !- Zone Equipment 5 Name
#>  20: <Blank>,           !- Zone Equipment 5 Cooling Sequence
#>  21: <Blank>,           !- Zone Equipment 5 Heating or No-Load Sequence
#>  22: <Blank>,           !- Zone Equipment 6 Object Type
#>  23: <Blank>,           !- Zone Equipment 6 Name
#>  24: <Blank>,           !- Zone Equipment 6 Cooling Sequence
#>  25: <Blank>,           !- Zone Equipment 6 Heating or No-Load Sequence
#>  26: <Blank>,           !- Zone Equipment 7 Object Type
#>  27: <Blank>,           !- Zone Equipment 7 Name
#>  28: <Blank>,           !- Zone Equipment 7 Cooling Sequence
#>  29: <Blank>,           !- Zone Equipment 7 Heating or No-Load Sequence
#>  30: <Blank>,           !- Zone Equipment 8 Object Type
#>  31: <Blank>,           !- Zone Equipment 8 Name
#>  32: <Blank>,           !- Zone Equipment 8 Cooling Sequence
#>  33: <Blank>,           !- Zone Equipment 8 Heating or No-Load Sequence
#>  34: <Blank>,           !- Zone Equipment 9 Object Type
#>  35: <Blank>,           !- Zone Equipment 9 Name
#>  36: <Blank>,           !- Zone Equipment 9 Cooling Sequence
#>  37: <Blank>,           !- Zone Equipment 9 Heating or No-Load Sequence
#>  38: <Blank>,           !- Zone Equipment 10 Object Type
#>  39: <Blank>,           !- Zone Equipment 10 Name
#>  40: <Blank>,           !- Zone Equipment 10 Cooling Sequence
#>  41: <Blank>,           !- Zone Equipment 10 Heating or No-Load Sequence
#>  42: <Blank>,           !- Zone Equipment 11 Object Type
#>  43: <Blank>,           !- Zone Equipment 11 Name
#>  44: <Blank>,           !- Zone Equipment 11 Cooling Sequence
#>  45: <Blank>;           !- Zone Equipment 11 Heating or No-Load Sequence
#> -------------------------------------------------------------------------
#> 

idf$set_object("ZoneHVAC-EquipList-ZoneB",
    list(zone_equipment_4_object_type = "AirTerminal:SingleDuct:Uncontrolled",
         zone_equipment_4_name = "DirectAir-ZoneB",
         zone_equipment_4_cooling_sequence = 4L,
         zone_equipment_4_heating_or_no_load_sequence = 4L))

#> Error: Incomplete extensible group found:
#> 1| Object `456` (Class `ZoneHVACEquipmentList`): Missing `Zone Equipment 5 Object Type`, `Zone Equipment 5 Name`, `ZoneEquipment 5 Cooling Sequence`...

Error after downloading latest version

I updated to eplusr version ‘0.10.2’ because of an issue with the model$del() function. It kept telling me that it is not a function. However this is not the main issue (I'll see if it persists after the update). After I updated to the latest version, the idf will not read into R. I get the following error:

model<-read_idf("Test.idf")

IDD v9.0.1 has not been parsed before.
Try to locate Energy+.idd in EnergyPlus v9.0.1 installation folder C:/EnergyPlusV9-0-1.
IDD file found: C:\EnergyPlusV9-0-1\Energy+.idd.
Start parsing...
Parsing completed.
Error in vecseq(f__, len__, if (allow.cartesian || notjoin || !anyDuplicated(f__, :
Join results in 90646 rows; more than 50512 = nrow(x)+nrow(i). Check for duplicate key values in i each of which join to the same group in x over and over again. If that's ok, try by=.EACHI to run j for each group to avoid the large allocation. If you are sure you wish to proceed, rerun with allow.cartesian=TRUE. Otherwise, please search for this error message in the FAQ, Wiki, Stack Overflow and data.table issue tracker for advice.

It doesn't happen with all IDFs but the one I'm using is a working idf (See attached IDF)
Do you have an idea of what it is? After a few attempts with different IDFs, the problem seems to occur with larger IDFs (approximately 90000 lines and over). This issue didn't exist before I updated.

Test.txt

Regards,
Benson

Fix CI errors on AppVeyor

The fs package is newly updated on May 2nd and complied version is not available on CRAN cache on AppVeyor, which makes CI failed on R oldrel.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.