|
| 1 | + |
| 2 | +# Template for contribution to Computo for Python users |
| 3 | + |
| 4 | +[](https://computorg.github.io/template-computo-python/) |
| 5 | + |
| 6 | +Documentation and sample of a simple `Python`-based submission for the [Computo journal](https://computorg.github.io), using our Quarto-based template and `venv` for handling dependencies. |
| 7 | + |
| 8 | +Shows how to automatically setup and build the HTML and PDF outputs, ready to submit to our peer-review platform. |
| 9 | + |
| 10 | +Additional details can be found [in the template manuscript](https://computo.sfds.asso.fr/template-computo-python). |
| 11 | + |
| 12 | + ## Process overview |
| 13 | + |
| 14 | +Submissions to [Computo](https://computorg.github.io) require both scientific content (typically equations, codes and figures, data) and a proof that this content is reproducible. This is achieved by means of i) a notebook system, ii) a virtual environment fixing the dependencies and iii) continuous integration (plus, if needed, an external website to store large data files such a [Zenodo](https://zenodo.org/) or [OSF](https://osf.io/) ). |
| 15 | + |
| 16 | +A Computo submission is thus a git(hub) repository like this one containing |
| 17 | + |
| 18 | +- the source files of the notebook (a quarto .qmd file + a BibTeX .bib file + some statics files, _e.g._ figures or small .csv data tables) |
| 19 | +- configuration files to set up the dependencies in a virtual environment |
| 20 | +- configuration files to set up the continuous integration rendering the final documents |
| 21 | + |
| 22 | +In this template, we focus on `R` users and detail a solution based on |
| 23 | + |
| 24 | +- The `Jupyter` kernel of Quarto for rendering the document, |
| 25 | +- The `venv` Python built system for setting the virtual environment, |
| 26 | +- Github actions for handling the continuous integration. |
| 27 | + |
| 28 | +## Step-by-step procedure |
| 29 | + |
| 30 | +### Step 0: setup a git repository |
| 31 | + |
| 32 | +Use this repository as a template via the "use this template" button on the top of this page. |
| 33 | + |
| 34 | +**Note**: _You can use Gitlab for submitting for Computo. We hope giving more support in the future._ |
| 35 | + |
| 36 | +### Step 1. setup Quarto and Computo extension on your system |
| 37 | + |
| 38 | +You need [quarto](https://quarto.org/) installed on your computer, as well as the [Computo extension](https://github.com/computorg/computo-quarto-extension) to prepare your document. |
| 39 | +The latter can be installed as follows: |
| 40 | + |
| 41 | +```.bash |
| 42 | +quarto add computorg/computo-quarto-extension |
| 43 | +``` |
| 44 | + |
| 45 | +### Step 2. write your contribution |
| 46 | + |
| 47 | +Write your notebook as usual, [as demonstrated in the `template-computo-python.qmd` sample](https://computorg.github.io/template-computo-python/). |
| 48 | + |
| 49 | +**Note**: _Make sure that you are able to build your manuscript as a standard notebook on your system before proceeding to the next step._ |
| 50 | + |
| 51 | +### Step 3: setup dependencies with `venv` |
| 52 | + |
| 53 | +Use the [`venv` package manager](https://cewing.github.io/training.python_web/html/presentations/venv_intro.html) to setup a reproducible environment handling your `Python` dependencies. |
| 54 | + |
| 55 | +### Step 4: proof reproducibility |
| 56 | + |
| 57 | +Put everything together and check that your work is indeed reproducible. To this end, you need to rely on a github action, whose default is pre-configured and found here: [.github/workflows/build_n_publish.yml](https://github.com/computorg/template-computo-R/blob/main/.github/workflows/build_n_publish.yml) |
| 58 | + |
| 59 | +This action will |
| 60 | + |
| 61 | +1. Check out repository on the ubuntu-latest machine |
| 62 | +2. Install quarto and dependencies, including the Computo extension for Quarto |
| 63 | +4. Install Python dependencies with `pip` and `venv`, using your `requirements.txt` file |
| 64 | +5. Render your .qmd file and Publish the results on a gh-page (both HTML and PDF) |
| 65 | + |
| 66 | +**Note**: _Gitlab CI can be used to obtained similar results._ |
| 67 | + |
| 68 | +### Step 5. submit |
| 69 | + |
| 70 | +Once step 4 is successful, you should end up with an HTML version published as a gh-page, as well as a PDF version (see "Other format" at the end of the table of content of the rendered HTML). This PDF version can be submitted to the [Computo submission platform](https://computo.scholasticahq.com/): |
| 71 | + |
| 72 | +<div id="scholastica-submission-button" style="margin-top: 10px; margin-bottom: 10px;"><a href="https://computo.scholasticahq.com/for-authors" style="outline: none; border: none;"><img style="outline: none; border: none;" src="https://s3.amazonaws.com/docs.scholastica/law-review-submission-button/submit_via_scholastica.png" alt="Submit to Computo"></a></div> |
0 commit comments