Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor and export internal functions #260

Merged
merged 45 commits into from
Jul 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
f482de3
[refactor] Clean 'assign_defaultLvalue()' interface
Apr 9, 2020
1093038
[refactor] Refactor utils.R
Apr 10, 2020
a7dc177
[refactor] Clean up units.R
Apr 10, 2020
29b4539
[refactor] Refactor eplusr.R
Apr 11, 2020
55f40b2
[refactor] Tweak 'standardize_ver()' and 'match_minor_ver()'
Apr 11, 2020
e218397
[refactor] Refactor run.R
Apr 11, 2020
753d264
[refactor] Refactor parse.R
Apr 12, 2020
29287bf
[refactor] Further clean utils.R
Apr 14, 2020
6da2971
[refactor] Further clean parse.R
Apr 14, 2020
de626fa
[refactor] Further clean options.R
Apr 14, 2020
8b35ac8
[refactor] Further clean run.R
Apr 14, 2020
c648697
[refactor] Refactor impl.R
Apr 15, 2020
9353e09
[refactor] Refactor impl-idd.R
Apr 15, 2020
abc760e
[refactor] Export 'get_*_env()' internal functions
Apr 15, 2020
b2e4e17
[doc] Update NEWS
Apr 15, 2020
246ba0d
[refactor] Clean up checkmate imports
Apr 15, 2020
937c761
[refactor] Refactor idd.R
Apr 15, 2020
0f693e3
[refactor] Allow min and max being NA in 'ranger()'
Apr 16, 2020
ceeced3
[refactor] Refactor impl-iddobj.R
Apr 16, 2020
9b351e8
[refactor] Refactor idd_object.R
Apr 16, 2020
349cd4b
[refactor] Skip 'download_idd()' and 'use_idd()' tests on CRAN
Apr 16, 2020
855cb49
Merge branch 'master' into refactor
Jun 10, 2020
de46ac9
[fix] Fix IdfRelationBy printing when depth > 0. Closes #246
Jul 10, 2020
9ddfc1a
[refactor] Refactor impl-idf.R
Jul 10, 2020
4931bf2
[refactor] Refactor basic implementation
Jul 13, 2020
2d89b9e
[refactor] Refactor transition.R
Jul 19, 2020
a1f8d2a
[refactor] Refactor Epw class
Jul 25, 2020
4a5d852
[refactor] Refactor assert.R
Jul 25, 2020
a08fc8b
[fix] Fix tests
Jul 26, 2020
47cf41a
[fix] Fix checks
Jul 26, 2020
b5ee650
[fix] Fix checks
Jul 26, 2020
3b1dc0b
Merge branch 'master' into refactor
Jul 26, 2020
f1b7ff0
[fix] Fix tests
Jul 26, 2020
09119c6
[fix] Fix tests on Windows
Jul 26, 2020
29758e8
[fix] Fix tests
Jul 26, 2020
a67b3fe
[fix] Fix tests
Jul 26, 2020
0767591
[fix] Make sure 'key_value' and 'name' matching is case-insensitive
Jul 26, 2020
3fb11eb
[fix] Fix transition processing when `\min-fields` has been increased
Jul 26, 2020
d67fd00
[fix] Remove browser
Jul 26, 2020
8a1029c
[fix] Fix day type matching when extracting SQL report data
Jul 26, 2020
b5a417d
[docs] Update README
Jul 26, 2020
5d7859b
[docs] Update NEWS
Jul 26, 2020
774037c
[fix] Fix nocov pair
Jul 26, 2020
39a6b5e
[meta] Depends on data.table v0.12.4
Jul 26, 2020
70770e0
[fix] Fix checks
Jul 26, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ Depends:
R (>= 3.2.0)
Imports:
callr (>= 2.0.4),
checkmate,
cli (>= 1.1.0),
crayon,
data.table (>= 1.9.8),
data.table (>= 1.12.4),
lubridate,
methods,
processx (>= 3.2.0),
Expand All @@ -38,41 +39,42 @@ Suggests:
pkgdown,
rgl,
rmarkdown,
testthat
VignetteBuilder:
testthat (>= 2.1.0)
VignetteBuilder:
knitr
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE, roclets = c("rd", "namespace",
"collate"))
RoxygenNote: 7.0.2
RoxygenNote: 7.1.1
SystemRequirements: EnergyPlus (>= 8.3, optional)
(<https://energyplus.net>); udunits2
Collate:
'constants.R'
'assertions.R'
'assert.R'
'diagram.R'
'eplusr.R'
'utils.R'
'impl.R'
'parse.R'
'impl-epw.R'
'impl-idd.R'
'impl-idf.R'
'idf.R'
'idd.R'
'epw.R'
'err.R'
'format.R'
'geometry.R'
'group.R'
'impl-idd.R'
'idd.R'
'idd_object.R'
'impl-idf.R'
'idf.R'
'iddobj.R'
'impl-idfobj.R'
'idf_object.R'
'idfobj.R'
'impl-iddobj.R'
'impl-sql.R'
'install.R'
'job.R'
'options.R'
'param.R'
'rdd.R'
'reload.R'
Expand Down
82 changes: 81 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ S3method("==",Idf)
S3method("==",IdfObject)
S3method("==",ParametricJob)
S3method("[",EpwDate)
S3method("[",Idd)
S3method("[",IdfObject)
S3method("[<-",EpwDate)
S3method("[[",EpwDate)
Expand All @@ -49,6 +48,7 @@ S3method(format,Idf)
S3method(format,IdfObject)
S3method(format,Range)
S3method(print,EpwDate)
S3method(print,EpwValidity)
S3method(print,ErrFile)
S3method(print,IddFieldPossible)
S3method(print,IddRelation)
Expand Down Expand Up @@ -89,22 +89,45 @@ export(IddObject)
export(Idf)
export(IdfObject)
export(ParametricJob)
export(add_idf_object)
export(assign_idf_value_default)
export(avail_eplus)
export(avail_idd)
export(clean_wd)
export(custom_validate)
export(del_idf_object)
export(download_eplus)
export(download_idd)
export(download_weather)
export(dt_to_load)
export(dup_idf_object)
export(duplicated_idf_object)
export(empty_idf)
export(eplus_config)
export(eplus_job)
export(eplus_sql)
export(eplusr_option)
export(expand_idf_dots_literal)
export(expand_idf_dots_name)
export(expand_idf_dots_object)
export(expand_idf_dots_value)
export(expand_idf_regex)
export(get_idd_class)
export(get_idd_field)
export(get_idd_relation)
export(get_idf_node_relation)
export(get_idf_object)
export(get_idf_relation)
export(get_idf_table)
export(get_idf_value)
export(get_object_info)
export(get_priv_env)
export(get_self_env)
export(group_job)
export(idd_object)
export(idf_object)
export(init_idf_object)
export(init_idf_value)
export(install_eplus)
export(is_avail_eplus)
export(is_avail_idd)
Expand All @@ -117,20 +140,31 @@ export(is_iddobject)
export(is_idf)
export(is_idfobject)
export(level_checks)
export(make_idf_object_name)
export(mdd_to_load)
export(param_job)
export(parse_dots_value)
export(purge_idf_object)
export(rdd_to_load)
export(read_epw)
export(read_err)
export(read_idf)
export(read_idfeditor_copy)
export(read_mdd)
export(read_rdd)
export(reload)
export(remove_duplicated_objects)
export(remove_empty_fields)
export(rename_idf_object)
export(run_idf)
export(run_multi)
export(set_idf_object)
export(standardize_idf_value)
export(transition)
export(unique_idf_object)
export(use_eplus)
export(use_idd)
export(validate_objects)
export(version_updater)
export(with_option)
export(with_silent)
Expand All @@ -144,11 +178,54 @@ importFrom(RSQLite,dbGetQuery)
importFrom(RSQLite,dbListTables)
importFrom(RSQLite,dbReadTable)
importFrom(callr,r_bg)
importFrom(checkmate,assert)
importFrom(checkmate,assert_character)
importFrom(checkmate,assert_choice)
importFrom(checkmate,assert_class)
importFrom(checkmate,assert_count)
importFrom(checkmate,assert_data_frame)
importFrom(checkmate,assert_data_table)
importFrom(checkmate,assert_directory_exists)
importFrom(checkmate,assert_file)
importFrom(checkmate,assert_file_exists)
importFrom(checkmate,assert_flag)
importFrom(checkmate,assert_function)
importFrom(checkmate,assert_int)
importFrom(checkmate,assert_integer)
importFrom(checkmate,assert_integerish)
importFrom(checkmate,assert_list)
importFrom(checkmate,assert_logical)
importFrom(checkmate,assert_names)
importFrom(checkmate,assert_number)
importFrom(checkmate,assert_numeric)
importFrom(checkmate,assert_posixct)
importFrom(checkmate,assert_scalar)
importFrom(checkmate,assert_string)
importFrom(checkmate,assert_subset)
importFrom(checkmate,assert_true)
importFrom(checkmate,assert_vector)
importFrom(checkmate,check_character)
importFrom(checkmate,check_integerish)
importFrom(checkmate,check_string)
importFrom(checkmate,qassert)
importFrom(checkmate,qassertr)
importFrom(checkmate,qtestr)
importFrom(checkmate,test_character)
importFrom(checkmate,test_choice)
importFrom(checkmate,test_class)
importFrom(checkmate,test_file_exists)
importFrom(checkmate,test_flag)
importFrom(checkmate,test_integerish)
importFrom(checkmate,test_list)
importFrom(checkmate,test_names)
importFrom(checkmate,test_r6)
importFrom(checkmate,test_string)
importFrom(cli,boxx)
importFrom(cli,cat_boxx)
importFrom(cli,cat_bullet)
importFrom(cli,cat_line)
importFrom(cli,cat_rule)
importFrom(cli,console_width)
importFrom(cli,rule)
importFrom(cli,symbol)
importFrom(crayon,bold)
Expand All @@ -174,9 +251,11 @@ importFrom(data.table,setDT)
importFrom(data.table,setattr)
importFrom(data.table,setcolorder)
importFrom(data.table,setindexv)
importFrom(data.table,setnafill)
importFrom(data.table,setnames)
importFrom(data.table,setorder)
importFrom(data.table,setorderv)
importFrom(data.table,transpose)
importFrom(grDevices,rgb)
importFrom(lubridate,"year<-")
importFrom(lubridate,as_datetime)
Expand Down Expand Up @@ -213,6 +292,7 @@ importFrom(stringi,stri_endswith_fixed)
importFrom(stringi,stri_extract_first_regex)
importFrom(stringi,stri_isempty)
importFrom(stringi,stri_length)
importFrom(stringi,stri_locate_first_charclass)
importFrom(stringi,stri_locate_first_fixed)
importFrom(stringi,stri_locate_first_regex)
importFrom(stringi,stri_match_first_regex)
Expand Down
33 changes: 23 additions & 10 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

## New features

* `Idf$add()` and `Idf$set()` have new features:

```r
# 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 parameter `force`. The default value is `FALSE`. If
`TRUE`, 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
Expand Down Expand Up @@ -60,6 +71,8 @@
- `"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.

## Major changes

Expand Down Expand Up @@ -110,25 +123,25 @@
value of field `Component 1 Object Type` is `Coil:Heating:Water`, all
objects in `Coil:Heating:Water` will be treated as referenced by that
field. This is the most aggressive option.
* `read_epw()` will proceed parsing if type error occurs for non-important
headers, including `LOCATION`, `DESIGN CONDITIONS`, `TYPICAL/EXTREME PERIODS`
and `GROUND TEMPERATURES` (#236). These headers are not directly used in any
other method of `Epw` class. Some EPWs from sources other than energyplus.net
sometimes fail to give all valid values for those headers. Now `read_epw()`
will return all failed-to-parse values as `NA`s. All parsing warnings can be
shown by setting `warning` in `read_epw()` to `TRUE`. For `HOLIDAYS/DAYLIGHT
SAVINGS` and `DATA PERIODS`, `read_epw()` will still give an error if any
parsing errors are found. This is because the values of those 2 headers are
used to parsing the actual weather data.
* `read_epw()` will proceed parsing for non-standard EPW header format (#236).
* Now `EplusSql$report_data()` will set the year values of day type
`SummerDesignDay` and `WinterDesignDay` to current year and the `day_type`
value will be left unchanged (#258).
* Now `read_idf()` will always make sure all necessary fields are added during
parsing (#267).

## Minor changes

* `EplusJob`, `EplusGroupJob` and `ParametricJob` will not parse input EPW
files, but only validate their existences and store the paths (#215)
* `period` parameter in `EplusSql$report_data()` now works as expected (#259).
* `run_idf()` and `run_multi()` now return additional element/column called
* `version` which contain the versions of EnergyPlus that are called during
simulations
* `format.Idd()` now returns a single line string in format
`<EnergyPlus IDD v[Version] (Build) with X classes`.
* The column `datasource` returned in `Epw$data()` has been renamed to
`data_source`.

## Bug fixes

Expand Down
Loading