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

Alter Getting Started and DPS Tutorial conda env recommendations #409

Open
rtapella opened this issue Jul 3, 2024 · 2 comments
Open

Alter Getting Started and DPS Tutorial conda env recommendations #409

rtapella opened this issue Jul 3, 2024 · 2 comments
Assignees
Milestone

Comments

@rtapella
Copy link
Collaborator

rtapella commented Jul 3, 2024

  • we want to prep scientists to be totally explicit with which packages are needed in a DPS algorithm
  • eventually we will move to a "minimal" base environment in DPS, so the conda env needs to be full
@wildintellect
Copy link
Collaborator

wildintellect commented Aug 2, 2024

There are some tips and tricks to this.

  1. Add any package you import (python) or library (R) to the list
  2. we're looking into ways to scan your code for things you might miss
  3. Adv. use conda lock files for better performance long term
  4. Version pin/lock the most critical package (and put those at the top)

For R here's a little python code to take your list of package installs and scan conda for matches by adding a prefix of r-

# using a python notebook - we can also make an R variant
pkgs = ['sys', 'askpass', 'pkgbuild', 'rprojroot', 'diffobj', 'rematch2', 'curl', 'jsonlite', 'mime', 'openssl', 'base64enc', 'brio', 'callr', 'desc', 'evaluate', 'pkgload', 'praise', 'processx', 'ps', 'waldo', 'prettyunits', 'fs', 'httr', 'purrr', 'aws.signature', 'digest', 'testthat']
rpkgs = [f"r-{item}"for item in pkgs]
print(rpkgs)
# then notebook shell
!conda install -c conda-forge {" ".join(rpkgs)}
#once you have your list format it for the conda yml file
for item in rpkgs:
    print(f"\t- {item}")

Note: some R packages will require the use of install.R instead of conda
Here's an example:

@rtapella
Copy link
Collaborator Author

I think this should be expanded into its own section with the other conda/environment docs.

For now I am updating some mentions of setting up requirements.txt/conda

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

2 participants