Skip to content

Commit

Permalink
Merge pull request #327 from StochSS/develop
Browse files Browse the repository at this point in the history
Release v1.1.2
  • Loading branch information
briandrawert committed Dec 22, 2022
2 parents 414b8c9 + f35fd77 commit 4d7b5c4
Show file tree
Hide file tree
Showing 35 changed files with 13,592 additions and 1,845 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/pylint_on_pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: PyLint On Pull Request
on: [pull_request]
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Set Up Python
uses: actions/setup-python@v2
- name: Install PyLint
run: pip install --upgrade pylint
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Checkout Head
run: git checkout $HEAD_REF
env:
HEAD_REF: ${{ github.event.pull_request.head.ref }}
- name: Checkout Base
run: git checkout $BASE_REF
env:
BASE_REF: ${{ github.event.pull_request.base.ref }}
- name: Get Base Lint Score
run: |
echo BASE_LINT=$(git diff --name-only --diff-filter=M $HEAD_REF | grep -E "\.py" | xargs pylint | grep -E -o "at [0-9.-]+" | grep -E -o [0-9.-]+) >> $GITHUB_ENV
env:
HEAD_REF: ${{ github.event.pull_request.head.ref }}
if: always()
- name: Set Base Lint to 0
run: echo BASE_LINT=0 >> $GITHUB_ENV
if: env.BASE_LINT == ''
- name: Checkout Head
run: git checkout $HEAD_REF
env:
HEAD_REF: ${{ github.event.pull_request.head.ref }}
- name: Get Head Lint Score
run: |
echo HEAD_LINT=$(git diff --name-only --diff-filter=M $BASE_REF | grep -E "\.py" | xargs pylint | grep -E -o "at [0-9.-]+" | grep -E -o [0-9.-]+) >> $GITHUB_ENV
env:
BASE_REF: ${{ github.event.pull_request.base.ref }}
if: always()
- name: Set Head Lint to 0
run: echo HEAD_LINT=0 >> $GITHUB_ENV
if: env.HEAD_LINT == ''
- name: Get Added Files Lint Score
run: |
echo ADDED_LINT=$(git diff --name-only --diff-filter=A $BASE_REF | grep -E "\.py" | xargs pylint | grep -E -o "at [0-9.-]+" | grep -E -o [0-9.-]+) >> $GITHUB_ENV
env:
BASE_REF: ${{ github.event.pull_request.base.ref }}
if: always()
- name: Get Delta
run: |
import os
base = float(os.environ['BASE_LINT'])
head = float(os.environ['HEAD_LINT'])
delta = head - base
os.popen(f"echo DELTA={round(delta, 2)} >> $GITHUB_ENV")
shell: python
- name: Display Results
run: |
echo "Lint of modified files in base:"
echo ${{ env.BASE_LINT }}
echo "Lint of modified files in head:"
echo ${{ env.HEAD_LINT }}
echo "Delta (+/-):"
echo ${{ env.DELTA }}
echo "Lint of files added by head:"
echo ${{ env.ADDED_LINT }}
if: always()
- name: Fail If Negative Delta
run: |
import os
if float(os.environ['HEAD_LINT']) < 9 and float(os.environ['DELTA']) < 0:
raise Exception("Head lint score < 9 and negative delta.")
shell: python
46 changes: 46 additions & 0 deletions .github/workflows/update-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Publish SpatialPy Docs

on:
push:
branches: [main]

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Initialize environment
uses: actions/checkout@v2
with:
ref: main
fetch-depth: 0

- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.7'

- name: Install Sphinx Dependency
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -U sphinx
python3 -m pip install numpy
python3 -m pip install -r requirements.txt
- name: Update the Docs
working-directory: docs
run: |
make build-docs
- name: Commit Changes
working-directory: docs
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
make commit-docs
- name: Push Changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main
27 changes: 18 additions & 9 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,25 +84,34 @@ autobuild: $(FORMAT)
clean:
rm -rf "$(BUILDDIR)"

publish:
build-docs:
git pull
make clean
git stash
git checkout gh-pages
git checkout main
make html

commit-docs:
-git add -f "$(BUILDDIR)"
-git commit -m "Latest build." "$(BUILDDIR)"
git push origin gh-pages -f
make clean
git checkout @{-1}
git stash pop
-git commit -m "Latest docs build." "$(BUILDDIR)"

publish-release: publish
publish:
make clean
git stash
git checkout main
git pull
git checkout staging
make html
-git add -f "$(BUILDDIR)"
-git commit -m "Latest docs build." "$(BUILDDIR)"
git push origin staging -f
make clean
git checkout gh-pages
git pull origin staging
git push origin gh-pages -f
git checkout @{-2}
git stash pop

publish-release: build-docs commit-docs
git push origin main -f
make clean
git checkout @{-1}
Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 8b8c7260a070827b00291bef99cea017
config: aa9a9a3c9380df45ffa4c7a40b7ba182
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file modified docs/build/html/.doctrees/classes/spatialpy.core.doctree
Binary file not shown.
Binary file modified docs/build/html/.doctrees/classes/spatialpy.doctree
Binary file not shown.
Binary file modified docs/build/html/.doctrees/classes/spatialpy.solvers.doctree
Binary file not shown.
Binary file modified docs/build/html/.doctrees/classes/spatialpy.stochss.doctree
Binary file not shown.
Binary file modified docs/build/html/.doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/build/html/.doctrees/index.doctree
Binary file not shown.
8 changes: 5 additions & 3 deletions docs/build/html/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Overview: module code &#8212; SpatialPy 1.1.0 documentation</title>
<title>Overview: module code &#8212; SpatialPy 1.1.2 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="../_static/alabaster.css" />
<link rel="stylesheet" type="text/css" href="../_static/css/spatialpy_alabaster_customizations.css" />
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/sphinx_highlight.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />

Expand Down Expand Up @@ -71,7 +73,7 @@ <h3 id="searchlabel">Quick search</h3>
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
<script>document.getElementById('searchbox').style.display = "block"</script>



Expand Down Expand Up @@ -128,7 +130,7 @@ <h1>All modules for which code is available</h1>
&copy;Copyright (C) 2019-2022.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 4.4.0</a>
Powered by <a href="http://sphinx-doc.org/">Sphinx 5.3.0</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>

</div>
Expand Down
134 changes: 134 additions & 0 deletions docs/build/html/_static/_sphinx_javascript_frameworks_compat.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
/*
* _sphinx_javascript_frameworks_compat.js
* ~~~~~~~~~~
*
* Compatability shim for jQuery and underscores.js.
*
* WILL BE REMOVED IN Sphinx 6.0
* xref RemovedInSphinx60Warning
*
*/

/**
* select a different prefix for underscore
*/
$u = _.noConflict();


/**
* small helper function to urldecode strings
*
* See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL
*/
jQuery.urldecode = function(x) {
if (!x) {
return x
}
return decodeURIComponent(x.replace(/\+/g, ' '));
};

/**
* small helper function to urlencode strings
*/
jQuery.urlencode = encodeURIComponent;

/**
* This function returns the parsed url parameters of the
* current request. Multiple values per key are supported,
* it will always return arrays of strings for the value parts.
*/
jQuery.getQueryParameters = function(s) {
if (typeof s === 'undefined')
s = document.location.search;
var parts = s.substr(s.indexOf('?') + 1).split('&');
var result = {};
for (var i = 0; i < parts.length; i++) {
var tmp = parts[i].split('=', 2);
var key = jQuery.urldecode(tmp[0]);
var value = jQuery.urldecode(tmp[1]);
if (key in result)
result[key].push(value);
else
result[key] = [value];
}
return result;
};

/**
* highlight a given string on a jquery object by wrapping it in
* span elements with the given class name.
*/
jQuery.fn.highlightText = function(text, className) {
function highlight(node, addItems) {
if (node.nodeType === 3) {
var val = node.nodeValue;
var pos = val.toLowerCase().indexOf(text);
if (pos >= 0 &&
!jQuery(node.parentNode).hasClass(className) &&
!jQuery(node.parentNode).hasClass("nohighlight")) {
var span;
var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg");
if (isInSVG) {
span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
} else {
span = document.createElement("span");
span.className = className;
}
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
node.parentNode.insertBefore(span, node.parentNode.insertBefore(
document.createTextNode(val.substr(pos + text.length)),
node.nextSibling));
node.nodeValue = val.substr(0, pos);
if (isInSVG) {
var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect");
var bbox = node.parentElement.getBBox();
rect.x.baseVal.value = bbox.x;
rect.y.baseVal.value = bbox.y;
rect.width.baseVal.value = bbox.width;
rect.height.baseVal.value = bbox.height;
rect.setAttribute('class', className);
addItems.push({
"parent": node.parentNode,
"target": rect});
}
}
}
else if (!jQuery(node).is("button, select, textarea")) {
jQuery.each(node.childNodes, function() {
highlight(this, addItems);
});
}
}
var addItems = [];
var result = this.each(function() {
highlight(this, addItems);
});
for (var i = 0; i < addItems.length; ++i) {
jQuery(addItems[i].parent).before(addItems[i].target);
}
return result;
};

/*
* backward compatibility for jQuery.browser
* This will be supported until firefox bug is fixed.
*/
if (!jQuery.browser) {
jQuery.uaMatch = function(ua) {
ua = ua.toLowerCase();

var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
/(webkit)[ \/]([\w.]+)/.exec(ua) ||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
/(msie) ([\w.]+)/.exec(ua) ||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
[];

return {
browser: match[ 1 ] || "",
version: match[ 2 ] || "0"
};
};
jQuery.browser = {};
jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true;
}

0 comments on commit 4d7b5c4

Please sign in to comment.