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

Storing remake files in mutiple directories #180

Open
tcholewik opened this issue Nov 9, 2017 · 2 comments
Open

Storing remake files in mutiple directories #180

tcholewik opened this issue Nov 9, 2017 · 2 comments

Comments

@tcholewik
Copy link

tcholewik commented Nov 9, 2017

I'm not sure I'm doing things correctly so correct me if I'm wrong.
Remake wants you to store all of remake files in your project root directory.

having ./.remake.yml that includes another remake file in a different directory is not allowed.
Example:

include:
  - ./src/remake.yml
  - ./../remake.yml

If so is anyone planning to enable such setup?

I can think of two reasons why this is a good idea.

Organize code better

When dealing with large amounts of source code developer is likely to organize it into subdirectories like:
./src/import
./src/features
./src/sampling
./src/models

If each one of those directories stores targets to be made then it would be convenient to store remake files in same directories. Currently, my workaround has been either using a comment in remake to deliminate different targets types/sections, and/or splitting makefile into smaller ones that mimic folder structure.

So my project would look like:
./src/import
./src/features
./src/sampling
./src/models
./.remake_src_import
./.remake_src_features
./.remake_src_sampling
./.remake_src_models

But this can grow very big, and it clutter root directory of your project

Integrate remake with tools that set their own root directory

R Notebooks force working directory to be the same as the directory they are located in.
Consequentially to use remake in a chunk, all notebooks need to live in the same directory as remake, which is messy. I have to admit that in case of rmarkdown & knitr packages workarounds exist but they are not great.

FYI the reason why I was trying to use remake in R Notebook was to load that already had been compiled by remake's target.

@wlandau-lilly
Copy link

wlandau-lilly commented Nov 9, 2017

@sgp667 have you tried remakeGenerator? It's a front-end to remake for generating YAML files. You could create a data frame for each piece of your workflow, then rbind() them all together and use the result to generate a single remake.yml file. It is not the modularity you were looking for, but it is still modularity.

@tcholewik
Copy link
Author

tcholewik commented Nov 10, 2017

Hi Will, I have not.
However as far as I can tell I can keep those scripts anywhere and compile one remake file at the project root. I'll give it a try.

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