Skip to content

Commit 9cc771b

Browse files
Merge pull request #145 from mala-project/develop
Create release for Aluminium PRB article
2 parents 64b8bbe + e1811a7 commit 9cc771b

File tree

181 files changed

+1132
-15540
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+1132
-15540
lines changed

.github/workflows/cpu-tests.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: CPU
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
- develop
8+
9+
# Publish `v1.2.3` tags as releases.
10+
tags:
11+
- v*
12+
13+
jobs:
14+
# Build and push Docker image to GitHub Packages.
15+
build-docker-image-cpu:
16+
runs-on: ubuntu-18.04
17+
env:
18+
IMAGE_NAME: mala_conda_cpu
19+
permissions:
20+
packages: write
21+
contents: read
22+
steps:
23+
- name: Check out repository
24+
uses: actions/checkout@v2
25+
26+
- name: Log into registry
27+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
28+
29+
- name: Set environment variables
30+
run: |
31+
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
32+
33+
# Change all uppercase to lowercase
34+
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
35+
36+
# Create environment variable to which all subsequent actions in this job have access
37+
echo "IMAGE_ID=$IMAGE_ID" >> $GITHUB_ENV
38+
39+
- name: Pull image from registry
40+
run: docker pull $IMAGE_ID || true
41+
42+
- name: Build image
43+
run: docker build . --file Dockerfile --tag $IMAGE_NAME --cache-from=$IMAGE_ID --build-arg DEVICE=cpu --label "runnumber=${GITHUB_RUN_ID}"
44+
45+
- name: Push image
46+
run: |
47+
# Strip git ref prefix from version
48+
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
49+
50+
# Strip "v" prefix from tag name
51+
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
52+
53+
# Use Docker `latest` tag convention
54+
[ "$VERSION" == "develop" ] && VERSION=latest
55+
56+
echo IMAGE_ID=$IMAGE_ID
57+
echo VERSION=$VERSION
58+
59+
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
60+
docker push $IMAGE_ID:$VERSION
61+
62+
cpu-tests:
63+
needs: build-docker-image-cpu
64+
runs-on: ubuntu-18.04
65+
container:
66+
image: ghcr.io/mala-project/mala_conda_cpu:latest
67+
credentials:
68+
username: ${{ github.actor }}
69+
password: ${{ secrets.GITHUB_TOKEN }}
70+
steps:
71+
- name: Check out repository (mala)
72+
uses: actions/checkout@v2
73+
74+
- name: Install mala package
75+
run: pip --no-cache-dir install -e .
76+
77+
- name: Check out repository (data)
78+
uses: actions/checkout@v2
79+
with:
80+
repository: mala-project/test-data
81+
token: ${{ secrets.ACCESS_TOKEN }}
82+
path: mala_data
83+
ref: v0.1.0
84+
lfs: false
85+
86+
- name: Data setup
87+
shell: bash
88+
run: |
89+
cd mala_data
90+
chmod +x ../install/data_repo_link/link_data_repo.sh
91+
../install/data_repo_link/link_data_repo.sh `pwd`
92+
93+
- name: Test basic functions
94+
run: python test/mala_tests.py
95+
96+
- name: Test workflow
97+
run: python examples/ex99_verify_all_examples.py

.github/workflows/gh-pages.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: docs
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
- develop
8+
push:
9+
branches:
10+
- develop
11+
12+
jobs:
13+
test-docstrings:
14+
runs-on: ubuntu-18.04
15+
steps:
16+
- name: Check out repository
17+
uses: actions/checkout@v2
18+
19+
- name: Setup Python
20+
uses: actions/setup-python@v2
21+
with:
22+
python-version: '3.8'
23+
24+
- name: Upgrade pip
25+
run: python3 -m pip install --upgrade pip
26+
27+
- name: Install dependencies
28+
run: pip install -qU pydocstyle
29+
30+
- name: Check docstrings
31+
run: pydocstyle --convention=numpy mala
32+
33+
deploy-pages:
34+
needs: test-docstrings
35+
runs-on: ubuntu-18.04
36+
steps:
37+
- name: Check out repository
38+
uses: actions/checkout@v2
39+
with:
40+
fetch-depth: 0 # 0 fetches complete history and tags
41+
42+
- name: Setup Python
43+
uses: actions/setup-python@v2
44+
with:
45+
python-version: '3.8'
46+
47+
- name: Upgrade pip
48+
run: python3 -m pip install --upgrade pip
49+
50+
- name: Install dependencies
51+
run: |
52+
pip install -q -r docs/requirements.txt
53+
54+
- name: Build API and docs
55+
run: |
56+
sphinx-apidoc -o docs/source/api mala
57+
sphinx-build -W --keep-going -b html -d docs/_build/doctrees docs/source docs/_build/html
58+
mv -v docs/_build/html public
59+
60+
- name: Deploy
61+
uses: peaceiris/actions-gh-pages@v3
62+
with:
63+
github_token: ${{ secrets.GITHUB_TOKEN }}
64+
publish_dir: ./public

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,3 +156,8 @@ cython_debug/
156156
*.pth
157157
/install/data_repo_link/data_repo_path.py
158158
/test/data_repo_path.py
159+
160+
161+
# JupyterNotebooks
162+
.ipynb_checkpoints
163+
*/.ipynb_checkpoints/*

.gitlab-ci.yml

Lines changed: 0 additions & 129 deletions
This file was deleted.

Copyright.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
************************************************************************
2+
3+
MALA v. 0.1.0
4+
5+
Under the terms of Contract DE-NA0003525 with NTESS,
6+
the U.S. Government retains certain rights in this software.
7+
8+
Questions? Contact Attila Cangi (a.cangi@hzdr.de)
9+
Siva Rajamanickam (srajama@sandia.gov)
10+
11+
************************************************************************
12+
13+
Copyright 2021 National Technology & Engineering Solutions of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government retains certain rights in this software.
14+
15+
Copyright 2021, (in alphabetical order) Attila Cangi, J. Austin Ellis, Lenz Fiedler, Daniel Kotik, Normand Modine, Sivasankaran Rajamanickam, Steve Schmerler, Aidan Thompson
16+
17+
All rights reserved.
18+

Dockerfile

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
FROM continuumio/miniconda3:4.9.2
22

3+
# Choose 'cpu' or 'gpu'
4+
ARG DEVICE=cpu
5+
36
# Update the image to the latest packages
47
RUN apt-get update && apt-get upgrade -y
58

6-
RUN apt-get install --no-install-recommends -y build-essential \
7-
libz-dev swig git-lfs && \
8-
apt-get clean && rm -rf /var/lib/apt/lists/*
9+
RUN apt-get install --no-install-recommends -y build-essential libz-dev swig git-lfs
10+
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
911

10-
COPY install/mala_cpu_environment.yml .
11-
RUN conda env create -q -f mala_cpu_environment.yml && rm -rf /opt/conda/pkgs/*
12+
COPY install/mala_${DEVICE}_environment.yml .
13+
RUN conda env create -f mala_${DEVICE}_environment.yml && rm -rf /opt/conda/pkgs/*
1214

13-
RUN echo "source activate mala-cpu" > ~/.bashrc
14-
ENV PATH /opt/conda/envs/mala-cpu/bin:$PATH
15+
RUN echo "source activate mala-${DEVICE}" > ~/.bashrc
16+
ENV PATH /opt/conda/envs/mala-${DEVICE}/bin:$PATH

LICENSE

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
BSD 3-Clause License
2+
3+
Redistribution and use in source and binary forms, with or without
4+
modification, are permitted provided that the following conditions are met:
5+
6+
1. Redistributions of source code must retain the above copyright notice, this
7+
list of conditions and the following disclaimer.
8+
9+
2. Redistributions in binary form must reproduce the above copyright notice,
10+
this list of conditions and the following disclaimer in the documentation
11+
and/or other materials provided with the distribution.
12+
13+
3. Neither the name of the copyright holder nor the names of its
14+
contributors may be used to endorse or promote products derived from
15+
this software without specific prior written permission.
16+
17+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

0 commit comments

Comments
 (0)