Closed miloknowles closed 2 years ago
Thanks for this suggestion. It sounds like we need the relative path handling to work in several different situations:
I think @gailin-p was actually working on some fixes to this anyway, so probably makes sense for her to implement.
Yep, makes sense, I'll use this pattern
Currently, relative file paths are handled through the
PATH_TO_LOCAL_REPO
. However,PATH_TO_LOCAL_REPO
only works if the code that's using it is located insrc
and the user's clone of the repo has an up-to-date folder name. Issue (2) isn't a big deal but would come up if you later renamed the remote repo to something else (e.g the recent renaming). I'm mostly concerned about (1), where I'm trying to write a script that imports things from Open Grid Emissions, but it doesn't belong in your repo.I would suggest resolving paths as follows in
load_data.py
:The nice thing about this pattern is that only have to update paths in one function if the repo is ever refactored (as opposed to the many functions that have hardcoded paths right now).
@gailin-p @grgmiller happy to make this change on a branch, but I figured it might be easiest for one of you to copy-paste it in with one of you upcoming merges (if it seems ok). Let me know what you think.