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

Turn the notes into a textbook (v2.0) #2

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*~
*.swp
*.pyc
.ipynb_checkpoints
45 changes: 45 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
language: generic

sudo: false

notifications:
email: false

# Only build pushes from the master branch. PRs are always built. The master
# build will also push the newly built docs to fatiando.org/dev
branches:
only:
- master

os:
- linux

env:
global:

# Build under all combinations of the of the following
matrix:
- PYTHON=3.6

before_install:
# Get Miniconda from Continuum
# Need to source the script to set the PATH variable in this environment
# (not the scripts environment)
- source ci/install-miniconda.sh
# Create a conda env to install required libraries
- conda update --yes conda
- conda create -n testenv --yes pip python=$PYTHON
- source activate testenv

install:
# Install dependencies
- conda install --yes --file requirements.txt -c conda-forge
# Show installed pkg information for postmortem diagnostic
- conda list

script:
# Build the textbook
- echo "Build textbook"

after_success:
- echo "Push HTML to dev version"
97 changes: 83 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,92 @@
# Tópicos de inversão em geofísica
# Practical inverse problems in geophysics

Por [Vanderlei C. Oliveira Jr](http://fatiando.org/people/oliveira-jr)
e [Leonardo Uieda](http://www.leouieda.com).
[Vanderlei C. Oliveira Jr](http://www.pinga-lab.org/people/oliveira-jr.html)
and
[Leonardo Uieda](http://www.leouieda.com).

Apostila sobre problemas inversos em geofísica.
This is an open-access textbook on inverse problems in Geophysics.

Baixe uma versão PDF no figshare:
[dx.doi.org/10.6084/m9.figshare.1192984](http://dx.doi.org/10.6084/m9.figshare.1192984)
**The 2.0 version is under development.**

Para citar:

> Oliveira Jr, Vanderlei C. and Uieda, Leonardo (2014): Tópicos de inversão em
> geofísica. figshare. http://dx.doi.org/10.6084/m9.figshare.1192984
> Retrieved 20:03, Oct 06, 2014 (GMT)
## Goals

The general idea is to have a short, direct, example driven book. This means
adding lots of code and practical examples to the current text we have.

We also want to make the text and code freely available on the internet
(probably under a Creative Commons license).

The idea for producing this is inspired by the [Textbook
Manifesto](http://greenteapress.com/wp/textbook-manifesto/).


## How the text book is written

We will write the text in
[reStructutredText format (rst)](http://www.sphinx-doc.org/en/stable/rest.html)
and use [sphinx](http://www.sphinx-doc.org/) to convert it to HTML, PDF, and
EPUB formats.

Some advantages:

- It's the default documentation generation system for Python projects
(including Fatiando). So there are a lot of plugins and people are familiar
with it.
- Can generate PDF, HTML and EPUB from the same source
- Writing in reStructuredText (`.rst`) and `.py` files is PR friendly
- Access to [(numbered) Latex
equations](http://www.sphinx-doc.org/pt_BR/stable/ext/math.html) and
cross-references
- Bibtex citations using [sphinx
natbib](http://wnielson.bitbucket.org/projects/sphinx-natbib/)
or [sphinxcontrib-bibtex](https://github.com/mcmtroffaes/sphinxcontrib-bibtex)
- Test code in the book using [doctest
syntax](http://www.sphinx-doc.org/pt_BR/stable/ext/doctest.html)
- Can include Code that [produces matplotlib
plots](http://matplotlib.org/sampledoc/extensions.html#inserting-matplotlib-plots)
- Sections with notebook-style text + code + images using
[sphinx-gallery](http://sphinx-gallery.readthedocs.io/en/latest/tutorials/plot_notebook.html#sphx-glr-tutorials-plot-notebook-py)
(it also automatically generates a `.ipynb` file from the input `.py` or
`.rst`)

A few disadvantages:

- Would have to write sections with code in `.py` files (no interactivity
during the development)
- Can't use some rich-text Jupyter notebook features (widgets, embedded videos,
etc)
- Would probably need to hack some plugins to do everything we want. But this
can be done only when needed.
- Will need to test if all the plugins above work well together (particularly
sphinx-gallery and sphinx-natbib).

All code in the textbook should be executed and tested with every commit using
TravisCI, just like any software project.

Deployment of the HTML and PDF versions should be automated using TravisCI as
well.


## Layout and contents

Thoughts and ideas on the layout.


## License

[![Creative Commons
License](https://i.creativecommons.org/l/by/4.0/88x31.png)](http://creativecommons.org/licenses/by/4.0/)
This work is licensed under a
[Creative Commons Attribution 4.0 International
License](http://creativecommons.org/licenses/by/4.0/).
[Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/).

You are free to:

* **Share**: copy and redistribute the material in any medium or format.
* **Adapt**: remix, transform, and build upon the material for any purpose.

As long as you:

* **Give attribution**: You must give appropriate credit, provide a link to the
license, and indicate if changes were made.
* **Share modifications under the same license (share alike)**: If you remix,
transform, or build upon the material, you must distribute your contributions
under the same license as the original.
21 changes: 21 additions & 0 deletions ci/install-miniconda.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

# To return a failure if any commands inside fail
set -e

MINICONDA_URL="http://repo.continuum.io/miniconda"

if [ "$TRAVIS_OS_NAME" == "osx" ]; then
MINICONDA_FILE=Miniconda-latest-MacOSX-x86_64.sh
export PATH=/Users/travis/miniconda2/bin:$PATH
else
MINICONDA_FILE=Miniconda-latest-Linux-x86_64.sh
export PATH=/home/travis/miniconda2/bin:$PATH
fi
wget $MINICONDA_URL/$MINICONDA_FILE -O miniconda.sh
chmod +x miniconda.sh
./miniconda.sh -b

# Workaround for https://github.com/travis-ci/travis-ci/issues/6522
# Turn off exit on failure.
set +e
12 changes: 12 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: inverse-problems
channels:
- defaults
- conda-forge
dependencies:
- python=3.6
- pip
- sphinx
- sphinx-gallery
- numpy
- scipy
- matplotlib
Binary file added images/cc-by-sa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pip
sphinx
sphinx-gallery
numpy
scipy
matplotlib