Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Commit

Permalink
Merge pull request #375 from SuperElastix/develop
Browse files Browse the repository at this point in the history
SimpleITK v2.0rc1
  • Loading branch information
kaspermarstal authored May 12, 2020
2 parents d4cf27f + a7cf5bd commit 8244e00
Show file tree
Hide file tree
Showing 1,136 changed files with 9,249 additions and 6,009 deletions.
36 changes: 14 additions & 22 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
referenced:
defaults: &defaults
docker:
- image: circleci/python:2.7-stretch
- image: circleci/python:3.5-stretch
working_directory: ~/
resource_class: large
resource_class: medium
default_environment_keys: &default_environment
<<: &default_environment_keys
CTEST_DASHBOARD_ROOT: /home/circleci
CTEST_SOURCE_DIRECTORY: /home/circleci/SimpleITK
CTEST_BINARY_DIRECTORY: /home/circleci/SimpleITK-build
ROOT_BINARY_DIRECTORY: /home/circleci/SimpleITK-build
CTEST_BUILD_FLAGS: "-j 4"
CTEST_CONFIGURATION_TYPE: "Release"
CTEST_BUILD_FLAGS: "-j 1"
CTEST_CONFIGURATION_TYPE: "MinSizeRel"
CTEST_OUTPUT_ON_FAILURE: 1
ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS: 2
PARALLEL_LEVEL: 4
PARALLEL_LEVEL: 2
DASHBOARD_BRANCH_DIRECTORY: /home/circleci/dashboard
ExternalData_OBJECT_STORES: /home/circleci/.ExternalData
CCACHE_NODIRECT: 1
dependencies: &dependencies
run:
name: Dependencies
command: |
sudo apt-get install -y rsync lua5.1 ccache kwstyle
sudo apt-get install -y rsync lua5.3 ccache
sudo python -m pip install --upgrade pip
sudo python -m pip install scikit-ci-addons # Provides "ctest_junit_formatter" add-on
sudo python -m pip install cmake==3.10.3
sudo python -m pip install cmake==3.13.3
generate-hash-step: &generate-hash-step
run:
name: Generate external data hash
Expand All @@ -42,6 +42,7 @@ referenced:
keys:
- ccache-{{ arch }}-{{ .Branch }}
- ccache-{{ arch }}-master
- ccache-{{ arch }}
clone-dashboard-step: &clone-dashboard-step
run:
name: Cloning dashboard branch
Expand All @@ -58,7 +59,6 @@ referenced:
name: Formatting CTest for JUnit
when: always
command: |
env
mkdir -p /tmp/test-results
ci_addons ctest_junit_formatter ${CTEST_BINARY_DIRECTORY} > /tmp/test-results/JUnit-${CIRCLE_NODE_INDEX}.xml
junit-store-test-results: &junit-store-test-results
Expand Down Expand Up @@ -123,7 +123,7 @@ jobs:
root: /home/circleci/SimpleITK-build
paths:
- "*"
python2.7-and-test:
python3.5-and-test:
<<: *defaults
environment:
<<: *default_environment_keys
Expand Down Expand Up @@ -159,10 +159,10 @@ jobs:
ctest -V -Ddashboard_source_config_dir:PATH="Wrapping/Python" -S "${CTEST_SOURCE_DIRECTORY}/.circleci/circleci.cmake"
- *junit-fotmatting
- *junit-store-test-results
python3.6-and-test:
python3.7-and-test:
<<: *defaults
docker:
- image: circleci/python:3.6-stretch
- image: circleci/python:3.7-stretch
environment:
<<: *default_environment_keys
CTEST_BUILD_FLAGS: "-j 2"
Expand Down Expand Up @@ -255,6 +255,7 @@ jobs:
- run:
name: Prerequisite Dependencies
command: |
sudo apt-get update -y
sudo apt-get install -y python-pip
- *dependencies
- *env-step
Expand Down Expand Up @@ -324,27 +325,18 @@ workflows:
- gh-pages
- dashboard
- hooks
- python2.7-and-test:
- python3.5-and-test:
requires:
- build-and-test
filters:
branches:
ignore: next
- python3.6-and-test:
- python3.7-and-test:
requires:
- build-and-test
- r-and-test:
requires:
- build-and-test
filters:
branches:
ignore: next
- java-and-test:
requires:
- build-and-test
filters:
branches:
ignore: next

nightly:
triggers:
Expand Down
5 changes: 4 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,7 @@
*.java whitespace=tab-in-indent,no-lf-at-eof
*.rb whitespace=tab-in-indent,no-lf-at-eof
*.R whitespace=tab-in-indent,no-lf-at-eof
*.tcl whitespace=tab-in-indent,no-lf-at-eof
*.tcl whitespace=tab-in-indent,no-lf-at-eof

Wrapping/Java/JavaDoc.i hooks-max-size=2097152
Wrapping/Python/PythonDocstrings.i hooks-max-size=2097152
130 changes: 116 additions & 14 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,134 @@

# Development
# Contributing to SimpleITK

We welcome contributions from the community!

SimpleITK uses the [Git](http://git-scm.com/) distributed version control system. The main repository is hosted on [itk.org](https://itk.org/SimpleITK.git) and mirrored to [Github](https://github.com/SimpleITK/SimpleITK.git). We are currently using Github for pull requests, and issue tracking.
SimpleITK uses the [Git](http://git-scm.com/) distributed version control system. The main repository is hosted on [Github](https://github.com/SimpleITK/SimpleITK.git) and the [Insight Software Consortium](https://github.com/InsightSoftwareConsortium/SimpleITK). For pull requests and issue tracking Github is also used.

There are many ways to contribute to SimpleITK:
- Report Bugs and Issues
- Improve SimpleITK Examples and Documentation
- Request new features
- Enhance the code coverage
- Contribute code to fix bugs or add new features.

## Setup for development

The following documentation is for an advanced contributor who is already familiar with git and GitHub workflow. The [ITK](https://github.com/InsightSoftwareConsortium/ITK) documentation may provide more details, or many online resource can orient you.

After you have cloned and forked the SimpleITK repository run the following command from the root:
```
./Utilities/SetupForDevelopment.sh
```

This script will configure your local checkout with the `upstream` repository and your own fork. Additionally, local hooks and aliases are added.

## Workflow

Submitting code to SimpleITK follows the standard pull request GitHub workflow. More information can be found [here](https://guides.github.com/activities/forking/) and [here](https://guides.github.com/introduction/flow/) regarding the workflow and getting your computer setup.

# Contribute
SimpleITK uses a branchy workflow where each PR should be a new topic branch. Locally, you create a branch with a concise and precise name then commit your changes to that branch. The branch should be based on your target branch which will usually be `master` for new features and improvements or `release` for back patches such as bugs fixes.

To submit code to SimpleITK, simply follow the standard GitHub workflow to make a pull request. More information can be found [here](https://guides.github.com/activities/forking/) and [here](https://gist.github.com/Chaser324/ce0505fbed06b947d962) regarding the workflow and getting your computer setup.
After completing the local branch, push it to your fork, then create a GitHub pull request in the SimpleITK upstream repository. The pull request is then required to have an approving *code review*, and the *continuous integration* testing pass before the topic is merged into the upstream repository.

New feature topics should be based on the `master` branch, while bugs fixes for the recent release should be based on the `release` branch. A topic should *never* be based on the `next` branch.
### How to contribute with the right workflow using github commands

## Setup
1. Setup
Fork the repo
https://github.com/SimpleITK/SimpleITK.git

After cloning the repository, run `./Utilities/SetupForDevelopment.sh` from within the SimpleITK repository to setup Git hooks. Say "no" to setting up access to itk.org as only core developers need access for merging pull requests.
clone to your laptop
``` shell
git clone https://github.com/<username>/SimpleITK.git
```
Go to the folder
``` shell
cd SimpleITK
```
Check the repo
```shell
git remote -v
origin https://github.com/<username>/SimpleITK.git (fetch)
origin https://github.com/<username>/SimpleITK.git (push)
```
Add the upstream
``` shell
git remote add upstream https://github.com/SimpleITK/SimpleITK.git
```
Check the repos again
```shell
git remote -v
origin https://github.com/<username>/SimpleITK.git (fetch)
origin https://github.com/<username>/SimpleITK.git (push)
upstream https://github.com/SimpleITK/SimpleITK.git (fetch)
upstream https://github.com/SimpleITK/SimpleITK.git (push)
```
Download the upstream repo in to your local
``` shell
git fetch upstream
```
You will see something like this:
``` shell
* [new branch] dashboard -> upstream/dashboard
* [new branch] master -> upstream/master
* [new branch] release -> upstream/release
```
2. Start a branch
Create your new branch where "newdocumentation" is the name of the new branch. you can change the name
``` shell
git checkout -b newdocumentation upstream/master
Branch 'newdocumentation' set up to track remote branch 'master' from 'upstream'.
Switched to a new branch 'newdocumentation'
```
To check the branches to type this:
``` shell
git branch
```
The name with the * in front is the branch that you are.
``` shell
master
* newdocumentation
```
3. Create a Pull Request
Work on the project and when you are done save the files and add, commit and push to origin
``` shell
git status
git add .
git commit -m"a new commit"
git push origin
```
Once you push it go to your fork repo
``` shell
<username>/SimpleITK
```
Click on the green button name "compare & pull request" and submit your pull request

This setup script also sets up some alias for the legacy ITK's Gerrit review system.
4. Update a Pull Request
When you update your Pull Request you save the files and add, commit and push to origin.
``` shell
git status
git add .
git commit -m"a new commit"
git push origin
```
Once you push it go to your fork repo
``` shell
<username>/SimpleITK
```
You will not see again the green button name "compare & pull request". That mean that your request have been update it. You can now go to your pull request (PR) in the https://github.com/SimpleITK/SimpleITK.git and click in the pull request tab, then click on your PR and check the comments and more.

## Branches

* **next** - An unstable branch which contains future features for testing. These will be tested nightly on [CDash](https://open.cdash.org/index.php?project=SimpleITK). If the tests pass, then they will be merged into master. Pull requests should never be based on this branch, however this is the default branch you should push changes to.
* **master** - Stable branch of the code and suitable for most users when building SimpleITK. New features should be based on this branch.
* **release** - Branch of the code from the stable release. Patches which are bug fixes for the most recent releae should be based on the `release` branch.
* **master** - Stable branch of the code which is expected to available to users when building SimpleITK. New features should be based on this branch.
* **release** - Branch of the code from the stable release. Patches which are bug fixes for the most recent release should be based on the `release` branch.
* **dashboard** - CMake scripts used for continuous integration and nightly testing

## Testing

Testing is very important for SimpleITK, to ensure quality and reliable code that "just works". Please include tests in pull request that add features or fix bugs.

Pull request will be reviewed and run through the continuous integration building and testing infrastructure to ensure quality code before being merged into the **next** branch for nightly testing.
Pull requests are run through the continuous integration building and
testing infrastructure to ensure quality code. Many options are tested
on the PR, but more are run when merged into master. It is important
to check the [CDash Dashboard](https://open.cdash.org/index.php?project=SimpleITK) to verify no new warnings or regression test failures are introduced after your patch has been merged.

The comprehensive regression testing is reported to the [CDash Dashboard](https://open.cdash.org/index.php?project=SimpleITK). This include the extensive nightly testing on the **next** branch, nightly distributions packages on the **release** or **master** branch, and continuous integration from Github pull requests.
The regression testing is reported to the [CDash Dashboard](https://open.cdash.org/index.php?project=SimpleITK).
2 changes: 1 addition & 1 deletion .hooks-config.bash
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#==========================================================================
#
# Copyright Insight Software Consortium
# Copyright NumFOCUS
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
19 changes: 19 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Optionally build your docs in additional formats such as PDF and ePub
formats: all

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

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
install:
- requirements: docs/requirements.txt
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ matrix:
compiler: gcc

before_script:
- mkdir -p ${SIMPLEELASTIX_BUILD_DIR}
- pwd
- ls -lR
- sudo apt-get remove cmake && sudo apt-get install swig lua5.3 libinsighttoolkit4-dev doxygen graphviz
- cd ${ExternalData_OBJECT_STORES} && if [[ ! -e ${CMAKE_DOWNLOAD_FILE} ]]; then curl -sSO https://cmake.org/files/v3.6/${CMAKE_DOWNLOAD_FILE}; fi
- echo "y\n" | sudo bash "${ExternalData_OBJECT_STORES}/${CMAKE_DOWNLOAD_FILE}" --prefix=/usr/local --exclude-subdir
- cmake --version
- mkdir -p ${SIMPLEITK_BUILD_DIR}

script:
- if [[ ! -e ${ITK_BUILD_DIR}/ITKConfig.cmake ]]; then
Expand Down
13 changes: 6 additions & 7 deletions CMake/CTestCustom.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ SET(CTEST_CUSTOM_COVERAGE_EXCLUDE

# Exclude files from the Testing directories
".*/Testing/.*"

# Exclude files from the Utilities directories
".*/Utilities/.*"

# exclude certain wrapping files
"/Wrapping/SimpleITKLuaMain.cxx"
"/Wrapping/.*_wrap.cxx"
)

SET(CTEST_CUSTOM_WARNING_EXCEPTION
Expand Down Expand Up @@ -62,6 +55,9 @@ SET(CTEST_CUSTOM_WARNING_EXCEPTION
# Warning when compiling ITK v4.5.1 with clang
"clang: warning: argument unused during.*-fno-ipa-cp-clone"

# Warning when compiling SWIG
"clang: warning: argument unused.*-ansi"

# Warning from RHEL5 GCC 4.1 about visibility change
"warning: lowering visibility of .* to match its type"

Expand All @@ -70,6 +66,9 @@ SET(CTEST_CUSTOM_WARNING_EXCEPTION

# Warning from RH5 gcc 4.1.2
"tr1/mu_iterate.h.* warning: unused parameter '__tuple'"

# Warning on CircleCI
"Warning: Permanently added.*to the list of known hosts"
)

SET(CTEST_CUSTOM_ERROR_EXCEPTION
Expand Down
16 changes: 13 additions & 3 deletions CMake/FindLuaInterp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,18 @@
# LUA_EXECUTABLE_FOUND - If false, don't attempt to use lua
# LUA_EXECUTABLE_VERSION_STRING - version of lua found


set(_NAMES lua)

if(NOT LuaInterp_FIND_VERSION_MAJOR EQUAL 0)
list(INSERT _NAMES 0 lua${LuaInterp_FIND_VERSION_MAJOR})
if(NOT LuaInterp_FIND_VERSION_MINOR EQUAL 0)
list(INSERT _NAMES 0 lua${LuaInterp_FIND_VERSION_MAJOR}.${LuaInterp_FIND_VERSION_MINOR})
endif()
endif()

find_program(LUA_EXECUTABLE
NAMES lua
NAMES ${_NAMES}
)

if(LUA_EXECUTABLE)
Expand All @@ -38,8 +48,8 @@ endif()
# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Lua
find_package_handle_standard_args(LuaInterp
REQUIRED_VARS LUA_EXECUTABLE
VERSION_VAR LUA_VERSION_STRING)
VERSION_VAR LUA_VERSION)

mark_as_advanced(LUA_EXECUTABLE)
2 changes: 1 addition & 1 deletion CMake/FindPythonVirtualEnv.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PythonVirtualEnv
REQUIRED_VARS PYTHON_VIRTUALENV_SCRIPT
VERSION_VAR PYTHON_VIRTUALENV_VERSION_STRING)
VERSION_VAR PYTHON_VIRTUALENV_VERSION)

mark_as_advanced(PYTHON_VIRTUALENV_SCRIPT)
Loading

0 comments on commit 8244e00

Please sign in to comment.