gentzkow / GentzkowLabTemplate

MIT License
0 stars 2 forks source link

Create framework to handle external inputs #20

Open lucamlouzada opened 1 week ago

lucamlouzada commented 1 week ago

This issue is part of an effort to implement substantive improvements to the lab template, as discussed in https://github.com/gentzkow/GentzkowLabTemplate/issues/16.

In this issue, the goal is to work on the way the template handles external paths for inputs. The main points to be addressed per the decision in plans for next steps are:

To achieve this, I will need to

  1. Investigate how to let shell scripts to read local_env.sh files to recognize the path in a robust way.
  2. See how bash handles complex objects to understand how to attribute global variables in a similar way done by .yaml
  3. If changes are possible, implement them in the best way possible
  4. Work on unit tests after implementation

I am assigning myself to work on this.

lucamlouzada commented 1 week ago

I have pushed two commits that introduce the framework for externals. It is quite straightforward:

The idea is that make_externals.sh will be called by make.sh in each module that requires external links. It is therefore necessary to modify make.sh to reflect these changes. The changes in make.sh should look as follows:

+ # Optional: Create external symlinks
+ # Uncomment the following line if you need to handle external paths
+ # source "${REPO_ROOT}/lib/shell/make_externals.sh"

These three lines could be added right after the lines that copy other source files for inputs.

I have not pushed these modifications to make.sh yet because I want to avoid conflicts with the changes in make.sh made in #19.

If this framework is approved, I believe we would also have to change the local_env.sh file in the root of the template repository. Which raises the question - should we even have such a file? I am thinking whether we should delete this from the Github template repository as it is already created by check_setup.sh anyway.