ericagol / TRAPPIST1_Spitzer

TRAPPIST-1 TTVs and Spitzer photodynamics
MIT License
10 stars 7 forks source link

Autogeneration on Travis CI #6

Closed rodluger closed 4 years ago

rodluger commented 4 years ago

This PR adds functionality to autogenerate the LaTeX PDF on Travis CI with every commit and adds links to the figure scripts next to each figure caption.

Currently, I'm running everything on my Travis account, since I'm the owner of the fork. Once you merge this PR, you'll have to set up CI with your own travis-ci.com account. You'll also need to define the following three environment variables for the TRAPPIST1_Spitzer project:

The first one is just your username: ericagol. The second one is your personal access token for GitHub (create one here and make sure you give it repo permissions). The last one is the file ID for the dataset you uploaded to Google Drive (get it from the link you sent me: it's the hash 14i...fLo). Make sure the last two environment variables are hidden (i.e., make sure DISPLAY VALUE IN BUILD LOG is disabled).

@ericagol I'm happy to help you out with this step -- we can Skype this morning if you'd like.

Currently, things are set up so that the script tries to generate all figures on-the-fly. If there isn't a script to generate the figure, or if that script fails to run, it will insert an image that says Figure failed to compile in the LaTeX document. It looks like there's at least one figure you don't have a script for, so I added an option to --use-static-figures instead (just add that to your commit message). If that option is enabled, the script will populate missing figures with the static versions, which I moved to tex/figures/static.

The auto-generated pdf is pushed to the master-pdf branch. As before, you can add the option --keep-figures to your commit message to also push all figures.

Finally, the figure links in the manuscript are blue if everything's okay, but they are red if I couldn't find the script that generated them (there are a couple).

CURRENT ISSUES:

You can check out the current pdf here.

ericagol commented 4 years ago

Thanks @rodluger, this is great! There appears to be an extra "https://github.com/" pre-pended to the links for each figure. For example, if I click on the link in the second figure in the current PDF, it takes me to the URL:

https://github.com/https://github.com/ericagol/TRAPPIST1_Spitzer/blob/master/tex/figures/julia/plot_ttv_4panel_stacked.jl

This should be easy to fix.

rodluger commented 4 years ago

Good catch! I fixed it.