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

Simplify module installation #45

Closed
azimov opened this issue Mar 4, 2023 · 2 comments
Closed

Simplify module installation #45

azimov opened this issue Mar 4, 2023 · 2 comments

Comments

@azimov
Copy link
Collaborator

azimov commented Mar 4, 2023

Currently, developing modules is fairly painful. My workflow has been to developing on a fork and making bug fixes by creating releases, which is tedious and fraught with potential errors.

The process could be greatly simplified if we added functionality to support installation to and from disk.
I'm imagining an API similar to remotes::install_github/install.

In this context a user would download a module release by sampling executing commands like:

Strategus::install_github("OHDSI/CohortGenerator") # get latest release
Strategus::install_github("OHDSI/CohortGenerator", ref = "develop") # get development version
Strategus::install_github("OHDSI/CohortGenerator", ref = "v0.1.1") # get specific version
Strategus::install_local("./PLPWithCustomisations") # install from disk

These could then save to disk in a location that is either in the project for re-use or within some global space configurable with an environment variable.

The install process could also optionally instantiate the modules.

Form this we could also add functionality such as:

Strategus::getAvailableModules() # Returns a list of all the currently installed modules with their version numbers

I would also like to see module code somewhat isolated from the R environment so instead of:


# bad
source("https:://pathToGithubUrl/ModuleSettings.R")
createModuleSepecifications(...)

We could implement a function that returns a locally sourced environment:

# better
moduleEnv <- new.env()
source("pathToModuleSettings.R", local = moduleEnv)
< Insert simple module validation functions >
moduleEnv$createModuleSepecifications(...)

I also note that this would allow the creation of common interfaces around module settings functions instead of createCohortGeneratorModuleSpecifications it would be a common function createModuleSepecifications.

@anthonysena
Copy link
Collaborator

Linking this to #29 since they are related.

@anthonysena
Copy link
Collaborator

New refactor of module approach should address this so closing it out.

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

No branches or pull requests

2 participants