Skip to content

Commit

Permalink
Merge branch 'release/0.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhekhorn committed May 5, 2021
2 parents 7f0cf53 + 0417407 commit ca5fe1b
Show file tree
Hide file tree
Showing 177 changed files with 51,742 additions and 89,360 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
benchmarks/storage/*.json filter=lfs diff=lfs merge=lfs -text
benchmarks/storage/*.db filter=lfs diff=lfs merge=lfs -text
*.ipynb linguist-generated
29 changes: 18 additions & 11 deletions .github/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@ contributions guidelines](.github/contributing.md#external-contributions)

## Internal development

### Release based workflow

The development it's following some conventions to improve collaboration:

- the _almost_ standard [SemVer](https://semver.org/) it's adopted for versions'
numbers
- the popular [git flow
model](https://nvie.com/posts/a-successful-git-branching-model/) it's used for
managing git branches
- in order to help you with the management consider using [`git flow`](https://github.com/petervanderdoes/gitflow-avh) CLI tool (and the corresponding [shell completion](https://github.com/petervanderdoes/git-flow-completion)), or the original version of [`git flow`](https://github.com/nvie/gitflow).

#### Caveat

- remember to base all the pull requests on GitHub to `develop` (and not
`main`/`master`)
- while using `git flow` to merge remember to use the `-k` (keep) option, for
GitHub compatibility

### Installation

#### Test Dependencies
Expand Down Expand Up @@ -64,17 +82,6 @@ provided scripts, and then select with suitable queries the combinations of
input you are interested in, and running the benchmark utility passing the
queries as arguments.

### Release based workflow

Since it is appropriate to develop this code in versions (as in the way
suggested by [SemVer](https://semver.org/)) we decided to base our workflow on
the popular [git flow model](https://nvie.com/posts/a-successful-git-branching-model/).

In order to help you with the management consider using [`git flow`](https://github.com/petervanderdoes/gitflow-avh) CLI tool (and the
corresponding [shell
completion](https://github.com/petervanderdoes/git-flow-completion)), or the
original version of [`git flow`](https://github.com/nvie/gitflow).

## External contributions

Currently the main guideline we would like to highlight is to use [GitHub
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/pub_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,21 @@ jobs:
python -m pip install --upgrade pip
# install yadism
pip install .
pip install benchmarks/
- name: Build 🔨
run: |
pip install -r doc_requirements.txt
sudo apt-get install graphviz
# the following is required by nbsphinx
sudo apt-get install pandoc
# install home page dependencies
cd docs/home-page
yarn
# tags are required for the home page structure
git fetch --tags
# build the home-page
make
# build sphinx for the current branch
cd ../sphinx/
make html
- name: Save files 💾
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
#token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# ignore version
src/yadism/version.py

*.wgt

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code
extension-pkg-whitelist=numpy,lhapdf,QCDNUM,scipy.special,rich
extension-pkg-whitelist=numpy,lhapdf,apfel,QCDNUM,xspace_bench,scipy.special,pineappl

# Add files or directories to the blacklist. They should be base names, not
# paths.
Expand Down
22 changes: 22 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/sphinx/source/conf.py

# Optionally build your docs in additional formats such as PDF
# formats:
# - pdf

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.8
install:
- method: pip
path: .
- requirements: doc_requirements.txt
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/github/workflow/status/N3PDF/dis/yadism
use the ones provided by shields.io:
- example: https://img.shields.io/github/workflow/status/N3PDF/dis/yadism
- example: https://img.shields.io/github/workflow/status/N3PDF/yadism
note: in order to make shields.io the repo must be public (or accessible to it in some way)
Expand Down Expand Up @@ -51,7 +51,7 @@ python setup.py install
The documentation style of this code follows closely the [numpy documentation
guide](https://numpydoc.readthedocs.io/en/latest/format.html).

Docs available at: https://n3pdf.github.io/dis/
Docs available at: https://n3pdf.github.io/yadism/

## Development

Expand All @@ -67,3 +67,4 @@ an email to the authors:

- [Alessandro Candido](mailto:[email protected])
- [Felix Hekhorn](mailto:[email protected])
- [Giacomo Magni](mailto:[email protected])
4 changes: 4 additions & 0 deletions benchmarks/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# ignore qcdnum weights' files
*.wgt
# ignore airspeed velocity output
html/
results/
84 changes: 84 additions & 0 deletions benchmarks/asv.conf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
// The version of the config file format. Do not change, unless
// you know what you are doing.
"version": 1,

// The name of the project being benchmarked
"project": "yadism",

// The project's homepage
"project_url": "https://n3pdf.github.io/yadism/",

// The URL or local path of the source code repository for the
// project being benchmarked
"repo": "..",

// List of branches to benchmark. If not provided, defaults to "master"
// (for git) or "tip" (for mercurial).
"branches": ["HEAD"],

// The DVCS being used. If not set, it will be automatically
// determined from "repo" by looking at the protocol in the URL
// (if remote), or by looking for special directories, such as
// ".git" (if local).
"dvcs": "git",

// The tool to use to create environments. May be "conda",
// "virtualenv" or other value depending on the plugins in use.
// If missing or the empty string, the tool will be automatically
// determined by looking for tools on the PATH environment
// variable.
"environment_type": "virtualenv",

// the base URL to show a commit for the project.
"show_commit_url": "https://github.com/N3PDF/yadism/commit/",

// The Pythons you'd like to test against. If not provided, defaults
// to the current version of Python used to run `asv`.
"pythons": ["3.8"],

// The matrix of dependencies to test. Each key is the name of a
// package (in PyPI) and the values are version numbers. An empty
// list indicates to just test against the default (latest)
//version.
"matrix": {
"packutil": []
},

// The directory (relative to the current directory) that benchmarks are
// stored in. If not provided, defaults to "benchmarks"
"benchmark_dir": "performance",

// The directory (relative to the current directory) to cache the Python
// environments in. If not provided, defaults to "env"
"env_dir": "../env",

// The directory (relative to the current directory) that raw benchmark
// results are stored in. If not provided, defaults to "results".
"results_dir": "results",

// The directory (relative to the current directory) that the html tree
// should be written to. If not provided, defaults to "html".
"html_dir": "html",

// The number of characters to retain in the commit hashes.
// "hash_length": 8,

// `asv` will cache wheels of the recent builds in each
// environment, making them faster to install next time. This is
// number of builds to keep, per environment.
"build_cache_size": 8

// The commits after which the regression search in `asv publish`
// should start looking for regressions. Dictionary whose keys are
// regexps matching to benchmark names, and values corresponding to
// the commit (exclusive) after which to start looking for
// regressions. The default is to start from the first commit
// with results. If the commit is `null`, regression detection is
// skipped for the matching benchmark.
//
// "regressions_first_commits": {
// "some_benchmark": "352cdf", // Consider regressions only after this commit
// "another_benchmark": null, // Skip regression detection altogether
// }
}
1 change: 1 addition & 0 deletions benchmarks/performance/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

35 changes: 35 additions & 0 deletions benchmarks/performance/benchmarks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Write the benchmarking functions here.
# See "Writing benchmarks" in the asv docs for more information.

import numpy as np


class TimeSuite:
"""
An example benchmark that times the performance of various kinds
of iterating over dictionaries in Python.
"""

def setup(self):
self.d = {}
for x in range(500):
self.d[x] = None

def time_keys(self):
for key in self.d.keys():
pass

def time_range(self):
d = self.d
for key in range(500):
x = d[key]

def time_arange(self):
d = self.d
for key in np.arange(500):
x = d[key]


class MemSuite:
def mem_list(self):
return [0] * 256
Loading

0 comments on commit ca5fe1b

Please sign in to comment.