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

Either documentation or default is wrong: newModule() #273

Closed
tati-micheletti opened this issue Apr 11, 2024 · 2 comments
Closed

Either documentation or default is wrong: newModule() #273

tati-micheletti opened this issue Apr 11, 2024 · 2 comments
Assignees

Comments

@tati-micheletti
Copy link
Contributor

Documentation of newModule says:

path Character string. Subdirectory in which to place the new module code file. The default is the current working directory.

However, when creating a new module the default path is actually the cache path

> getwd()
[1] "C:/Users/Tati/Documents/GitHub/EFI_webinar"
> SpaDES.core::newModule("testModule")
New module testModule created at C:/Users/Tati/Documents/GitHub/NWT/cache/tmp/RtmpqWw5f7/SpaDES/modules
(...)
> SpaDES.core::getPaths()
$cachePath
[1] "C:/Users/Tati/Documents/GitHub/NWT/cache/tmp\\RtmpqWw5f7/reproducible/cache"
(...)

In my opinion, the documentation expresses the correct behavior, and the module should be created in the current working directory, except if this would break any further functionalities (which I don't believe, but who knows)

@tati-micheletti tati-micheletti changed the title Either documentation or default is wrong Either documentation or default is wrong: newModule() Apr 11, 2024
@achubaty
Copy link
Contributor

thanks for spotting this. it's using getOption("spades.modulePath") as the default, which is initialized to a random temp directory.

@achubaty achubaty self-assigned this Apr 11, 2024
@eliotmcintire
Copy link
Contributor

I remember this conversation a while ago. I agree with @tati-micheletti . The default should not be random, but current directory. When it is random, the user can easily, accidentally, lose their work without realizing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants