Code Monkey home page Code Monkey logo

biomass_speciesdata's People

Contributors

achubaty avatar actions-user avatar araymund83 avatar ceresbarros avatar eliotmcintire avatar ianmseddy avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

biomass_speciesdata's Issues

Switch to using `Plots`

As pointed out in #32 , we should ideally be using Plots to plot the final speciesLayers. Switching to Plots can be done at the module level or in LandR::plotVTM

SSL certificate of NFI FTP server (used for KNN data) is bad.

We need to change httr::config throughout this and other modules to be able to download KNN layers.
Solution:

  • create a new module parameter that controls httr::config(ssl_verify) and wrap problematic prepInputs calls into httr::with_config()

use Plots()

I really want to get the Initial Types plot produced as png, so improving the plotting in this module is needed.

don't use tempfiles for final outputs

the final [filebacked] raster stack that is output from this modules needs be stored in the user's directory rather than a temporary location. all these temp files are clogging up storage space, and may not persist between reboots.

this likely goes deeper than just this module (i.e., likely needs to be addressed in prepInputs et al.)

GitHub workflow failling - `install.packages("SpaDES")` not installing `SpaDES.core` et al

SpaDES packages other than SpaDES.addins are being installed when install.packages("SpaDES", dependencies = TRUE) is run in the GH workflow:

trying URL 'https://packagemanager.rstudio.com/cran/__linux__/focal/latest/src/contrib/SpaDES.core_1.1.0.tar.gz'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://packagemanager.rstudio.com/cran/__linux__/focal/latest/src/contrib/SpaDES.core_1.1.0.tar.gz'
In addition: Warning message:
In download.file(url, destfile, method, mode = "wb", ...) :
  URL 'https://rspm-sync.rstudio.com/bin/4.2-focal/[428](https://github.com/PredictiveEcology/Biomass_speciesData/actions/runs/3252427112/jobs/5338629347#step:7:429)ad5ba346e0b5ca56fbf85c942d0492880c1306ef36070df1ce490b2b15293.tar.gz': status was 'SSL connect error'
Warning in download.packages(pkgs, destdir = tmpd, available = available,  :
  download of package ‘SpaDES.core’ failed
trying URL 'https://packagemanager.rstudio.com/cran/__linux__/focal/latest/src/contrib/SpaDES.tools_1.0.0.tar.gz'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://packagemanager.rstudio.com/cran/__linux__/focal/latest/src/contrib/SpaDES.tools_1.0.0.tar.gz'
In addition: Warning message:
In download.file(url, destfile, method, mode = "wb", ...) :
  URL 'https://rspm-sync.rstudio.com/bin/4.2-focal/4a3ea2cd0123b232eca27250dd0bc622e898645bd67578ef535a7397aa39499f.tar.gz': status was 'SSL connect error'
Warning in download.packages(pkgs, destdir = tmpd, available = available,  :
  download of package ‘SpaDES.tools’ failed
trying URL 'https://packagemanager.rstudio.com/cran/__linux__/focal/latest/src/contrib/covr_3.6.1.tar.gz'
Content type 'binary/octet-stream' length 322914 bytes (315 KB)
==================================================

failures running in headless session

Using .plots = c("object", "png", "raw") in headless session (w/o using xvfb) fails with the following cairo graphics error:

Oct20 09:03:00 Biomass_speciesData    total elpsd: 6.2 secs | 0 Biomass_speciesData ini
2022-10-20 09:03:00 WARNING::message call unable to open connection to X11 display '' x11()
2022-10-20 09:03:00 ERROR::e: unable to start device X11cairo
 2022-10-20 09:03:00 ERROR::e: .External2(C_X11, d$display, d$width, d$height, d$pointsize, d$gamma, d$colortype, d$maxcubesize, d$bg, d$canvas, d$fonts, NA, d$xpos, d$ypos, d$title, type, antialias, d$family, optionSymbolFont(d$symbolfamily))
Error in .External2(C_X11, d$display, d$width, d$height, d$pointsize,  : 
  unable to start device X11cairo

I can presumably get around this by starting my R session using xvfb-run -a R or similar, but this imposes addional system dependencies (which user may not have ability to install) and adds an extra layer to the run requirements of this module, which impacts all LandR Biomass sims.

@CeresBarros I know I prefer cairo graphics in some cases, but are they essential here?

warnings in prepInputs

prepInputs() call on Pickell dataset generates warnings:

Warning messages:
1: In projectInputs.Raster(x = new("RasterLayer", file = new(".RasterFile",  :
  This raster layer has integer values; it will be reprojected to float. Did you want to pass 'method = "ngb"'?
2: In .getFormat(filename) :
  extension .dat is unknown. Using default format.

an on the CASFRI data generates:

Warning message: In projectInputs.Raster(x = new("RasterLayer", file = new(".RasterFile",  :   This raster layer has integer values; it will be reprojected to float. Did you want to pass 'method = "ngb"'?

objects in 'init' event aren't inputs

The following objects are created in the init event but are listed as inputs in metadata:

  • Pickell
  • CASFRIRas

They should either be moved to .inputObjects, or should be removed from metadata entirely as they are transient objects used for the creation of sim$speciesLayers.

CASFRI/kNN species names don't match

Browse[1]> uniqueKeepSp
[1] "Abie_sp"  "Pice_gla" "Pice_mar" "Pinu_sp"  "Popu_tre"
Browse[1]> sim$speciesLayers
class       : RasterBrick 
dimensions  : 727, 1070, 777890, 5  (nrow, ncol, ncell, nlayers)
resolution  : 250, 250  (x, y)
extent      : -1005571, -738070.6, 7159155, 7340905  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=lcc +lat_1=49 +lat_2=77 +lat_0=0 +lon_0=-95 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs 
data source : in memory
names       : Pine, Black.Spruce, Deciduous, Fir, White.Spruce 
min values  :    0,            0,         0,   0,            0 
max values  :  100,          100,       100, 100,          100 

see loadCASFRI() and TODO in biomassDataInit()

studyAreaLarge use in prepInputs of inputObjects

I noticed some TODOs re: which studyArea to use in the prepInputs calls. I am going to be reviewing this for borealDataPrep, so I may as well do that here too.

At the moment I believe studyArea is preferred for everything except stand age. However, some functions may require additional cropping/masking because of this (e.g., biomass may be needed at both the studyArea and studyAreaLarge extent)

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.