Skip to content
This repository was archived by the owner on Sep 28, 2021. It is now read-only.

Commit 7599adb

Browse files
authored
Merge pull request #63 from votca/stable_bump
Merge 2021-dev into stable
2 parents ff94a94 + ae3c647 commit 7599adb

73 files changed

Lines changed: 3316 additions & 1389 deletions

Some content is hidden

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

.gitattributes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.gitattributes export-ignore
2+
.gitignore export-ignore
3+
.gitmodules export-ignore
4+
.github export-ignore
5+
.clang-format export-ignore
6+
.codecov.yml export-ignore

.github/workflows/continuous-integration-workflow.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
continue-on-error: ${{ matrix.distro == 'ubuntu:devel' || matrix.distro == 'fedora:rawhide' || matrix.distro == 'opensuse:latest' || matrix.continue-on-error == true }}
1111
strategy:
1212
matrix:
13-
distro: ['fedora:latest', 'fedora:rawhide', 'opensuse:latest', 'ubuntu:latest', 'ubuntu:devel', 'ubuntu:rolling', 'ubuntu:18.04']
13+
distro: ['fedora:latest', 'fedora:rawhide', 'opensuse:latest', 'ubuntu:latest', 'ubuntu:devel', 'ubuntu:rolling']
1414
toolchain: [gnu]
1515
cmake_build_type: [Release]
1616
minimal: [false]
@@ -50,7 +50,7 @@ jobs:
5050
key: ${{ steps.setup.outputs.cache_key }}
5151
restore-keys: ${{ steps.setup.outputs.cache_restore_key }}
5252
- name: CMake
53-
run: mkdir builddir && cd builddir && cmake ${{ steps.setup.outputs.cmake_args }} ../votca
53+
run: cmake -B builddir ${{ steps.setup.outputs.cmake_args }} votca
5454
- name: Build
5555
run: |
5656
ccache -z

.github/workflows/copyright.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Copyright
2+
on:
3+
issue_comment:
4+
types: [created]
5+
jobs:
6+
edit:
7+
name: Copyright
8+
if: ${{ github.event.comment.body == '@votca-bot copyright' }}
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check if message comes from PR
12+
uses: octokit/request-action@v2.x
13+
id: issue_info
14+
with:
15+
route: GET /repos/:repository/issues/:pull_number
16+
repository: ${{ github.repository }}
17+
pull_number: ${{ github.event.issue.number }}
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
- name: Get PR info
20+
if: ${{ fromJSON(steps.issue_info.outputs.data).pull_request }}
21+
uses: octokit/request-action@v2.x
22+
id: pr_info
23+
with:
24+
route: GET /repos/:repository/pulls/:pull_number
25+
repository: ${{ github.repository }}
26+
pull_number: ${{ github.event.issue.number }}
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
- name: Checkout head branch from PR
29+
if: ${{ fromJSON(steps.issue_info.outputs.data).pull_request }}
30+
uses: actions/checkout@v2.2.0
31+
with:
32+
repository: ${{ fromJSON(steps.pr_info.outputs.data).head.repo.full_name }}
33+
ref: ${{ fromJSON(steps.pr_info.outputs.data).head.ref }}
34+
fetch-depth: 0
35+
token: ${{ secrets.VOTCA_BOT_TOKEN }}
36+
- name: Create and commit copyright updates
37+
if: ${{ fromJSON(steps.issue_info.outputs.data).pull_request }}
38+
uses: votca/actions/copyright@master
39+
with:
40+
base: ${{ fromJSON(steps.pr_info.outputs.data).base.sha }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
*~
2+
.ipynb_checkpoints
3+
.cache
4+
__pycache__

CMakeLists.txt

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
1-
cmake_minimum_required(VERSION 3.1)
1+
cmake_minimum_required(VERSION 3.12)
22

3-
project(xtp-tutorials)
3+
project(xtp-tutorials LANGUAGES NONE)
44

5-
set(PROJECT_VERSION "1.6.4")
5+
set(PROJECT_VERSION "2021-dev")
66

77
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules)
8+
# not used, but stops GNUInstallDirs.cmake from warning
9+
set(CMAKE_INSTALL_LIBDIR "lib64")
810
include(GNUInstallDirs)
11+
include(FeatureSummary)
912

1013
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ DESTINATION ${CMAKE_INSTALL_DATADIR}/votca/xtp-tutorials
1114
PATTERN ".git*" EXCLUDE
1215
PATTERN "CMake*" EXCLUDE PATTERN "cmake_install.cmake" EXCLUDE
1316
PATTERN "install_manifest.txt" EXCLUDE PATTERN "*~" EXCLUDE)
1417

15-
configure_file(${CMAKE_MODULE_PATH}/cmake_uninstall.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake IMMEDIATE @ONLY)
18+
configure_file(${PROJECT_SOURCE_DIR}/CMakeModules/cmake_uninstall.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake IMMEDIATE @ONLY)
19+
1620
option(ENABLE_TESTING "Test if cmake worked" OFF)
21+
1722
if(ENABLE_TESTING)
1823
enable_testing()
1924
add_test(regression_xtp-tutorial_UninstallExists ${CMAKE_COMMAND} -DFileToCheck=${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
@@ -26,3 +31,5 @@ if(NOT TARGET uninstall)
2631
add_custom_target(uninstall)
2732
endif()
2833
add_dependencies(uninstall uninstall-xtp-tutorials)
34+
35+
add_subdirectory(share/doc)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Find jupyter nbconvert
2+
#
3+
# This will define
4+
#
5+
# JUPYTER_NBCONVERT_FOUND - Jupyter and nbsphinx python modules are installed
6+
#
7+
# Copyright 2009-2020 The VOTCA Development Team (http://www.votca.org)
8+
#
9+
# Licensed under the Apache License, Version 2.0 (the "License");
10+
# you may not use this file except in compliance with the License.
11+
# You may obtain a copy of the License at
12+
#
13+
# http://www.apache.org/licenses/LICENSE-2.0
14+
#
15+
# Unless required by applicable law or agreed to in writing, software
16+
# distributed under the License is distributed on an "AS IS" BASIS,
17+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
# See the License for the specific language governing permissions and
19+
# limitations under the License.
20+
#
21+
22+
find_program(JUPYTER_EXECUTABLE NAMES jupyter DOC "Interactive computing environment (https://jupyter.org/)")
23+
24+
if(JUPYTER_EXECUTABLE)
25+
execute_process(COMMAND ${JUPYTER_EXECUTABLE} nbconvert --version
26+
OUTPUT_VARIABLE nbconvert_version
27+
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
28+
if(${nbconvert_version} MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$")
29+
set(JUPYTER_NBCONVERT_VERSION ${nbconvert_version})
30+
else()
31+
set(JUPYTER_NBCONVERT_VERSION 0.0)
32+
endif()
33+
endif()
34+
35+
include(FindPackageHandleStandardArgs)
36+
find_package_handle_standard_args(JUPYTER_NBCONVERT REQUIRED_VARS JUPYTER_EXECUTABLE VERSION_VAR JUPYTER_NBCONVERT_VERSION)

CMakeModules/FindSPHINX.cmake

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Find sphinx-build
2+
#
3+
# This will define
4+
#
5+
# SPHINX_FOUND - Sphinx documentation builder is installed
6+
#
7+
# Copyright 2009-2020 The VOTCA Development Team (http://www.votca.org)
8+
#
9+
# Licensed under the Apache License, Version 2.0 (the "License");
10+
# you may not use this file except in compliance with the License.
11+
# You may obtain a copy of the License at
12+
#
13+
# http://www.apache.org/licenses/LICENSE-2.0
14+
#
15+
# Unless required by applicable law or agreed to in writing, software
16+
# distributed under the License is distributed on an "AS IS" BASIS,
17+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
# See the License for the specific language governing permissions and
19+
# limitations under the License.
20+
#
21+
find_program(SPHINX_EXECUTABLE NAMES sphinx-build DOC "Sphinx documentation generation tool (http://www.sphinx-doc.org/)")
22+
23+
if(SPHINX_EXECUTABLE)
24+
execute_process(COMMAND ${SPHINX_EXECUTABLE} --version
25+
OUTPUT_VARIABLE sphinx_version
26+
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
27+
if(sphinx_version MATCHES "^sphinx-build .*")
28+
string(REGEX
29+
REPLACE "sphinx-build ([.0-9]+).*"
30+
"\\1"
31+
SPHINX_VERSION
32+
"${sphinx_version}")
33+
else()
34+
set(SPHINX_VERSION 0.0)
35+
endif()
36+
else()
37+
set(SPHINX_VERSION 0.0)
38+
endif()
39+
message(status "SPHINX_VERSION:${SPHINX_VERSION}")
40+
41+
include(FindPackageHandleStandardArgs)
42+
find_package_handle_standard_args(SPHINX REQUIRED_VARS SPHINX_EXECUTABLE VERSION_VAR SPHINX_VERSION)
Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# Kinetic Monte Carlo Using Gromacs"
8+
]
9+
},
10+
{
11+
"cell_type": "markdown",
12+
"metadata": {},
13+
"source": [
14+
"## Requirements\n",
15+
"* You will need to install **VOTCA** using the instructions described [here](https://github.com/votca/votca/blob/master/share/doc/INSTALL.rst)\n",
16+
"* Once the installation is completed you need to activate the VOTCA enviroment by running the `VOTCARC.bash` script that has been installed at the `bin` subfolder for the path that you have provided for the installation step above"
17+
]
18+
},
19+
{
20+
"cell_type": "markdown",
21+
"metadata": {},
22+
"source": [
23+
"## Setting the environment\n",
24+
"Create a folder to store the input `Options` for XTP"
25+
]
26+
},
27+
{
28+
"cell_type": "code",
29+
"execution_count": null,
30+
"metadata": {},
31+
"outputs": [],
32+
"source": [
33+
"!mkdir -p OPTIONFILES"
34+
]
35+
},
36+
{
37+
"cell_type": "markdown",
38+
"metadata": {},
39+
"source": [
40+
"### Notes\n",
41+
"> * The `${VOTCASHARE}` environmental variable is set to the path that you provided during the VOTCA installation, by the default is set to `/usr/local/votca`.\n",
42+
"> * In Jupyter the `!` symbol means: *run the following command as a standard unix command*\n",
43+
"> * In Jupyter the command `%env` set an environmental variable"
44+
]
45+
},
46+
{
47+
"cell_type": "markdown",
48+
"metadata": {},
49+
"source": [
50+
"## KMC simulations of multiple holes or electrons in periodic boundary conditions\n",
51+
"Lets copy the default options for KMC in our local input folder,"
52+
]
53+
},
54+
{
55+
"cell_type": "code",
56+
"execution_count": null,
57+
"metadata": {},
58+
"outputs": [],
59+
"source": [
60+
"!cp $VOTCASHARE/xtp/xml/kmcmultiple.xml OPTIONFILES"
61+
]
62+
},
63+
{
64+
"cell_type": "markdown",
65+
"metadata": {},
66+
"source": [
67+
"You should have a *XML* file with the `kmcmultiple` options that looks like"
68+
]
69+
},
70+
{
71+
"cell_type": "code",
72+
"execution_count": null,
73+
"metadata": {},
74+
"outputs": [],
75+
"source": [
76+
"!head -n 10 OPTIONFILES/kmcmultiple.xml"
77+
]
78+
},
79+
{
80+
"cell_type": "markdown",
81+
"metadata": {},
82+
"source": [
83+
"We will use the following python function to change the input for the `kmcmultiple` calculator. We need to update the `kmcmultiple` options with the file containing the definition of the system. For doing, so we will use the python module `xml_editor`. The first argument is the name of the calculator (i.e. `kmcmultiple`), the seconds argument is the name of the option to change and the third one, the value to use.\n",
84+
"\n",
85+
"For a detailed description of the available options have a look at [kmcmultiple options and defaults](https://votca.github.io/kmcmultiple.html)"
86+
]
87+
},
88+
{
89+
"cell_type": "code",
90+
"execution_count": null,
91+
"metadata": {},
92+
"outputs": [],
93+
"source": [
94+
"from xml_editor import edit_calculator\n",
95+
"edit_calculator(\"kmcmultiple\", \"runtime\", \"100\")\n",
96+
"edit_calculator(\"kmcmultiple\", \"outputtime\", \"10\")\n",
97+
"edit_calculator(\"kmcmultiple\", \"field\", \"0 0 0\")\n",
98+
"edit_calculator(\"kmcmultiple\", \"carriertype\", \"singlet\")\n",
99+
"edit_calculator(\"kmcmultiple\", \"rates\", \"calculate\")"
100+
]
101+
},
102+
{
103+
"cell_type": "markdown",
104+
"metadata": {},
105+
"source": [
106+
"Now we can run the KMC simulation as follows,"
107+
]
108+
},
109+
{
110+
"cell_type": "code",
111+
"execution_count": null,
112+
"metadata": {},
113+
"outputs": [],
114+
"source": [
115+
"!xtp_run -e kmcmultiple -o OPTIONFILES/kmcmultiple.xml -f state.hdf5"
116+
]
117+
},
118+
{
119+
"cell_type": "markdown",
120+
"metadata": {},
121+
"source": [
122+
"## Perform Kinetic Monte Carlo simulations of singlets with decay\n",
123+
"Let us first copy the defaults and change just the `numberofinsertions`. For a complete description of the calculators options see [kmclifetime options and defaults](https://votca.github.io/kmclifetime.html)."
124+
]
125+
},
126+
{
127+
"cell_type": "code",
128+
"execution_count": null,
129+
"metadata": {},
130+
"outputs": [],
131+
"source": [
132+
"!cp $VOTCASHARE/xtp/xml/kmclifetime.xml OPTIONFILES/\n",
133+
"edit_calculator(\"kmclifetime\", \"numberofinsertions\", \"5\")"
134+
]
135+
},
136+
{
137+
"cell_type": "markdown",
138+
"metadata": {},
139+
"source": [
140+
"Finally, we run the calculation using the `lifetimes.xml` file that we have created by hand,"
141+
]
142+
},
143+
{
144+
"cell_type": "code",
145+
"execution_count": null,
146+
"metadata": {},
147+
"outputs": [],
148+
"source": [
149+
"!xtp_run -e kmclifetime -o OPTIONFILES/kmclifetime.xml -f state.hdf5"
150+
]
151+
}
152+
],
153+
"metadata": {
154+
"kernelspec": {
155+
"display_name": "Python 3",
156+
"language": "python",
157+
"name": "python"
158+
},
159+
"language_info": {
160+
"codemirror_mode": {
161+
"name": "ipython",
162+
"version": 3
163+
},
164+
"file_extension": ".py",
165+
"mimetype": "text/x-python",
166+
"name": "python",
167+
"nbconvert_exporter": "python",
168+
"pygments_lexer": "ipython3",
169+
"version": "3.8.3"
170+
}
171+
},
172+
"nbformat": 4,
173+
"nbformat_minor": 4
174+
}

0 commit comments

Comments
 (0)