Skip to content

Commit

Permalink
Pull request for #28: Command Line argument example (#31)
Browse files Browse the repository at this point in the history
* gslab-econ/gslab-python#26 Demonstrates using CL args

* More edits/testing

* Removes gslab_scons1 and edits SConstruct

* #28 Implements PR

* gslab_python#26 Removes print statement

* #28 Fixes spacing
  • Loading branch information
lboxell authored Jan 26, 2017
1 parent c6ea2e5 commit 895f2dc
Show file tree
Hide file tree
Showing 13 changed files with 84 additions and 99 deletions.
Binary file modified .sconsign.dblite
Binary file not shown.
Binary file modified release/paper/ondeck.pdf
Binary file not shown.
Binary file modified release/paper/online_appendix.pdf
Binary file not shown.
Binary file modified release/paper/paper.pdf
Binary file not shown.
4 changes: 2 additions & 2 deletions release/paper/sconscript.log
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Log created: 2017-01-26 10:03:03
Log completed: 2017-01-26 10:03:13
Log created: 2017-01-26 11:25:52
Log completed: 2017-01-26 11:25:55

This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016) (preloaded format=pdflatex)
restricted \write18 enabled.
Expand Down
Binary file modified release/paper/text.pdf
Binary file not shown.
9 changes: 2 additions & 7 deletions release/talk/sconscript.log
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
<<<<<<< HEAD
Log created: 2017-01-25 09:59:47
Log completed: 2017-01-25 09:59:48
=======
Log created: 2017-01-24 14:45:35
Log completed: 2017-01-24 14:45:36
>>>>>>> origin/master
Log created: 2017-01-26 11:25:55
Log completed: 2017-01-26 11:25:58

This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016) (preloaded format=pdflatex)
restricted \write18 enabled.
Expand Down
Binary file modified release/talk/slides.pdf
Binary file not shown.
4 changes: 2 additions & 2 deletions sconstruct.log
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
scons: done reading SConscript files.
scons: Building targets ...
build_lyx(["build/paper/paper.pdf"], ["source/paper/paper.lyx"])
Install directory: "build/paper" as "release/paper"
build_r(["build/data/data.txt"], ["source/data/build.R"])
scons: `release' is up to date.
state_of_repo(["state_of_repo.log"], [])
scons: done building targets.
2 changes: 1 addition & 1 deletion source/analysis/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ Import('env')
env.BuildStata(target = ['#build/analysis/plot.eps',
'#build/analysis/table.txt'],
source = ['#source/analysis/analysis.do',
'#build/data/data.txt'])
'#build/data/data.txt'])
8 changes: 6 additions & 2 deletions source/data/SConscript
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
Import('env')

env.BuildR(target = ['#build/data/data.txt'],
source = ['#source/data/build.R'])

source = 'build.R'
target_name = 'data'
target = ['#build/data/%s.txt' % target_name]
env.BuildR(target, source, CL_ARG=target_name) # Demonstrates using command line arguments

11 changes: 8 additions & 3 deletions source/data/build.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
set.seed(1)
x <- sample(1:10, 1000, replace = T)
write.table(x, "build/data/data.txt", sep = "|", row.names = FALSE, col.names = TRUE, quote = FALSE)
args = commandArgs(TRUE)
main <- function(i){
x <- seq(-10, 10, 0.1)
write.table(x, sprintf("build/data/%s.txt", i), sep = "|",
row.names = FALSE, col.names = TRUE, quote = FALSE)
}

main(args[1])
145 changes: 63 additions & 82 deletions state_of_repo.log
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,18 @@ as it can be edited after state_of_repo.log finishes running
===================================
Last commit:

commit 9aaf930013e41fe2509e2b69990d2acd6cb6c08e
commit a56cf683aec56bc6563271d1e014afd96b5a20fb
Merge: d774788 c6ea2e5
Author: Levi Boxell <leviboxell@gmail.com>
Date: Thu Jan 26 10:00:21 2017 -0800
Date: Thu Jan 26 11:26:17 2017 -0800

gslab-python#34 Re-runs after small edits
#28 Merges master


Files changed since last commit:

.sconsign.dblite
SConstruct
SConstruct
release/paper/ondeck.pdf
release/paper/ondeck.pdf
release/paper/online_appendix.pdf
release/paper/online_appendix.pdf
release/paper/paper.pdf
release/paper/paper.pdf
release/paper/sconscript.log
release/paper/sconscript.log
release/paper/text.pdf
release/paper/text.pdf
release/talk/sconscript.log
release/talk/sconscript.log
release/talk/slides.pdf
release/talk/slides.pdf
sconstruct.log
setup.py
source/data/build.R
state_of_repo.log

===================================
Expand All @@ -44,128 +28,125 @@ state_of_repo.log

===================================
./README.md:
modified on: 26 Jan 2017 10:02:15
modified on: 26 Jan 2017 11:25:16
size of file: 3289
./SConstruct:
modified on: 26 Jan 2017 10:02:43
modified on: 26 Jan 2017 11:25:16
size of file: 2812
./sconstruct.log:
modified on: 26 Jan 2017 10:03:03
modified on: 26 Jan 2017 12:01:40
size of file: 0
./setup.py:
modified on: 26 Jan 2017 10:03:00
modified on: 26 Jan 2017 11:25:16
size of file: 3296
./setup.pyc:
modified on: 26 Jan 2017 10:03:02
modified on: 26 Jan 2017 11:25:50
size of file: 4304
./state_of_repo.log:
modified on: 26 Jan 2017 10:03:13
size of file: 893
modified on: 26 Jan 2017 12:01:42
size of file: 490
./build/analysis/plot.eps:
modified on: 25 Jan 2017 17:24:44
size of file: 12268
modified on: 26 Jan 2017 11:24:10
size of file: 12829
./build/analysis/sconscript.log:
modified on: 25 Jan 2017 17:24:44
modified on: 26 Jan 2017 11:24:10
size of file: 2049
./build/analysis/table.txt:
modified on: 25 Jan 2017 17:24:44
size of file: 32
modified on: 26 Jan 2017 11:24:10
size of file: 30
./build/data/data.txt:
modified on: 25 Jan 2017 17:24:43
size of file: 2112
modified on: 26 Jan 2017 12:01:41
size of file: 1035
./build/data/sconscript.log:
modified on: 25 Jan 2017 17:24:43
size of file: 1000
modified on: 26 Jan 2017 12:01:41
size of file: 1089
./build/paper/ondeck.pdf:
modified on: 25 Jan 2017 09:59:44
size of file: 18662
modified on: 26 Jan 2017 11:24:12
size of file: 18645
./build/paper/online_appendix.pdf:
modified on: 25 Jan 2017 09:59:45
modified on: 26 Jan 2017 11:24:14
size of file: 45652
./build/paper/paper.pdf:
modified on: 26 Jan 2017 10:03:12
size of file: 58048
modified on: 26 Jan 2017 11:25:55
size of file: 58290
./build/paper/sconscript.log:
modified on: 26 Jan 2017 10:03:13
modified on: 26 Jan 2017 11:25:55
size of file: 562
./build/paper/text.pdf:
modified on: 25 Jan 2017 09:59:47
size of file: 18662
modified on: 26 Jan 2017 11:24:45
size of file: 18645
./build/tables/table.lyx:
modified on: 25 Jan 2017 13:41:42
modified on: 26 Jan 2017 11:25:52
size of file: 4432
./build/talk/sconscript.log:
modified on: 25 Jan 2017 13:41:48
modified on: 26 Jan 2017 11:25:58
size of file: 564
./build/talk/slides.pdf:
modified on: 25 Jan 2017 13:41:48
size of file: 28987
modified on: 26 Jan 2017 11:25:58
size of file: 28986
./release/paper/ondeck.pdf:
modified on: 25 Jan 2017 09:59:44
size of file: 18662
modified on: 26 Jan 2017 11:24:12
size of file: 18645
./release/paper/online_appendix.pdf:
modified on: 25 Jan 2017 09:59:45
modified on: 26 Jan 2017 11:24:14
size of file: 45652
./release/paper/paper.pdf:
modified on: 26 Jan 2017 10:03:12
size of file: 58048
modified on: 26 Jan 2017 11:25:55
size of file: 58290
./release/paper/sconscript.log:
modified on: 26 Jan 2017 10:03:13
modified on: 26 Jan 2017 11:25:55
size of file: 562
./release/paper/text.pdf:
modified on: 25 Jan 2017 09:59:47
size of file: 18662
modified on: 26 Jan 2017 11:24:45
size of file: 18645
./release/talk/sconscript.log:
modified on: 26 Jan 2017 10:02:16
size of file: 679
modified on: 26 Jan 2017 11:25:58
size of file: 564
./release/talk/slides.pdf:
modified on: 26 Jan 2017 10:02:16
size of file: 260
modified on: 26 Jan 2017 11:25:58
size of file: 28986
./source/analysis/analysis.do:
modified on: 25 Jan 2017 11:00:13
modified on: 26 Jan 2017 11:23:54
size of file: 443
./source/analysis/SConscript:
modified on: 25 Jan 2017 13:03:22
size of file: 229
modified on: 26 Jan 2017 11:23:54
size of file: 230
./source/data/build.R:
modified on: 25 Jan 2017 13:03:22
size of file: 150
modified on: 26 Jan 2017 12:01:12
size of file: 229
./source/data/SConscript:
modified on: 25 Jan 2017 13:03:22
size of file: 106
modified on: 26 Jan 2017 11:23:54
size of file: 194
./source/figures/figure.lyx:
modified on: 26 Jan 2017 10:02:15
modified on: 26 Jan 2017 11:25:16
size of file: 2223
./source/paper/ondeck.lyx:
modified on: 25 Jan 2017 08:44:14
modified on: 26 Jan 2017 11:23:54
size of file: 2522
./source/paper/online_appendix.lyx:
modified on: 25 Jan 2017 08:44:14
modified on: 26 Jan 2017 11:23:54
size of file: 3610
./source/paper/paper.lyx:
modified on: 25 Jan 2017 08:44:14
modified on: 26 Jan 2017 11:23:54
size of file: 5236
./source/paper/SConscript:
modified on: 26 Jan 2017 10:02:15
modified on: 26 Jan 2017 11:25:16
size of file: 486
./source/paper/text.lyx:
modified on: 25 Jan 2017 08:44:14
modified on: 26 Jan 2017 11:23:54
size of file: 2522
./source/raw/README.md:
modified on: 25 Jan 2017 08:44:14
modified on: 26 Jan 2017 11:23:54
size of file: 101
./source/tables/SConscript:
modified on: 25 Jan 2017 08:44:14
modified on: 26 Jan 2017 11:23:54
size of file: 172
./source/tables/table.lyx:
modified on: 25 Jan 2017 08:44:14
modified on: 26 Jan 2017 11:23:54
size of file: 4082
./source/tables/table.lyx~:
modified on: 24 Jan 2017 18:18:13
size of file: 4083
./source/talk/SConscript:
modified on: 26 Jan 2017 10:02:15
modified on: 26 Jan 2017 11:25:16
size of file: 156
./source/talk/slides.lyx:
modified on: 25 Jan 2017 08:44:14
modified on: 26 Jan 2017 11:23:54
size of file: 4712

0 comments on commit 895f2dc

Please sign in to comment.