YsoSirius/shiny_windfarm

Error: argument is of length zero

Opened this issue · 4 comments

I am attempting to run the windfarmGA Shiny app locally, having cloned the repository to my desktop. I have uploaded a 20 vertex shapefile with CRS of WGS84 Lat/Lon or EPSG: 4326. I have a three row wind table in the prescribed format.

However, when I come to the "Controll and run" tab it provides me with the message "Error: argument is of length zero". The only argument in the text box that may be blank is the Topographic_Effects argument.

Note that uncommenting the following lines in the ui file under "### TERRAIN INPUTS" removes the error but I have not tested further.

selectInput(inputId="Topo_SHID", label = "Should terrain effects be taken into account, using geodata?",
                                                   choices = c(TRUE,FALSE),selected = FALSE, multiple = FALSE),

The Shiny App is already quite old and is using the first version of the optimization algorithm. I intend to rewrite the whole app and use the new version of "windfarmGA" which is mutiple times faster but is built on matrices instead of data.frames.

The terrain effect model also got quite a rewrite and it is not necessary anymore to upload an own terrain model with the new version. For the current version I had to uncomment the whole terrain model, as I was publishing the app to shinyapps.io, which could not handle the downloaded files.

For the rewrite, I will take your observation into account and test for that error.

Thank you!

Thanks for your quick reply, and for the update. Given your plans for the software, I would like to fork it and not touch the terrain model. Instead I would like to focus on adding an economic (NPV) model and calculating levelised cost of energy (LCOE). I may also try and implement a more analytical modelling method such as SVM, Neural Networks or random forests.

Will this approach clash with your rewrite, or can you incorporate into the main branch if I issue a pull request?

That sounds like a very good plan. I would certainly like to implement such features, but I guess it would make more sense at the underlying package (windfarmGA). The shinyApp is just a wrapper around it actually.

So if you want, you can fork that package too and implement it there? In the meantime I will rewrite the shinyapp so that it works fine with the newest version.

I updated the code, so that it works with the new version of the windfarmGA package.

If you worked with the old version until now, you will see a huge performance boost.

And looking through the code, the input Topo_SHID was already uncommented, because it didnt work with shinyapps.io, but I will try to fix it so it is working with this github version.