ietoolkit
ietoolkit copied to clipboard
new command : add custom folders to project folder after setting it up with iefolder
iefolder
wont be able to satisfy all projects specific need of folders, so @gbedoyaWB suggested a command where teams can specify additional folders that they want in each round folder in the the DataWork folder.
This command wont update the master do-files which makes it much simpler and can therefore easily be made much more dynamic.
Let's discuss some specifications and then we can start working on that when version 1.0 of iefieldkit is out.
Not sure I understand what this command should do. If it will not add the folders to the master, why is a Stata command needed to do it, as opposed to creating it manually?
To simplify standardization. Let's say a team decides for 5 folders they want in each round added by iefolder. Then this command would be set up to be run directly after each time iefolder new round ...
is used, and if the same code is recycled then it will guarantee that the same 5 folders are set up the same way each time.
Hi Luiza:
Basically, to help standardization and to facilitate user-based customization with standardization.
- To illustrate this, if you have 4 or more projects and each one has 3-4 sub-folders with the same structure, it’d be very easy to make mistakes or lose standardization trying to create this manually.
- It will also help add some flexibility since it can be used as a layer for user customization but keeping the format. Just as an example for the “Output” folder we’d like to customize subfolders including “Tables,” “Figures,” “Maps” but we are thinking of doing something similar to the “Documentation” subfolder and others, which will help a lot, particularly for complex projects. Hope this helps but happy to explain better in person.
Thanks!
Lupe
Got it! That makes sense -- now that I think about it, I've been doing this manually as well and it's very likely that each project has a different folder name.
Yeah it would be nice -- I am having trouble thinking about how to write the folder structure syntax in Stata however...
I was thinking that the command should follow the syntax of iefolder
as much as possible. Let's say we call this command iefolderadd
. Then that command can take the sub-command round and unitofobs. Then for each sub-command there is a list of allowed options that corresponds to the folders that iefolder
creates for round and unitofobs respectively. So using @gbedoyaWB 's example it could look like this:
iefolderadd round , output(Tables, Figures, Maps)
With this syntax you could also add sub-folders like this:
iefolderadd round , output(Tables\Raw, Tables\Formatted, Figures, Maps)
But I have not started to implement this yet so there might be a reason why it should be done differently.
@gbedoyaWB , I wrote a sketch for this command now. The first thing I want to implement is the format on which the use, i.e. you, would specify which folders you want. Would you mind take a look on what I have done so far and let me know if you think that would work well?
I can pop over and show you if you prefer, just want to make sure it is also documented for anyone else following this thread.
Many thanks!
*create new round folder as usual with iefolder
iefolder new round Baseline, proj("$proj_folder")
**Add folders Maps, Tables, Figures to the already existing
* folder Baseline/Output/Final with ieaddfolder
ieaddfolder round Baseline, proj("$proj_folder") folders("Output/Final:Maps, Tables, Figures")
If you want to create folders in multiple locations you can do this (the line with iefolder
is omitted but it works the same as in the example above):
*Define folders to create in folder Baseline/Output/Raw
local rawOutput = "Output/Raw:Maps, Tables, Figures"
*Define folders to create in folder Baseline/Output/Final
local finOutput = "Output/Final:Maps, Tables, Figures"
**Combine the two inputs separated with a "&", so that
* the folders Maps, Tables, Figures are created in both
* Baseline/Output/Raw and Baseline/Output/Final
ieaddfolder round Baseline, proj("$proj_folder") folders("`rawOutputs' & `finOutputs'")
And if you want to create folders with subfolders, then you can do this (same as last example, but the Tables folder has two sub-folders, Regression and Summary Statistics):
*Define folders to create in folder Baseline/Output/Raw
local rawOutput = "Output/Raw:Maps, Tables/Regressions, Tables/Summary Statistics, Figures"
*Define folders to create in folder Baseline/Output/Final
local finOutput = "Output/Final:Maps, Tables/Regressions, Tables/Summary Statistics, Figures"
**Combine the two inputs separated with a "&", so that
* the folders Maps, Tables (with sub-folders Regressions
* and Summary Statistics), Figures are created in both
* Baseline/Output/Raw and Baseline/Output/Final
ieaddfolder round Baseline, proj("$proj_folder") folders("`rawOutputs' & `finOutputs'")