datamade / data-analysis-guidelines

📒 Analyzing Data, the DataMade Way
MIT License
36 stars 4 forks source link

for multi-part analyses, figure out a pattern to set up an environment once, and import it to all pweave files #14

Open hancush opened 6 years ago

hancush commented 6 years ago

i've tried a setup.py file in the analyses/ dir, as well as an environment module. both led to weird import problems when compiling the analysis versus developing in atom.

hancush commented 6 years ago

the solution:

add a startup.py file to your analyses/ dir, then export PYTHONPATH=.:$PYTHONPATH in the command line. this will allow you to do

from analyses.startup import *

at the top of each of your analysis files, and make sure Make executes the python correctly when you run your build