Using mocha-given to test a Meteor package - meteor

I'm up and running with practicalmeteor:mocha but would like to try mocha-given. I think the way to go would be to use the browser version but I can't get it to work. I added the browser version file and included it in api.addFiles but I get ReferenceError: Given is not defined when I try to use it.

Related

Reticulate package, cannot install Python packages using py_install()

I am following the instructions here to install packages (I'm looking at the "Simple Installation") section: https://rstudio.github.io/reticulate/articles/python_packages.html
Here is my R code:
library(reticulate)
use_python(python="C:\\Users\\...\\AppData\\Local\\Programs\\Python\\Python39\\python.exe")
py_install("pandas")
However, I'm getting the following error:
Error: could not find a Python environment for
C:/Users/.../AppData/Local/Programs/Python/Python39/python.exe
How do I resolve this? I have used py_install() this way on another computer before, so I know it's possible and I would like to use it. However, I can't understand what I'm missing.
You might respond that I need to specify an environment when using py_install(), but the instructions in the link don't require that, and I know it can be done without specifying an environment every time. Do I need to somehow set a "default"?
EDIT: Just to clarify, I am on Windows.
You may not be connected to the proper environment. Depending on your OS, you will likely have to create a .Renviron file and direct R to look for it.
This post here, should help you diagnose the issue:
Unable to change Python path in reticulate

URL '/help/library/<package>/r/html/00Index.html' not found when using `devtools::load_all()`

I am using devtools::load_all as a workflow to iteratively make a package. However, I cannot seem to be able to view the package documentation using ? or help(package=package_name) until I install the package. The error I get is:
No documentation for ‘function’ in specified packages and libraries
and
URL '/help/library//r/html/00Index.html'
any suggestions on how to resolve this?
Thanks!
I guess the help(package=package_name) do nothing than open (in case of Windows) this file for you:
C:\Users\YourName\Documents\R\win-library\4.1\package_name\html\00Index.html
devtools::load_all make your latest functions available to you for testing without installing the package (i.e. the html file was not updated, and masked because it was belonged to the old version of your own package). To view your latest documentation (i.e. make a new version html), you can devtools::document() and check your package working directory \man\Functions_name.rd, OR, devtools::install() and help(package=package_name)
Just restarting r session solved my problem.

Cannot configure rgee R package properly with ee_install()

I've searched for tutorials to help configure the package in my PC, and I've found this one: https://www.youtube.com/watch?v=_fDhRL_LBdQ
I executed every part of the code interactively with the tutorial, but when I run ee_install() (after installing miniconda with py_discover_config() and other packages previously, such as reticulate), but it keeps me returning an error saying that anaconda is mandatory for the package since I'm a windows user.
Here is the error I get:
Error in ee_install_set_pyenv_env(py_env = py_env, py_path = python_path, : Windows users must install miniconda/anaconda to use rgee. The use of a Python environment is mandatory.
I've just installed Anaconda (full version with navigator) and I set a new python environment called "py2r" and tried to use the function ee_install_set_pyenv(), passing the path to the environment created through Anaconda Navigator (which has a python.exe) as paremeter to py_path and the name "py2r" as paremeter for py_env arg. And yet, it didn't work.
What am I missing?
In case you want to take a look at the code, I can provide it, but I don't think it's necessary because is a simple test script that follows as I described.
Thanks for your attention and congratulations for the library, it will be very usefull for me at work!
I fixed the ee_install() problems bypassing them and doing every passage manually. It will require no more then 10 mins and you will probably fix the installation problems. You can find and follow the manual installation with this tutorial:
https://www.youtube.com/watch?v=1-k6wNL2hlo

How to verify if atom package launched properly in atom editor

I installed linter-php and also tried to configure it in config.cson as following
"linter-php":
executablePath: "C:\xampp\php"
but I don't see any indication that something that is related to linter affects atom display. How can I verify that this package (or any package in general) is working properly when atom is running?
To answer your question: you can find all active packages by running atom.packages.activePackages in Atom's developer console.
However, your problem could be caused by providing an invalid path. Backslashes need to be escaped in CSON, so your config should look like this:
"linter-php":
executablePath: "C:\\xampp\\php"

Meteor: Random.fraction() issue

I'm getting the following error when after installing my Meteor app (developed on an older version of Meteor) on Meteor version 1.2.0.1:
ReferenceError: Random is not defined
Offending line:
Players.insert({name: names[i], score: Math.floor(Random.fraction()*10)*5});
I've never had a problem with this line of code before and according to the docs this should still work.
Any ideas?
You've got to install the random package, it's not installed by default anymore. A simple meteor add random will suffice.
Some basic packages were removed from Meteor to reduce its initial footprint. Perhaps if you run meteor add random your issue will be solved. The update process was supposed to detect your use of Random and automatically install the package but perhaps it slipped through.
If you are working inside of a package, you may need to add random#1.0.4 to your api.use().
For a list of packages that are no longer installed by default, see this link: https://quip.com/RXFlAk9Rc2xI . It also contains some other interesting notes about the update.

Resources