src/demo status; gm to move, other stuff?

1 view
Skip to first unread message

Bob Carpenter

unread,
Feb 19, 2012, 3:35:30 PM2/19/12
to stan...@googlegroups.com
I just removed a bunch of stuff I'd left lying
around in

stan/src/demo.

We need to move

stan/src/demo/gm.cpp

to a directory for actual Stan commands.

Here's what's left, most of which I think is
from Matt.

~/stan/src/demo>ls -1
experiment.hpp
gm.cpp (to move)
isnmf.cpp
lda.cpp
logistic_regression.cpp
logistic_regression_cauchy.cpp
model1.cpp
normal.cpp

Maybe we could

1. create a directory of models written
directly in C++

2. move the experiment (and supporting adaptive HMC
classes) to a separate directory?

- Bob

Ben Goodrich

unread,
Feb 19, 2012, 4:12:51 PM2/19/12
to stan development mailing list
On Feb 19, 3:35 pm, Bob Carpenter <c...@alias-i.com> wrote:
> I just removed a bunch of stuff I'd left lying
> around in
>
>     stan/src/demo.

Minor point of procedure with that commit:

git diff --stat 9765346^
src/demo/agrad-demo.cpp | 24 ----
src/demo/big_parser.cpp | 224
------------------------------
src/demo/bivar_norm.cpp | 95 -------------
src/demo/bugs_rats.cpp | 267
------------------------------------
src/demo/cmd_line_options.cpp | 10 --
src/demo/cvine_covar.cpp | 222
------------------------------
src/demo/dummy.cpp | 144 -------------------
src/demo/file_io.cpp | 14 --
src/demo/norm_sample.cpp | 121 ----------------
src/demo/qi_symtab.cpp | 103 --------------
src/demo/test.cpp | 5 -
src/demo/tmp.cpp | 106 --------------
src/stan/gm/command.hpp | 62 ---------
src/stan/mcmc/adaptive_sampler.hpp | 46 ++++---
src/stan/mcmc/hmc.hpp | 3 +-
src/stan/mcmc/nuts.hpp | 114 ++++++++++++----
src/stan/mcmc/sampler.hpp | 82 ++---------
17 files changed, 135 insertions(+), 1507 deletions(-)

So, a bunch of stuff under src/stan (which I think was intended to go
into the previous commit) got lumped into the commit that removed a
bunch of demos. This would be a problem if at some point in the future
someone decided they wanted to revive (or just look at) one of those
demos. That would be pretty easy to do with a

git revert 9765346

but doing so would also revert all the changes to the sampler Bob did
under src/stan .

In general, a lot of the git tools are really powerful but work at the
commit level. So, to make full use of the git tools, the commits have
to be more precise than we have been doing in the svn era.

Ben

Bob Carpenter

unread,
Feb 19, 2012, 4:41:24 PM2/19/12
to stan...@googlegroups.com
On 2/19/12 4:12 PM, Ben Goodrich wrote:
> In general, a lot of the git tools are really powerful but work at the
> commit level. So, to make full use of the git tools, the commits have
> to be more precise than we have been doing in the svn era.

Thanks for the tip.

What I didn't realize was that the commit
would work at the repository level, not at
the directory level. So there was some
other stuff changed above where I was at
that got included.

I figured things would work at the commit
level given that I now have separate control
over commit/push (which I assume is
local/repository).

I'll try to be more careful in the future and
make the commits come in functional units.

Luckily, no one's going to want the demos. I
removed old junk.

- Bob

Ben Goodrich

unread,
Feb 19, 2012, 4:59:36 PM2/19/12
to stan development mailing list
Right, contrary to svn where commit means "commit to the remote
repository", commit for git means "commit to the active local branch
only". And push pushes committed changes to the remote repository. If
you are in the root of stan, then something like this would do what
you want

git checkout master
git branch hmc_refactoring
git checkout hmc_refactoring

git rm src/demo/agrad-demo.cpp
...
git rm src/demo/tmp.cpp
git add src/demo/
git commit -m "remove some pure C++ demos"

git add src/stan/
git commit -m "finish refactoring the HMC code"

git checkout master
git merge hmc_refactoring
git push origin master

Ben
Reply all
Reply to author
Forward
0 new messages