Comments (9)
From @eliotmcintire on October 24, 2016 16:23
@achubaty Current behaviour doesn't seem desireable:
After setPaths(modules = "desired/path"), paths are set correctly, but do not persist through restart.
from spades.core.
From @eliotmcintire on October 24, 2016 16:28
@achubaty Also, in simInit
, any path not specified by user and passed explicitly to paths =
arg defaults to active directly, which is not the correct behaviour. I think the correct behaviour is to have spades paths override the active directory.
Order of precedence in the simInit
should be, from highest to lowest:
- paths argument
- spades.xxxPath
- if spades.xxxPath is NULL, then active directory
from spades.core.
@eliotmcintire yes, I noted that above. R options (the non-standard ones at least) are not persistent across sessions. Aside from updating all of our docs to teach setting the paths after loading the package, per above, how else can we improve this? Using the current working directory (as we had done previously) is also undesirable.
from spades.core.
@achubaty Also, in
simInit
, any path not specified by user and passed explicitly topaths =
arg defaults to active directly, which is not the correct behaviour. I think the correct behaviour is to have spades paths override the active directory.Order of precedence in the
simInit
should be, from highest to lowest:
- paths argument
- spades.xxxPath
- if spades.xxxPath is NULL, then active directory
Hmm, I'm not sure why it's defaulting to the current dir. Sounds like the paths set by the options weren't fully implemented everywhere. I'll take a look.
from spades.core.
From @eliotmcintire on October 24, 2016 16:37
What about wrapping this in the setPaths() function:
assignInNamespace(ns = "SpaDES", x = ".defaultPaths", value = paths)
Then, instead of using options, we are actually using the SpaDES namespace. I think that is allowed because it is a SpaDSE function that is doing it. Then, instead of using "options", we just use an object called SpaDES:::.defaultPaths
That seems to be persistent, at least on Windows. There may be issues on Linux if the package was installed by someone other than the user.
from spades.core.
From @eliotmcintire on October 24, 2016 16:45
Apparently that is not persistent
from spades.core.
Yes, that might work -- when the namespace is reloaded does it keep those values?
Another option is to read/write from/to an options file, but it's not clear where this should be saved. Using the home dir in this case might be fine because the write operation would be invoked only by the user using setPaths()
.
from spades.core.
see also https://github.com/gaborcsardi/pkgconfig
from spades.core.
Now fully revamped, removing spades.cachePath
7e82ccf and allowing multiple modulePath
values 2ee5f26.
Also, during simInit
and spades
calls, the 4 paths are set in the options are using setPaths
, then reset to former options on.exit
from both of these.
from spades.core.
Related Issues (20)
- improved module code checks HOT 3
- reqdPkgs issue in new module template
- Release SpaDES.core 2.0.2 HOT 2
- saveSimList() doesn't respect option 'reproducible.tempPath'
- update tests based on changes in reproducible HOT 1
- Require::getPkgVersions() removed upstream HOT 4
- deprecate `.PlotInitialTime` argument in spades()
- Error "object ‘file.move’ is not exported by 'namespace:reproducible'" when installing the package HOT 2
- simulation caching issues in tests HOT 3
- sporadic download failures triggering test failure HOT 4
- don't install packages during tests HOT 3
- Enable passing new `sourceURL`s to metadata
- New feature idea/request: cross-module, project-contained, functions HOT 8
- error when saving several objects with ``saveFiles()`` and ``.saveObjects`` HOT 3
- Use `ggplotify` in Plots to plot non-ggplot graphics HOT 1
- newModule() should create NEWS.md file
- fix additional issues with noSuggests CRAN checks HOT 2
- use consistent per-module paths for output figures HOT 2
- `newModule` is failing when SpaDES.core isn't loaded HOT 2
- `spades` not caching properly. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spades.core.