hongyuanjia / eplusr Goto Github PK
View Code? Open in Web Editor NEWA Toolkit for Using EnergyPlus in R.
Home Page: https://hongyuanjia.github.io/eplusr
License: Other
A Toolkit for Using EnergyPlus in R.
Home Page: https://hongyuanjia.github.io/eplusr
License: Other
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.
#>
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.
Forgot to skip tests on Idf printing tests on Latin locale. Have to submit a fix version again...
Seems like r-devel-linux-x86_64-debian-clang
does not support UTF-8 locale. Should skip formatting tests on it and resubmit it again.
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.
Regards,
Benson
$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.
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"
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)
Currently, all simulations in ParametricJob
class will be run in waiting mode, which makes it impossible to kill them. A clear message should be given to inform the users.
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
epw$holiday(holiday = list(name = c("New Year's Day", "Christmas Day"), day = c("1.1", "25 Dec")))
# name day
# 1: New Year's Day 1/ 1
# 2: Christmas Day 12/25
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.
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
Right now, [[.IdfObject
only allows valid field name input.
Field index support should be added, like this:
idfobj[[2]]
Hi! The $run function seems to work only if the Eplus is installed in the default path of the eplusr package. For example, the run function failed in my PC with Eplus installed in disk D, although I specified the eplus_home argument. BTW, I'm a Windows user.
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)
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.
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
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)
use_eplus
did not work if input is an EnergyPlus installation path which did not follow EnergyPlus Windows installation path.
For monthly reporting frequency, dst
, day_type
will be NA
For runperiod reporting frequency, month
, day
, hour
, minute
, dst
and day_type
are all NA
s.
The original way for calculating datetime did not work in this case.
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.
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.
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
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.
Regards,
Benson
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
and125
].
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
Prepare for release:
devtools::check()
devtools::check_win_devel()
rhub::check_for_cran()
revdepcheck::revdep_check(num_workers = 4)
Submit to CRAN:
usethis::use_version('patch')
cran-comments.md
devtools::submit_cran()
Wait for CRAN...
usethis::use_github_release()
usethis::use_dev_version()
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!!!
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.
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
Line 2009 in e3b2289
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]
Prepare for release:
devtools::check()
devtools::check_win_devel()
rhub::check_for_cran()
revdepcheck::revdep_check(num_workers = 4)
Submit to CRAN:
usethis::use_version('patch')
cran-comments.md
devtools::submit_cran()
Wait for CRAN...
usethis::use_github_release()
usethis::use_dev_version()
Cannot manually create an EplusJob
class.
eplus_job(idf, epw)
#> Error: Could not find version of input idf file.
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`.
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
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".
This works correctly for the other EnergyPlus objects that I've called so far. See example of Branch object "Branch.png".
I'm not sure if this affects any other classes.
Regards,
Benson
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
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
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.
$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`...
See #5893.
Currently did not find any R bindings for the JSON library that EnergyPlus uses to parse IDD and IDF file in JSON format.
Implementation in EnergyPlus: https://github.com/NREL/EnergyPlus/tree/v9.1.0/src/EnergyPlus/InputProcessing
Output:JSON
class introduced in v9.1.0
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
.
Line 2934 in dfce13d
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
Prepare for release:
devtools::check()
devtools::check_win_devel()
rhub::check_for_cran()
revdepcheck::revdep_check(num_workers = 4)
Submit to CRAN:
usethis::use_version('patch')
cran-comments.md
devtools::submit_cran()
Wait for CRAN...
usethis::use_github_release()
usethis::use_dev_version()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.