atmoschem / emissv Goto Github PK
View Code? Open in Web Editor NEWCreate and processing emissions for numeric air quality models
Home Page: https://atmoschem.github.io/EmissV/
License: Other
Create and processing emissions for numeric air quality models
Home Page: https://atmoschem.github.io/EmissV/
License: Other
Dear maintainer,
We are preparing units 0.8-0 for release in approximately a month. I'm writing to you because our revdep checks report new issues in your package with this new version (you can check them here).
These issues seem to be caused by references to the old interface to install units (this or this, deprecated since 0.7-0 in favor of the new and more intuitive interface), which may cause a mere WARNING if CRAN checks find a reference to a non-exported object, or an ERROR if some part of the package or the tests use them.
To address this, if you wish to maintain compatibility with units < 0.7-0
, I suggest the approach taken in the constants
package, as you can see here, to avoid direct references to non-exported objects. Otherwise, you can just substitute the old interface with the new interface and depend on units >= 0.7-0
.
(part of openjournals/joss-reviews#662)
I suggest to restructure the README file to better align with the required sections:
# EmissV
statement of need, in plain language
## Installation
### System dependencies
Ubuntu, Fedora, ...
### Package installation
devtools::...
## Using `EmissV`
[R code chunk]
## ...
[add info about contribution, code of conduct, reporting bugs, seeking support, ...]
## License
...
DESCRIPTION
file, which is "Good" according to the reviewer guidelines already. I suggest to only list packages here that you actually provide information about, like how/why you import them, what they are needed for - and only if it is not obvious (like sp and raster for geospatial data)README.Rmd
file to generate the README.md with a R code based example, see http://usethis.r-lib.org/reference/use_readme_rmd.htmluse the package 'units' for all variables
I get an error with this line, and can't see this file in https://github.com/atmoschem/EmissV/tree/master/inst/extdata
raster <- raster::raster(paste(system.file("extdata", package = "EmissV"),
"/sample.tiff",sep=""))
Error in .local(.Object, ...) :
Error in .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", :
Cannot create a RasterLayer object from this file. (file does not exist)
> sessionInfo()
R version 3.5.0 (2018-04-23)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
Matrix products: default
locale:
[1] LC_COLLATE=English_Australia.1252 LC_CTYPE=English_Australia.1252
[3] LC_MONETARY=English_Australia.1252 LC_NUMERIC=C
[5] LC_TIME=English_Australia.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] EmissV_0.664.5
loaded via a namespace (and not attached):
[1] Rcpp_0.12.17 compiler_3.5.0 git2r_0.21.0 class_7.3-14
[5] tools_3.5.0 ncdf4_1.16 rpart_4.1-13 digest_0.6.15
[9] goftest_1.1-1 memoise_1.1.0 nlme_3.1-137 lattice_0.20-35
[13] mgcv_1.8-23 Matrix_1.2-14 DBI_1.0.0 rgdal_1.2-20
[17] curl_3.2 spData_0.2.8.3 e1071_1.6-8 spatstat.data_1.2-0
[21] withr_2.1.2 httr_1.3.1 raster_2.6-7 knitr_1.20
[25] devtools_1.13.5 spatstat.utils_1.8-0 classInt_0.2-3 grid_3.5.0
[29] data.table_1.11.2 sf_0.6-4 R6_2.2.2 foreign_0.8-70
[33] sp_1.2-7 polyclip_1.8-7 tensor_1.5 deldir_0.1-15
[37] udunits2_0.13 magrittr_1.5 units_0.5-1 maptools_0.9-2
[41] abind_1.4-5 spatstat_1.55-1
This is a brilliant package that we would like to incorporate within our analyses. To do that, we would like to use the streetDist
function which does not appear to work in current form. Reproducible code follows:
library (EmissV)
library (osmdata)
library (sf)
city <- "accra"
bb <- getbb (city)
dat <- opq (bbox = city) %>%
add_osm_feature (key = "highway") %>%
osmdata_sf (quiet = FALSE) %>%
osmdata::osm_poly2line () %>%
magrittr::extract2 ("osm_lines")
#saveRDS (dat, file = "accra-hw.Rds")
utm <- 32630 # for Accra
# Get a raster grid of population density to use for the emission distribution:
url <- paste0 ("https://github.com/ATFutures/who-data/releases/download/",
"v0.0.2-worldpop-tif-gha-npl/accra.2fpopdens.2fGHA15adj_040213.tif")
download.file (url, "accra-pop.tif", mode = "wb")
ras <- raster::raster ("accra-pop.tif") %>%
raster::crop (raster::extent (bb)) %>%
as ("SpatialPolygons") %>%
st_as_sf ()
#dat <- readRDS (file = "accra-hw.Rds")
dat <- dat [dat$highway %in% c ("motorway", "trunk", "primary",
"secondary", "teritary"), ]
s <- streetDist (emission = 1, dist = c (1, 0, 0, 0, 0), grid = ras,
osm = dat, epsg = utm)
# Error in fix.by(by.x, x) : 'by' must specify a uniquely valid column
# In addition: Warning message:
# attribute variables are assumed to be spatially constant throughout all geometries
Any help appreciated!
Note also the use of the osmdata
package which might be of general use within this package to very easily obtain OSM street networks.
Change the package sp to sf
EmissV::streetDist should include importFrom in roxygen2 and include sf field in DESCRIPTION in imports. It is better than depending on so many packages.
(part of openjournals/joss-reviews#662)
The requirements for the software license are fulfilled, however as a reader I still find it useful to have a reference to the license and the authors in the README file. I suggest to add a short section to the end of the README.
por exemplo, EmissV.colors, or algo assim, e que vai criar a tua paleta de cores....
Me envia o RGB
Oi @Schuch666
Que tu acha de adicionar aqui, ou no eixport, colocar condições de borde com quimica no wrf_bdy?
A ideia sera ler os dados de um modelo global e mapear os poluentes para o mecanismo quimico, e adicioanr esta informação no netcdf de wrf_bdy. Abs
I believe we need a substitute of anthro_emiss in EmissV. This tool would allow us to merge/speciate EDGAR and other emissions scenarios/data and use eixport::wrf_create to create wrfcheminputs
(part of openjournals/joss-reviews#662)
?vehicles
Vamos fazer que EmissV leia TODOS os inventarios disponiveis.
Eu vou adicionar uma função para baixar os dados tambem.
(part of openjournals/joss-reviews#662)
Strongly recommend to use testthat
to add tests for the package functionality.
AFAICS the Travis and Appveyor tests only run an installation of the package, but no unit or integration tests. Pointers welcome if I'm wrong!
It is also worth having examples in the docs that actually run (I saw mostly "dontrun" code blocks).
We are preparing units 0.7-0 for release, which deprecates this function. The new and much more intuitive install_unit
function will replace it.
There is a need of a newer version of lineSource to achieve 2 objectives:
grid
output from EmissV::gridInfo()
.Simplify the input EF and the calculations
change the name and add better verbose (better info to user)
Most of the functions of EmissV
imports from raster
, the "next step" to a more stable and up-to date package is to replace raster
to terra
:
https://r-spatial.org/r/2022/04/12/evolution.html
and
https://r-spatial.org/r/2022/12/14/evolution2.html
(part of openjournals/joss-reviews#662)
It's fun to learn some Portuguese and always refreshing to interact with different languages and cultures. However, for the code examples, I suggest to stick to English terms for clarity.
Translating some source code comments might be more welcoming to non-Portuguese contributors, e.g. https://github.com/atmoschem/EmissV/blob/master/R/plumerise.R
I was working through paper.md until I got to totalEmission
:
TOTAL <- totalEmission(veiculos,EF,pol = c("CO"),verbose = T)
Error: $ operator is invalid for atomic vectors
5.
as.character.units(structure(1127549.32468524, units = structure(list(
numerator = "t", denominator = "year"), .Names = c("numerator",
"denominator"), class = "symbolic_units"), class = "units"))
4.
as.character(structure(1127549.32468524, units = structure(list(
numerator = "t", denominator = "year"), .Names = c("numerator",
"denominator"), class = "symbolic_units"), class = "units"))
3.
paste("Total of", pol[i], ":", sum(total_t_y), units::deparse_unit(total_t_y))
2.
print(paste("Total of", pol[i], ":", sum(total_t_y), units::deparse_unit(total_t_y))) at totalEmission.R#62
1.
totalEmission(veiculos, EF, pol = c("CO"), verbose = T)
> sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 9 (stretch)
Matrix products: default
BLAS/LAPACK: /usr/lib/libopenblasp-r0.2.19.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=C
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] EmissV_0.664.5
loaded via a namespace (and not attached):
[1] Rcpp_0.12.17 raster_2.5-8 tensor_1.5 magrittr_1.5
[5] maptools_0.9-2 spatstat.utils_1.7-0 units_0.5-1 spatstat_1.52-1
[9] lattice_0.20-35 udunits2_0.13 tools_3.4.1 grid_3.4.1
[13] data.table_1.10.4 nlme_3.1-131 mgcv_1.8-19 DBI_0.7
[17] deldir_0.1-14 abind_1.4-5 goftest_1.1-1 sf_0.5-4
[21] Matrix_1.2-11 rpart_4.1-11 ncdf4_1.16 polyclip_1.6-1
[25] sp_1.2-5 compiler_3.4.1 foreign_0.8-69
this function can work wonderfully? need testing
migrate from sp to sf package
Please protect your package from the forthcoming retirement of rgdal: https://r-spatial.org/r/2022/04/12/evolution.html
CMD check on a platform without retiring packages and with _SP_EVOLUTION_STATUS=2
has this log:
00check.log
Condition use of raster on the the availability of rgdal (raster::projectRaster
fails if rgdal is not present), or preferably transition from raster to terra at your earliest convenience. terra is a re-implementation of raster but accesses GDAL directly.
Running revdep checks for current rgdal on R-Forge - see:
https://stat.ethz.ch/pipermail/r-sig-geo/2019-November/027801.html
shows the errors in the test failures below, related to use of PROJ&/GDAL3
and required changes to sp and rgdal. If useful find a regerence to a docker
image in this thread:
Changes will occur quite fast, and packages need to be prepared.
R version 3.6.1 (2019-07-05) -- "Action of the Toes"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(testthat)
> library(EmissV)
>
> test_check("EmissV")
using a example emission factor (values calculated from CETESB 2015):
CO PM
Light Duty Vehicles Gasohol 1.75 [g/km] 0.0013 [g/km]
Light Duty Vehicles Ethanol 10.04 [g/km] 0.0000 [g/km]
Light Duty Vehicles Flex 0.39 [g/km] 0.0010 [g/km]
Diesel Trucks 0.45 [g/km] 0.0612 [g/km]
Diesel Urban Busses 0.77 [g/km] 0.1052 [g/km]
Diesel Intercity Busses 1.48 [g/km] 0.1693 [g/km]
Gasohol Motorcycles 1.61 [g/km] 0.0000 [g/km]
Flex Motorcycles 0.75 [g/km] 0.0000 [g/km]
Emission factors:
CO PM
Light Duty Vehicles Gasohol 1.75 [g/km] 0.0013 [g/km]
Light Duty Vehicles Ethanol 10.04 [g/km] 0.0000 [g/km]
Light Duty Vehicles Flex 0.39 [g/km] 0.0010 [g/km]
Diesel Trucks 0.45 [g/km] 0.0612 [g/km]
Diesel Urban Busses 0.77 [g/km] 0.1052 [g/km]
Diesel Intercity Busses 1.48 [g/km] 0.1693 [g/km]
Gasohol Motorcycles 1.61 [g/km] 0.0000 [g/km]
Flex Motorcycles 0.75 [g/km] 0.0000 [g/km]
processing area ...
Grid information from: /home/rsb/topics/packages/rgdal/deps_ng/EmissV.Rcheck/EmissV/extdata/wrfinput_d01
fraction of area inside the domain = 0.955761973247402
── 1. Failure: emissions with source by area (@test-areaSource.R#4) ───────────
areaSource(...) not equal to readRDS("data01.Rds").
Attributes: < Component "crs": Attributes: < Names: 1 string mismatch > >
Attributes: < Component "crs": Attributes: < Length mismatch: comparison on first 2 components > >
Attributes: < Component "crs": Attributes: < Component 2: 1 string mismatch > >
processing Chururuba area ...
Grid information from: /home/rsb/topics/packages/rgdal/deps_ng/EmissV.Rcheck/EmissV/extdata/wrfinput_d01
fraction of Chururuba area inside the domain = 0.955761973247402
processing Juruzinha area ...
using a example of vehicles (DETRAN 2016 data and SP vahicle distribution):
using a example emission factor (values calculated from CETESB 2015):
Total of CO : 1676996.43578795 t year-1
FISH not found in total !
FISH not found in total !
calculating emissions for CO as aerosol ...
using a example of vehicles (DETRAN 2016 data and SP vahicle distribution):
using a example emission factor (values calculated from CETESB 2015):
Total of CO : 1676996.43578795 t year-1
Grid information from: /home/rsb/topics/packages/rgdal/deps_ng/EmissV.Rcheck/EmissV/extdata/wrfinput_d01
Grid information from: /home/rsb/topics/packages/rgdal/deps_ng/EmissV.Rcheck/EmissV/extdata/wrfinput_d01
calculating emissions for CO using molar mass = 28 ...
using a example of vehicles (DETRAN 2016 data and SP vahicle distribution):
using a example emission factor (values calculated from CETESB 2015):
Grid information from: /home/rsb/topics/packages/rgdal/deps_ng/EmissV.Rcheck/EmissV/extdata/wrfinput_d01
reading emi_co (EDGAR) output unit is g m-2 s-1 ...
from edgar_co_test.nc x 1.00
Using raster from inventory ...
Grid output: 99 columns 93 rows
reading emi_co (EDGAR) output unit is g m-2 s-1 ...
from edgar_co_test.nc x 1.00
Using raster from inventory ...
Grid output: 99 columns 93 rows
Grid information from: vertical.nc
Grid information from: /home/rsb/topics/packages/rgdal/deps_ng/EmissV.Rcheck/EmissV/extdata/wrfinput_d03
using length as emission variable
Number of lat points 51
Number of lon points 51
using length as emission variable
Number of lat points 51
Number of lon points 51
convective, h/L = -5.7372346528973
using weil max= 31
convective, h/L = -8.61326442721792
strong convective, h/L = -16.3733115022513
using weil max= 155
strong convective, h/L = -33.003300330033
using weil max= 217
strong convective, h/L = -67.7966101694915
strong convective, h/L = -79.3650793650794
strong convective, h/L = -110.650069156293
strong convective, h/L = -32.0056899004267
stable, h/L = 200 - calm, U= 0.11 m/s
stable, h/L = 200 - windy, U= 3.11 m/s
neutral, h/L = 0.956937799043062
* max iterations reached!
Grid information from: vertical.nc
Layer limits for grid position lat= -23.5803346633911 lon= -44.9668502807617
height= 0.00 m k= 1
height= 59.74 m k= 2
height= 145.50 m k= 3
height= 257.90 m k= 4
height= 397.87 m k= 5
height= 575.59 m k= 6
height= 802.06 m k= 7
height= 1070.66 m k= 8
height= 1532.39 m k= 9
height= 2014.39 m k= 10
height= 2519.01 m k= 11
height= 3049.04 m k= 12
height= 4035.38 m k= 13
height= 5020.68 m k= 14
height= 6005.89 m k= 15
height= 6992.68 m k= 16
height= 7982.44 m k= 17
height= 8976.27 m k= 18
height= 9968.42 m k= 19
height= 10957.52 m k= 20
height= 11941.38 m k= 21
height= 12920.99 m k= 22
height= 13908.15 m k= 23
height= 14879.66 m k= 24
height= 15842.59 m k= 25
height= 16803.16 m k= 26
height= 17760.40 m k= 27
height= 18715.93 m k= 28
height= 19676.74 m k= 29
height= 20649.44 m k= 30
Emission heigh between 59.74 m and 145.50 m at k= 2 for z= 100
Layer limits for grid position lat= -23.5803346633911 lon= -44.9668502807617
height= 0.00 m k= 1
height= 59.74 m k= 2
height= 145.50 m k= 3
height= 257.90 m k= 4
height= 397.87 m k= 5
height= 575.59 m k= 6
height= 802.06 m k= 7
height= 1070.66 m k= 8
height= 1532.39 m k= 9
height= 2014.39 m k= 10
height= 2519.01 m k= 11
height= 3049.04 m k= 12
height= 4035.38 m k= 13
height= 5020.68 m k= 14
height= 6005.89 m k= 15
height= 6992.68 m k= 16
height= 7982.44 m k= 17
height= 8976.27 m k= 18
height= 9968.42 m k= 19
height= 10957.52 m k= 20
height= 11941.38 m k= 21
height= 12920.99 m k= 22
height= 13908.15 m k= 23
height= 14879.66 m k= 24
height= 15842.59 m k= 25
height= 16803.16 m k= 26
height= 17760.40 m k= 27
height= 18715.93 m k= 28
height= 19676.74 m k= 29
height= 20649.44 m k= 30
Emission heigh between 802.06 m and 1070.66 m at k= 7 for z= 1000
Layer limits for grid position lat= -23.5196027755737 lon= -44.9668502807617
height= 0.00 m k= 1
height= 59.81 m k= 2
height= 145.61 m k= 3
height= 257.97 m k= 4
height= 397.90 m k= 5
height= 575.53 m k= 6
height= 801.97 m k= 7
height= 1070.70 m k= 8
height= 1532.64 m k= 9
height= 2014.67 m k= 10
height= 2519.25 m k= 11
height= 3049.28 m k= 12
height= 4035.69 m k= 13
height= 5020.84 m k= 14
height= 6005.95 m k= 15
height= 6993.00 m k= 16
height= 7982.73 m k= 17
height= 8976.44 m k= 18
height= 9968.59 m k= 19
height= 10957.95 m k= 20
height= 11942.11 m k= 21
height= 12921.73 m k= 22
height= 13908.66 m k= 23
height= 14880.00 m k= 24
height= 15842.81 m k= 25
height= 16803.23 m k= 26
height= 17760.21 m k= 27
height= 18715.41 m k= 28
height= 19675.99 m k= 29
height= 20648.63 m k= 30
Emission heigh between 575.53 m and 801.97 m at k= 6 for z= 666
Grid information from: /home/rsb/topics/packages/rgdal/deps_ng/EmissV.Rcheck/EmissV/extdata/wrfinput_d01
grid position lat= -22.010806627171 lon= -46.0152584808041
grid position lat= -22.010806627171 lon= -47.9944115841027
grid position lat= -23.4723500487625 lon= -47.0048350324534
Grid information from: vertical.nc
Grid output: 4 columns 4 rows 30 levels
Grid information from: vertical.nc
Grid output: 4 columns 4 rows 30 levels
reading emi_co (EDGAR) output unit is g m-2 s-1 ...
from edgar_co_test.nc x 1.00
using a example of vehicles (DETRAN 2016 data and SP vahicle distribution):
Category Type Fuel Use SP RJ
Light Duty Vehicles Gasohol LDV_E25 LDV E25 41 [km/d] 11624342 2712343
Light Duty Vehicles Ethanol LDV_E100 LDV E100 41 [km/d] 874627 204079
Light Duty Vehicles Flex LDV_F LDV FLEX 41 [km/d] 9845022 2297169
Diesel Trucks TRUCKS_B5 TRUCKS B5 110 [km/d] 710634 165814
Diesel Urban Busses CBUS_B5 BUS B5 165 [km/d] 792630 184947
Diesel Intercity Busses MBUS_B5 BUS B5 165 [km/d] 21865 5101
Gasohol Motorcycles MOTO_E25 MOTO E25 140 [km/d] 3227921 753180
Flex Motorcycles MOTO_F MOTO FLEX 140 [km/d] 235056 54846
MG PR SC
Light Duty Vehicles Gasohol 4371228 3036828 2029599
Light Duty Vehicles Ethanol 328895 228494 152709
Light Duty Vehicles Flex 3702131 2571986 1718932
Diesel Trucks 267227 185651 124076
Diesel Urban Busses 298061 207072 138392
Diesel Intercity Busses 8222 5712 3817
Gasohol Motorcycles 1213830 843285 563592
Flex Motorcycles 88390 61407 41040
using a example emission factor (values calculated from CETESB 2015):
CO PM
Light Duty Vehicles Gasohol 1.75 [g/km] 0.0013 [g/km]
Light Duty Vehicles Ethanol 10.04 [g/km] 0.0000 [g/km]
Light Duty Vehicles Flex 0.39 [g/km] 0.0010 [g/km]
Diesel Trucks 0.45 [g/km] 0.0612 [g/km]
Diesel Urban Busses 0.77 [g/km] 0.1052 [g/km]
Diesel Intercity Busses 1.48 [g/km] 0.1693 [g/km]
Gasohol Motorcycles 1.61 [g/km] 0.0000 [g/km]
Flex Motorcycles 0.75 [g/km] 0.0000 [g/km]
Total of PM : 15071.8124616163 t year-1
using a example of vehicles (DETRAN 2016 data and SP vahicle distribution):
using a example emission factor (values calculated from CETESB 2015):
using a example of vehicles (DETRAN 2016 data and SP vahicle distribution):
using a example emission factor (values calculated from CETESB 2015):
FISH not found in emission factor!
The emissions factors contains:
CO
PM
function totalVOC will be discontinued in the next versions
using a example of vehicles (DETRAN 2016 data and SP vahicle distribution):
using a example of vehicles (DETRAN 2016 data and SP vahicle distribution):
Total COV: 2703251.58732021 t year-1
xyl 262330984930.355 MOL year-1
function totalVOC will be discontinued in the next versions
using a example of vehicles (DETRAN 2016 data and SP vahicle distribution):
a is not in suported COV speciation
The specie list contains:
eth hc3 hc5 hc8 ol2 olt oli iso tol xyl ket ch3oh ald
using a example of vehicles (DETRAN 2016 data and SP vahicle distribution):
Category Type Fuel Use SP RJ
Light Duty Vehicles Gasohol LDV_E25 LDV E25 41 [km/d] 11624342 2712343
Light Duty Vehicles Ethanol LDV_E100 LDV E100 41 [km/d] 874627 204079
Light Duty Vehicles Flex LDV_F LDV FLEX 41 [km/d] 9845022 2297169
Diesel Trucks TRUCKS_B5 TRUCKS B5 110 [km/d] 710634 165814
Diesel Urban Busses CBUS_B5 BUS B5 165 [km/d] 792630 184947
Diesel Intercity Busses MBUS_B5 BUS B5 165 [km/d] 21865 5101
Gasohol Motorcycles MOTO_E25 MOTO E25 140 [km/d] 3227921 753180
Flex Motorcycles MOTO_F MOTO FLEX 140 [km/d] 235056 54846
MG PR SC
Light Duty Vehicles Gasohol 4371228 3036828 2029599
Light Duty Vehicles Ethanol 328895 228494 152709
Light Duty Vehicles Flex 3702131 2571986 1718932
Diesel Trucks 267227 185651 124076
Diesel Urban Busses 298061 207072 138392
Diesel Intercity Busses 8222 5712 3817
Gasohol Motorcycles 1213830 843285 563592
Flex Motorcycles 88390 61407 41040
vehicles:
Category Type Fuel Use SP
1 B5 LDV NA 41 [km/d] 27332097
══ testthat results ═══════════════════════════════════════════════════════════
[ OK: 21 | SKIPPED: 0 | WARNINGS: 72 | FAILED: 1 ]
1. Failure: emissions with source by area (@test-areaSource.R#4)
Error: testthat unit tests failed
Execution halted
This function cause dependencies of 2 r-packages: spatsts, maptools and uses sp
The package sf can be used to speed-up this function and make the package less dependent
I'm planning a new units submission to CRAN in about a week; it will break EmissV as of now.
Could you please look into this:
edzer@gin-edzer:/tmp/rdeps$ cat rdepends_EmissV.Rcheck/00check.log
* using log directory ‘/tmp/rdeps/EmissV.Rcheck’
* using R version 3.5.1 (2018-07-02)
* using platform: x86_64-pc-linux-gnu (64-bit)
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘EmissV/DESCRIPTION’ ... OK
* this is package ‘EmissV’ version ‘0.664.7’
* package encoding: UTF-8
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘EmissV’ can be installed ... OK
* checking installed package size ... OK
* checking package directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking contents of ‘data’ directory ... OK
* checking data for non-ASCII characters ... OK
* checking data for ASCII and uncompressed saves ... OK
* checking examples ... ERROR
Running examples in ‘EmissV-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: emission
> ### Title: Emissions in the format for atmospheric models
> ### Aliases: emission
>
> ### ** Examples
>
> veiculos <- vehicles(example = TRUE)
using a example of vehicles (DETRAN 2016 data and SP vahicle distribution):
Category Type Fuel Use SP RJ
Light Duty Vehicles Gasohol LDV_E25 LDV E25 41 [km/d] 11624342 2712343
Light Duty Vehicles Ethanol LDV_E100 LDV E100 41 [km/d] 874627 204079
Light Duty Vehicles Flex LDV_F LDV FLEX 41 [km/d] 9845022 2297169
Diesel Trucks TRUCKS_B5 TRUCKS B5 110 [km/d] 710634 165814
Diesel Urban Busses CBUS_B5 BUS B5 165 [km/d] 792630 184947
Diesel Intercity Busses MBUS_B5 BUS B5 165 [km/d] 21865 5101
Gasohol Motorcycles MOTO_E25 MOTO E25 140 [km/d] 3227921 753180
Flex Motorcycles MOTO_F MOTO FLEX 140 [km/d] 235056 54846
MG PR SC
Light Duty Vehicles Gasohol 4371228 3036828 2029599
Light Duty Vehicles Ethanol 328895 228494 152709
Light Duty Vehicles Flex 3702131 2571986 1718932
Diesel Trucks 267227 185651 124076
Diesel Urban Busses 298061 207072 138392
Diesel Intercity Busses 8222 5712 3817
Gasohol Motorcycles 1213830 843285 563592
Flex Motorcycles 88390 61407 41040
>
> EmissionFactors <- emissionFactor(example = TRUE)
using a example emission factor (values calculated from CETESB 2015):
CO PM
Light Duty Vehicles Gasohol 1.75 [g/km] 0.0013 [g/km]
Light Duty Vehicles Ethanol 10.04 [g/km] 0.0000 [g/km]
Light Duty Vehicles Flex 0.39 [g/km] 0.0010 [g/km]
Diesel Trucks 0.45 [g/km] 0.0612 [g/km]
Diesel Urban Busses 0.77 [g/km] 0.1052 [g/km]
Diesel Intercity Busses 1.48 [g/km] 0.1693 [g/km]
Gasohol Motorcycles 1.61 [g/km] 0.0000 [g/km]
Flex Motorcycles 0.75 [g/km] 0.0000 [g/km]
>
> TOTAL <- totalEmission(veiculos,EmissionFactors,pol = c("CO"),verbose = TRUE)
Total of CO : 1676996.43578795 t year-1
>
> grid <- gridInfo(paste0(system.file("extdata", package = "EmissV"),"/wrfinput_d01"))
Grid information from: /tmp/rdeps/EmissV.Rcheck/EmissV/extdata/wrfinput_d01
> shape <- raster::shapefile(paste0(system.file("extdata", package = "EmissV"),"/BR.shp"))
> raster <- raster::raster(paste0(system.file("extdata", package = "EmissV"),"/dmsp.tiff"))
>
> SP <- areaSource(shape[22,1],raster,grid,name = "SP")
processing SP area ... fraction of SP area inside the domain = 0.955761973247402> RJ <- areaSource(shape[17,1],raster,grid,name = "RJ")
processing RJ area ... fraction of RJ area inside the domain = 0.748007015306122>
> e_CO <- emission(TOTAL,"CO",list(SP = SP, RJ = RJ),grid,mm=28)
calculating emissions for CO using molar mass = 28 ...
Error in R_ut_remove_unit(name) : unknown unit name or symbol
Calls: emission -> remove_symbolic_unit -> R_ut_remove_unit
Execution halted
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ... ERROR
Running ‘testthat.R’
Running the tests in ‘tests/testthat.R’ failed.
Last 13 lines of output:
Light Duty Vehicles Flex 3702131 2571986 1718932
Diesel Trucks 267227 185651 124076
Diesel Urban Busses 298061 207072 138392
Diesel Intercity Busses 8222 5712 3817
Gasohol Motorcycles 1213830 843285 563592
Flex Motorcycles 88390 61407 41040
vehicles:
Category Type Fuel Use SP
1 B5 LDV NA 41 [km/d] 27332097
══ testthat results ═══════════════════════════════════════════════════════════
OK: 18 SKIPPED: 0 FAILED: 1
1. Error: final emission works (@test-emission.R#21)
Error: testthat unit tests failed
Execution halted
* checking PDF version of manual ... OK
* DONE
Status: 2 ERRORs
Topdown emissions needs temporal profiles for distributing the emissions. They must be based on traffic, emissions and experiments. This profiles could be stored in a list.
e.g.:
data(profiles)
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.