https://github.com/ci-for-research/example-python-monte-carlo-pi

Continuous Integration and Continuous developement for scientific applications

https://github.com/ci-for-research/example-python-monte-carlo-pi

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.6%) to scientific vocabulary

Keywords

continuous-integration python science-research tutorial
Last synced: 5 months ago · JSON representation

Repository

Continuous Integration and Continuous developement for scientific applications

Basic Info
  • Host: GitHub
  • Owner: ci-for-research
  • License: apache-2.0
  • Language: Python
  • Default Branch: master
  • Size: 185 KB
Statistics
  • Stars: 10
  • Watchers: 3
  • Forks: 13
  • Open Issues: 1
  • Releases: 0
Topics
continuous-integration python science-research tutorial
Created about 6 years ago · Last pushed almost 6 years ago
Metadata Files
Readme Changelog Contributing License Code of conduct

README.rst

.. image:: https://travis-ci.com/NLESC-JCER/ci_for_science.svg?branch=master
    :target: https://travis-ci.com/NLESC-JCER/ci_for_science
.. image:: https://github.com/NLESC-JCER/ci_for_science/workflows/build%20with%20conda/badge.svg
    :target: https://github.com/NLESC-JCER/ci_for_science/actions
.. image:: https://gitlab.com/nlesc-jcer/ci_for_science/badges/master/pipeline.svg
    :target: https://gitlab.com/nlesc-jcer/ci_for_science/badges/master/pipeline.svg

################################################################################
👩‍🚀 📡 🔬 Continuous Integration for Scientific Applications
################################################################################
This repository contains a brief example of Continuous integration for scientific applications,
using miniconda_ and Python3.

Overview
********
`Continuous Integration `_ (**CI**) helps to automate the testing and delivery of scientific software tools. A **CI** is just a workflow that runs automatically 🤖 as a result of a certain action
taken in the source code (e.g. a push, pull-request, etc.).

This repository contains 3 different configuration files for *Github Actions*, *Travis* and *Gitlab CI*. These configuration files encode the actions to perform with the code on a given architecture, like installing the library from scratch in a Ubuntu machine.

###########################
🛠️ Setting up a CI workflow
###########################

|octocat| GitHub actions
************************
The *Github actions* configuration can be found at `Python actions file <.github/workflows/pythonapp.yml>`_. There is comprehensive documentation of what `Github actions`_ are and how to use them.

.. |octocat| raw:: html

   

|Travis| Travis CI
******************
The `Travis configuration file <.travis.yml>`_ contains the configuration to call a **CI** workflow using *Travis*. See `Travis tutorial`_.

.. |Travis| raw:: html

   

|gitlab| GitLab CI
*********
The `GitLabCI configuration file <.gitlab-ci.yml>`_ contains the configuration to call a **CI** workflow using the *Gitlab CI*. A comprehensive documentation is available for the `GitLab CI`_ tool.

.. |gitlab| raw:: html

   

Azure pipelines
***************
If you want to use `Azure pipelines, `_ have a look at `Tania Allard's great tutorial `_.

##################################
🚀 Running on your own infrascture
##################################
Sometimes you want to have more control over the hardware infrascture, compilers, etc. when performing
continuous integration. *GitHub Actions* and *GitLab CI/CD* allow you to set up your infrascture.
The following links contains a guide to help you run a **CI** workflow on your own infrascture:

- `GitLab CI/CD self-hosted runner `_
- `GitHub Actions self-hosted runnner `_


###############################
🎮 Running the package examples
###############################
This package contains a toy example to estimate the value of π using the `Monte Carlo method`_.
To run the Monte Carlo calculator, you will need to have python install. We recommend you
create a `conda virtual environment `_ by following the instructions below,

1. Get a copy of `miniconda `_
2. Create a new environment by running the following command:
    ``conda create --name ci_for_science python=3.7 -y -q``
3. Activate the environment:
    ``conda activate ci_for_science``

Now to install this package,

4. `Fork and clone this repo `_
5. install cython:
    ``pip install cython``
6. install the library from the repo root folder:
    ``cd ci_for_science && pip install -e .``
7. run the command line interface like:
    ``compute_pi -n 1000``
The previous command will estimate π using 1000 random points.

Contributing
************

If you want to contribute to the development of ci_for_science,
have a look at the `contribution guidelines `_.

License
*******

Copyright (c) 2019-2020, 

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.



Credits
*******

This package was created with `Cookiecutter `_ and the `NLeSC/python-template `_.

.. _miniconda: https://docs.conda.io/en/latest/miniconda.html
.. _`Github actions`: https://help.github.com/en/actions/automating-your-workflow-with-github-actions
.. _`GitLab CI`: https://docs.gitlab.com/ee/ci/
.. _`Tania Allard great tutorial`: https://github.com/trallard/ci-research
.. _`Travis tutorial`: https://docs.travis-ci.com/user/tutorial/
.. _`Monte Carlo method`: https://en.wikipedia.org/wiki/Monte_Carlo_method

Owner

  • Name: ci-for-research
  • Login: ci-for-research
  • Kind: organization

GitHub Events

Total
  • Watch event: 1
Last Year
  • Watch event: 1

Dependencies

.github/workflows/pythonapp.yml actions
  • actions/checkout master composite
  • s-weigand/setup-conda v1 composite
requirements.txt pypi
setup.py pypi
  • cython *