Code Monkey home page Code Monkey logo

Comments (9)

achubaty avatar achubaty commented on July 30, 2024

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.

achubaty avatar achubaty commented on July 30, 2024

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:

  1. paths argument
  2. spades.xxxPath
  3. if spades.xxxPath is NULL, then active directory

from spades.core.

achubaty avatar achubaty commented on July 30, 2024

@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 avatar achubaty commented on July 30, 2024

@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:

  1. paths argument
  2. spades.xxxPath
  3. 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.

achubaty avatar achubaty commented on July 30, 2024

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.

achubaty avatar achubaty commented on July 30, 2024

From @eliotmcintire on October 24, 2016 16:45

Apparently that is not persistent

from spades.core.

achubaty avatar achubaty commented on July 30, 2024

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.

achubaty avatar achubaty commented on July 30, 2024

see also https://github.com/gaborcsardi/pkgconfig

from spades.core.

eliotmcintire avatar eliotmcintire commented on July 30, 2024

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)

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.