Skip to content

Commit

Permalink
add maintenance file
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiafarrell committed Nov 12, 2020
2 parents 9750b15 + 0f6004e commit e82c71f
Showing 1 changed file with 178 additions and 0 deletions.
178 changes: 178 additions & 0 deletions how_to_maintain.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"How to Maintain nestpy\n",
"--------------------------\n",
"Sophia Andaloro \n",
"<br>\n",
"Born: July 6, 2020\n",
"<br>\n",
"Last edit: November 11, 2020"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 1. Versioning and updating with NEST"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Run:\n",
"```\n",
"git clone [email protected]:NESTCollaboration/nestpy.git\n",
"```\n",
"Then go to website:\n",
"https://github.com/NESTCollaboration/nest/tags\n",
"To see which tag you want to bind to. In this case 'v2.1.2', so then you go to\n",
"`src/nestpy/__init__.py`\n",
"<br>\n",
"Then change the version:\n",
"<br>\n",
"`__nest_version__ = '2.1.2'`"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Then you have to install nestpy into some environment: <br>\n",
"`pip freeze | grep nest # no nestpy exists ` <br>\n",
"`python setup.py install`\n",
"<br>\n",
"such that:\n",
"```\n",
"python -c \"import nestpy;print(nestpy.__nest_version__)\"\n",
"```\n",
"Returns the version you want. Now run `sync.sh` (can run one at a time)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## sync.sh File:"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"```\n",
"# This script is used for syncing to the NEST main repository\n",
"# to ensure that the bindings bind to the same version of NEST\n",
"export VERSION=`python -c \"import nestpy;print(nestpy.__nest_version__)\"`\n",
"echo $VERSION \n",
"git clone https://github.com/NESTCollaboration/nest.git nest_source\n",
"cd nest_source\n",
"git fetch --all --tags --prune\n",
"git checkout tags/v${VERSION} -b test\n",
"cd ..\n",
"cd src/nestpy\n",
"for filename in *.{cpp,hh}; do\n",
" export REPO_FILE=`find ../../nest_source/ -name ${filename}`\n",
" if [ ! -z \"$REPO_FILE\" -a \"$REPO_FILE\" != \" \" ]; then\n",
" cp $REPO_FILE $filename\n",
" fi\n",
"done\n",
"cd ../..\n",
"#rm -Rf nest_source\n",
"#git commit -m \"Sync with $VERSION\" -a\n",
"```"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**For now, we have to go to execNEST function and put in the nuisparam and free params**:\n",
"```\n",
"NuisParam = {11.,1.1,0.0480,-0.0533,12.6,0.3,2.,0.3,2.,0.5,1., 1.};\n",
"FreeParam = {1.,1.,0.10,0.5,0.19,2.25};\n",
" ```"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Edit the histories "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"- Edit HISTORY with new versions\n",
"```\n",
"cd nestpy\n",
"nano HISTORY.md \n",
"git commit -m \"Edit HISTORY.md for v<version>\" HISTORY.md\n",
"nano src/nestpy/__init__.py\n",
"# Change the version of nestpy here \n",
"```\n",
"- Push changes\n",
"```\n",
"git push\n",
"bumpversion minor # or patch, or major, depending on versioning changes\n",
"git push --tags\n",
"```"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Then you'll want to go into travisCI and see if all checks complete on the commit "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Download custom nestpy"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"`pip install --user -U git+https://github.com/NESTCollaboration/nestpy.git` "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python [conda env:.conda-sophia]",
"language": "python",
"name": "conda-env-.conda-sophia-py"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.7"
}
},
"nbformat": 4,
"nbformat_minor": 4
}

0 comments on commit e82c71f

Please sign in to comment.