Skip to content

Commit 85bf13c

Browse files
authored
Merge pull request #345 from ComputationalCryoEM/develop
Develop - BETA
2 parents 60f4ced + acd2a87 commit 85bf13c

File tree

253 files changed

+15230
-15399
lines changed

Some content is hidden

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

253 files changed

+15230
-15399
lines changed

.bumpversion.cfg

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[bumpversion]
2+
current_version = 0.6.0
3+
commit = True
4+
tag = True
5+
6+
[bumpversion:file:setup.py]
7+
search = version='{current_version}'
8+
replace = version='{new_version}'
9+
10+
[bumpversion:file:README.md]
11+
search = v{current_version}
12+
replace = v{new_version}
13+
14+
[bumpversion:file:src/aspire/__init__.py]
15+
search = __version__ = '{current_version}'
16+
replace = __version__ = '{new_version}'
17+
18+
[bumpversion:file:docs/source/conf.py]
19+
search = release = version = '{current_version}'
20+
replace = release = version = '{new_version}'
21+
22+
[bumpversion:file:docs/source/index.rst]
23+
search = v{current_version}
24+
replace = v{new_version}

.git-blame-ignore-revs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Initial Black autoformatting
2+
fad41cbb60b15108da2d74f3125541d8eadf8c83

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# See https://git-scm.com/docs/gitattributes for details on how to use this file
2+
3+
# Among a bunch of other stuff we can
4+
# add files or directory that should be ignored by tools like `git grep` like so
5+
tutorials/notebooks/*.ipynb binary

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,5 @@ venv.bak/
9393
# all logs
9494
*.log
9595

96+
# Generated documentation
97+
docs/source/

.travis.yml

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,42 @@
1-
sudo: required
21
language: python
3-
python:
4-
- "3.6"
2+
3+
# manylinux2010 wheels are not found on xenial
4+
dist: bionic
5+
6+
os:
7+
- linux
8+
9+
arch:
10+
- amd64
11+
12+
stages:
13+
- check
14+
- test
15+
- deploy
16+
17+
jobs:
18+
include:
19+
- python: 3.6
20+
env: TOXENV=clean,py36-stable,coveralls,report
21+
- python: 3.6
22+
env: TOXENV=py36-dev
23+
- python: 3.7
24+
env: TOXENV=py37-stable
25+
- python: 3.7
26+
env: TOXENV=py37-dev
27+
- python: 3.8
28+
env: TOXENV=py38-stable
29+
- python: 3.8
30+
env: TOXENV=py38-dev
31+
- python: 3.6
32+
env: TOXENV=check
33+
- python: 3.6
34+
env: TOXENV=docs
35+
536
install:
6-
- sudo apt-get update
7-
# We do this conditionally because it saves us some downloading if the
8-
# version is the same.
9-
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
10-
wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh;
11-
else
12-
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
13-
fi
14-
- bash miniconda.sh -b -p $HOME/miniconda
15-
- export PATH="$HOME/miniconda/bin:$PATH"
16-
- hash -r
17-
- conda config --set always_yes yes --set changeps1 no
18-
- conda update -q conda
19-
# Useful for debugging any issues with conda
20-
- conda info -a
21-
22-
- conda env create -n test-environment -f environment.yml
23-
- source activate test-environment
24-
- python setup.py install
25-
26-
script: py.test --cov=aspire tests
27-
28-
after_success:
29-
- coveralls
37+
- pip install -U tox tox-travis
38+
39+
script: tox -v --skip-missing-interpreters false -e $TOXENV
3040

3141
before_deploy:
3242
- cd docs && sphinx-apidoc -f -o ./source ../src -H Modules && make html && touch build/html/.nojekyll

CODEOWNERS

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# This is a comment.
2+
# Each line is a file pattern followed by one or more owners.
3+
4+
# These owners will be the default owners for everything in
5+
# the repo. Unless a later match takes precedence,
6+
# @global-owner1 and @global-owner2 will be requested for
7+
# review when someone opens a pull request.
8+
# * @global-owner1 @global-owner2
9+
* @janden
10+
11+
# Order is important; the last matching pattern takes the most
12+
# precedence. When someone opens a pull request that only
13+
# modifies JS files, only @js-owner and not the global
14+
# owner(s) will be requested for a review.
15+
# *.js @js-owner
16+
17+
# You can also use email addresses if you prefer. They'll be
18+
# used to look up users just like we do for commit author
19+
# emails.
20+
21+
22+
# In this example, @doctocat owns any files in the build/logs
23+
# directory at the root of the repository and any of its
24+
# subdirectories.
25+
# /build/logs/ @doctocat
26+
27+
# The `docs/*` pattern will match files like
28+
# `docs/getting-started.md` but not further nested files like
29+
# `docs/build-app/troubleshooting.md`.
30+
31+
32+
# In this example, @octocat owns any file in an apps directory
33+
# anywhere in your repository.
34+
# apps/ @octocat
35+
36+
# In this example, @doctocat owns any file in the `/docs`
37+
# directory in the root of your repository.
38+
# /docs/ @doctocat

CODING_GUIDELINES.md

Lines changed: 84 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,99 @@ This document contains the coding guidelines for the ASPIRE Python project.
66
## Coding Style
77

88
In order to keep the code consistent, please read and follow [PEP 8 Style Guide for Python Code](https://www.python.org/dev/peps/pep-0008)
9-
and [PEP 257 Docstring Conventions](https://www.python.org/dev/peps/pep-0257/) guidelines. [This webpage](https://realpython.com/documenting-python-code/) is a good guide for documenting Python code.
10-
For automatic checking of style problems, [Pycharm from Jet Brains](https://www.jetbrains.com/pycharm/)
11-
is a good candidate which has the professional version for academic users with free license fee.
9+
and [PEP 257 Docstring Conventions](https://www.python.org/dev/peps/pep-0257/) guidelines. [This webpage](https://realpython.com/documenting-python-code/) is a good guide for documenting Python code.
10+
For an editor with some automatic checking of style problems, [Pycharm from Jet Brains](https://www.jetbrains.com/pycharm/)
11+
is a good candidate which has the professional version for academic users with free license fee.
1212

13+
In the future components of PEP8 and PEP257 will be checked programmatically. Documentation of a standard tool to perform
14+
these operations locally will be provided in Google Doc to developers at that time.
1315

14-
## Best Practices
16+
## Good Practices Reading
1517

16-
For beginners in scientific computing, some general guides are suggested in Greg Wilson's papers as below:
17-
18-
1. [Good Enough Practices in Scientific Computing]( https://doi.org/10.1371/journal.pcbi.1005510)
19-
2. [Best Practices for Scientific Computing]( https://doi.org/10.1371/journal.pbio.1001745)
18+
Some thoughts on Scientific Computing are discussed in Greg Wilson and collaborators' paper as below:
2019

20+
1. [Good Enough Practices in Scientific Computing]( https://doi.org/10.1371/journal.pcbi.1005510)
21+
2. [Best Practices for Scientific Computing]( https://doi.org/10.1371/journal.pbio.1001745)
2122

2223
## Source Code Control
2324

24-
As an open source software, we use Git and GitHub for our source code control.
25-
The following links are useful tutorials.
26-
1. Git tutorials from [Atalassian](https://www.atlassian.com/git/tutorials) and [Git-SCM](https://git-scm.com/docs/gittutorial)
27-
2. GitHub guides from [GitHub](https://guides.github.com/)
25+
As an open source software, we use Git with GitHub for our source code control.
26+
The following links are useful tutorials.
27+
1. Git tutorials from [Atlassian](https://www.atlassian.com/git/tutorials) and [Git-SCM](https://git-scm.com/docs/gittutorial)
28+
2. GitHub guides from [GitHub](https://guides.github.com/)
2829

29-
## Git Workflow Changes
30+
## Git Workflow
3031

31-
Our project follows [Gitflow Workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow).
32-
Please submit any PRs against the `develop` branch.
32+
Our project follows a reduced [Gitflow Workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow).
33+
Please submit any Pull Requests (PR) against the `develop` branch.
3334

3435
![Gitflow Diagram](https://wac-cdn.atlassian.com/dam/jcr:61ccc620-5249-4338-be66-94d563f2843c/05%20(2).svg?cdnVersion=357)
3536

37+
The basic idea is that we have `feature` branches, `develop` as an integration focused branch, and `master` for releases.
38+
We do not currently have a need for a dedicated release or staging branch; in our case `develop` also serves this purpose.
39+
Generally feature branches should branch off of the latest `develop` branch.
40+
41+
Developers are welcome to maintain their own fork, but this is not required.
42+
43+
When `develop` is at a milestone where we want to cut a release,
44+
following the controls below we will commit with a
45+
[PEP440](https://www.python.org/dev/peps/pep-0440/)
46+
compliant `Major.Minor` version scheme
47+
and complete a reviewed merge to `master`.
48+
Once in `master` a formal Git (version) tag can be applied to the commit,
49+
and at this point the release would be a candidate to upload to PyPI.
50+
51+
The process for these steps will be documented in a Google Doc.
52+
53+
### Git Workflow Controls
54+
55+
To facilitate effective integration, merges into `develop` must occur as a pull request that is approved by two reviewers.
56+
One reviewer can be anyone, but should probably be a developer related to the effort if that is applicable.
57+
The second reviewer is a designated codeowner described in the `CODEOWNERS` file.
58+
More information on codeowners can be [found on GitHub.](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners)
59+
60+
Additionally, all outstanding requested changes and comments should be resolved
61+
by the requesting reviewer before merging.
62+
Pushing new changes should trigger a re-review process
63+
of changed files to prevent oversights.
64+
65+
Code should be passing integration and unit tests as defined in code on all
66+
supported platforms by the evolving Continuous Integration (CI) systems,
67+
or be explicitly exempted by a codeowner.
68+
This is both for code quality and so CI maintenance is not overlooked.
69+
70+
All of these controls will be managed automatically by the GitHub server.
71+
72+
Releases and merges to `master` should be coordinated between developers and the project PI.
73+
This will be documented with an additional required review from the PI when merging into `master`.
74+
75+
### Git Workflow Courtesy
76+
77+
Contributors are responsible for keeping their working repositories up to date with the main GitHub repo.
78+
This is particularly important during active development,
79+
as it will reduce the likelihood and extent of code conflicts
80+
when new features are implemented.
81+
82+
If a piece of work is known to change files that will effect other developers' active work, they should be invited to the review or tagged,
83+
so that the most effective order of integration can be established. In the case of your own work having integration
84+
concerns, again, inviting other developers to discuss might be helpful.
85+
86+
In the case a codeowner will not be available, such as (sickeness, vacation, travel, and so on)
87+
and an emergency patch can not be delayed, a simple explicit consensus among
88+
the remaining developers should suffice.
89+
90+
Do not push or merge over another working branch unless explicitly permitted to do so by the authors.
91+
Instead, when working on a shared branch submit a Pull Request to the other party.
92+
93+
## Project Collaboration
94+
95+
We will for a time attempt using
96+
[GitHub project boards](https://help.github.com/en/github/managing-your-work-on-github/about-project-boards)
97+
in conjunction with
98+
[Issues](https://help.github.com/en/github/managing-your-work-on-github/about-issues)
99+
to document tasks in various stages.
100+
Generally this will look like a board collecting related tasks representing a conceptual project or
101+
actual milestone that comes out of our meetings. For example, an event, release, or large feature set
102+
with many components all are reasonable project boards. This is for planning purposes and to facilitate coordination
103+
in the remote environment. If it helps we can keep doing it so long as the time and effort is accounted for.
104+

MANIFEST.in

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
include *.md
2+
include *.rst
3+
include *.yml
4+
include .bumpversion.cfg
5+
include .flake8
6+
include .git-blame-ignore-revs
7+
include .isort.cfg
8+
include CODEOWNERS
9+
include LICENSE
10+
include pytest.ini
11+
include tox.ini
12+
include logging.conf
13+
include config.ini
14+
recursive-include docs *.bat
15+
recursive-include docs *.bib
16+
recursive-include docs *.py
17+
recursive-include docs *.rst
18+
recursive-include docs Makefile
19+
recursive-include tests *.mrc
20+
recursive-include tests *.mrcs
21+
recursive-include tests *.npy
22+
recursive-include tests *.py
23+
recursive-include tests *.star
24+
recursive-include tutorials *.dontrun
25+
recursive-include tutorials *.ipynb
26+
recursive-include tutorials *.mat
27+
recursive-include tutorials *.mrc
28+
recursive-include tutorials *.npy
29+
recursive-include tutorials *.py
30+
prune docs/source

README.md

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
[![Travis Build Status](https://travis-ci.org/ComputationalCryoEM/ASPIRE-Python.svg?branch=master)](https://travis-ci.org/ComputationalCryoEM/ASPIRE-Python)
55
[![Coverage Status](https://coveralls.io/repos/github/ComputationalCryoEM/ASPIRE-Python/badge.svg?branch=master)](https://coveralls.io/github/ComputationalCryoEM/ASPIRE-Python?branch=master)
66

7-
# ASPIRE - Algorithms for Single Particle Reconstruction
7+
# ASPIRE - Algorithms for Single Particle Reconstruction - v0.6.0
88

9-
This is the Python version to supersede the [Matlab ASPIRE](https://github.com/PrincetonUniversity/aspire).
9+
This is the Python version to supersede the [Matlab ASPIRE](https://github.com/PrincetonUniversity/aspire).
1010

1111
ASPIRE is an open-source software package for processing single-particle cryo-EM data to determine three-dimensional structures of biological macromolecules. The package includes advanced algorithms based on rigorous mathematics and recent developments in
1212
statistics and machine learning. It provides unique and improved solutions to important computational challenges of the cryo-EM
@@ -21,49 +21,53 @@ For more information about the project, algorithms, and related publications ple
2121
For end-users
2222
-------------
2323

24-
ASPIRE is a pip-installable package that works on Linux/Mac/Windows, and requires Python 3.6. The simplest option is to use Anaconda 64-bit for your platform with a minimum of Python 3.6 and pip, and then use `pip` to install `aspire` in that environment.
24+
ASPIRE is a pip-installable package that works on Linux/Mac/Windows, and requires Python 3.6. The simplest option is to use Anaconda 64-bit for your platform with a minimum of Python 3.6 and `pip`, and then use `pip` to install `aspire` in that environment.
2525

2626
```
2727
conda create -n aspire_env python=3.6 pip
2828
conda activate aspire_env
2929
pip install aspire
3030
```
3131

32-
The final step above should install any dependent packages from `pip` automatically.
32+
The final step above should install any dependent packages from `pip` automatically. To see what packages are required, browse `setup.py`.
3333

3434
Note that this step installs the base `aspire` package for you to work with, but not the unit tests/documentation. If you need to install ASPIRE for development purposes, read on.
3535

3636
For developers
3737
--------------
3838

39-
After cloning this repo, the simplest option is to use Anaconda 64-bit for your platform, and use the provided `environment.yml` file to build a Conda environment to run ASPIRE.
39+
After cloning this repo, the simplest option is to use Anaconda 64-bit for your platform, and use the provided `environment.yml` file to build a Conda environment to run ASPIRE. This is very similar to above except you will be based off of your local checkout, and you are free to rename `aspire_dev` used in the commands below. The `pip` line will install aspire in a locally editable mode, and is equivalent to `python setup.py develop`:
4040

4141
```
4242
cd /path/to/git/clone/folder
43-
conda env create -f environment.yml
44-
conda activate aspire
45-
```
4643
47-
### Make sure everything works
44+
# Create's the conda environment and installs base dependencies.
45+
conda env create -f environment.yml --name aspire_dev
4846
49-
Once ASPIRE is installed, make sure the unit tests run correctly on your platform by doing:
50-
```
51-
cd /path/to/git/clone/folder
52-
python setup.py test
47+
# Enable the environment
48+
conda activate aspire_dev
49+
50+
# Install the aspire package in a locally editable way:
51+
pip install -e .
5352
```
5453

55-
Tests currently take around 2 minutes to run. If some tests fail, you may realize that `python setup.py test` produces too much information.
56-
You may want to re-run tests using:
54+
If you prefer not to use Anaconda, or want to manage environments yourself, you should be able to use `pip` with Python >= 3.6.
55+
Please see the full documentation for details.
56+
57+
You may optionally install additional packages:
58+
5759
```
58-
cd /path/to/git/clone/folder
59-
PYTHONPATH=./src pytest tests
60+
# Additional GPU packages (reqires CUDA)
61+
pip install -e ".[gpu]"
62+
# Additional developer tools
63+
pip install -e ".[dev]"
6064
```
61-
This provides a cleaner output to analyze.
6265

63-
### Install
66+
### Make sure everything works
67+
68+
Once ASPIRE is installed, make sure the unit tests run correctly on your platform by doing:
6469

65-
If the tests pass, install the ASPIRE package for the currently active Conda environment:
6670
```
6771
cd /path/to/git/clone/folder
68-
python setup.py install
72+
pytest
6973
```

0 commit comments

Comments
 (0)