Skip to content

Commit

Permalink
About to release v0.3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
bjodah committed Aug 13, 2018
1 parent d9c3aac commit c9bdf43
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 22 deletions.
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
v0.3.4
======
- DenseMatrix got 2 new methods:
- sparse_jacobian_csc
- sparse_jacobian_csr

v0.3.3
======
- Backend now support ``cse`` & ``ccode`` for symengine
Expand Down
6 changes: 3 additions & 3 deletions scripts/post_release.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash -xeu
# Usage:
#
# $ ./scripts/post_release.sh v1.2.3 myserver githubuser
# $ ./scripts/post_release.sh v1.2.3 githubuser myserver
#
VERSION=${1#v}
SERVER=$2
GITHUBUSER=$3
GITHUBUSER=$2
SERVER=$3
PKG=$(find . -maxdepth 2 -name __init__.py -print0 | xargs -0 -n1 dirname | xargs basename)
PKG_UPPER=$(echo $PKG | tr '[:lower:]' '[:upper:]')
SDIST_FILE=dist/${PKG}-$VERSION.tar.gz
Expand Down
16 changes: 4 additions & 12 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
#!/bin/bash -xeu
# Usage:
#
# $ ./scripts/release.sh v1.2.3 ~/anaconda2/bin myserver.example.com GITHUB_USER GITHUB_REPO
# $ ./scripts/release.sh v1.2.3 GITHUB_USER GITHUB_REPO
#

if [[ $1 != v* ]]; then
echo "Argument does not start with 'v'"
exit 1
fi
VERSION=${1#v}
CONDA_PATH=$2
SERVER=$3
find . -type f -iname "*.pyc" -exec rm {} +
find . -type f -iname "*.o" -exec rm {} +
find . -type f -iname "*.so" -exec rm {} +
Expand All @@ -24,14 +22,8 @@ PKG_UPPER=$(echo $PKG | tr '[:lower:]' '[:upper:]')
./scripts/run_tests.sh
env ${PKG_UPPER}_RELEASE_VERSION=v$VERSION python3 setup.py sdist
if [[ -e ./scripts/generate_docs.sh ]]; then
env ${PKG_UPPER}_RELEASE_VERSION=v$VERSION ./scripts/generate_docs.sh # $4 ${5:-$PKG} v$VERSION
env ${PKG_UPPER}_RELEASE_VERSION=v$VERSION ./scripts/generate_docs.sh
fi
for CONDA_PY in 2.7 3.4 3.5; do
for CONDA_NPY in 1.11; do
continue # we build the conda recipe on another host for now..
PATH=$CONDA_PATH:$PATH ./scripts/build_conda_recipe.sh v$VERSION --python $CONDA_PY --numpy $CONDA_NPY
done
done

# All went well, add a tag and push it.
git tag -a v$VERSION -m v$VERSION
Expand All @@ -42,10 +34,10 @@ twine upload dist/${PKG}-$VERSION.tar.gz
set +x
echo ""
echo " You may now create a new github release at with the tag \"v$VERSION\", here is a link:"
echo " https://github.com/$4/${5:-$PKG}/releases/new "
echo " https://github.com/$2/${3:-$PKG}/releases/new "
echo " name the release \"${PKG}-${VERSION}\", and don't foreget to manually attach the file:"
echo " $(openssl sha256 $(pwd)/dist/${PKG}-${VERSION}.tar.gz)"
echo " Then run:"
echo ""
echo " $ ./scripts/post_release.sh $1 $SERVER $4"
echo " $ ./scripts/post_release.sh $1 $2 <server.uni.edu>"
echo ""
3 changes: 3 additions & 0 deletions scripts/update-gh-pages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ if [[ -d $tmpdir/.gh-pages-skeleton ]]; then
cp -r $tmpdir/.gh-pages-skeleton/. .
fi
if [[ "$tag" == v* ]]; then
if [[ -L latest ]]; then
rm latest
fi
ln -s $tag latest
commit_msg="Release docs for $tag"
else
Expand Down
16 changes: 10 additions & 6 deletions sym/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,21 @@ def sparse_jacobian_csc(self, exprs, dep):
""" Wraps Matrix/ndarray around results of .util.sparse_jacobian_csc """
jac_exprs, colptrs, rowvals = sparse_jacobian_csc(exprs, dep)
nnz = len(jac_exprs)
return self.Matrix(1, nnz, jac_exprs),\
np.asarray(colptrs, dtype=int),\
np.asarray(rowvals, dtype=int)
return (
self.Matrix(1, nnz, jac_exprs),
np.asarray(colptrs, dtype=int),
np.asarray(rowvals, dtype=int)
)

def sparse_jacobian_csr(self, exprs, dep):
""" Wraps Matrix/ndarray around results of .util.sparse_jacobian_csr """
jac_exprs, rowptrs, colvals = sparse_jacobian_csr(exprs, dep)
nnz = len(jac_exprs)
return self.Matrix(1, nnz, jac_exprs),\
np.asarray(rowptrs, dtype=int),\
np.asarray(colvals, dtype=int)
return (
self.Matrix(1, nnz, jac_exprs),
np.asarray(rowptrs, dtype=int),
np.asarray(colvals, dtype=int)
)


class _SymPy(_Base):
Expand Down
2 changes: 1 addition & 1 deletion sym/tests/test_sparse_jacobian.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ def test_sparse_jacobian_csc(key):
out = cb(inp)
assert np.allclose(out, [-1, 1, -1, 1])
assert np.all(rowptrs == np.array([0, 1, 3, 4], dtype=int))
assert np.all(colvals == np.array([0, 0, 1, 1], dtype=int))
assert np.all(colvals == np.array([0, 0, 1, 1], dtype=int))

0 comments on commit c9bdf43

Please sign in to comment.