Skip to content

Commit

Permalink
Merge branch 'main' of github.com:lukevolpatti/qss
Browse files Browse the repository at this point in the history
  • Loading branch information
bmeyers committed Mar 28, 2023
2 parents a851389 + 5422012 commit 9a77a56
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:

deploy-conda:
runs-on: ubuntu-latest
environment: deployment
# sets default shell to remove need for source to run the conda shell
defaults:
run:
Expand All @@ -40,7 +41,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v3
with:
python-version: "3.6"
python-version: "3.9"

- name: Install Miniconda
uses: conda-incubator/setup-miniconda@v2
Expand Down Expand Up @@ -68,10 +69,10 @@ jobs:
conda config --set anaconda_upload no
echo yes | anaconda login --username ${{ secrets.ANACONDA_CLOUD_USERNAME }} --password ${{ secrets.ANACONDA_CLOUD_PASSWORD }}
git fetch --prune --unshallow --tags
VERSION_FROM_GIT_TAG=$(git tag --list "v*[0-9]" --sort=version:refname | tail -1 | cut -c 2-) conda build . -c conda-forge -c slacgismo --numpy 1.16.4
VERSION_FROM_GIT_TAG=$(git tag --list "v*[0-9]" --sort=version:refname | tail -1 | cut -c 2-) conda build . -c conda-forge -c stanfordcvxgrp --numpy 1.16.4
echo '::set-output name=gitversion::$(git tag --list "v*[0-9]" --sort=version:refname | tail -1 | cut -c 2-)'
- name: Upload the Anaconda Package
id: condaload
run: |
anaconda upload -u slacgismo /usr/share/miniconda3/conda-bld/noarch/solar-data-tools-${{ steps.mambabuild.outputs.gitversion }}-*.tar.bz2
anaconda upload -u stanfordcvxgrp /usr/share/miniconda3/conda-bld/noarch/qss-${{ steps.mambabuild.outputs.gitversion }}-*.tar.bz2
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v3
with:
python-version: "3.6"
python-version: "3.9"

- name: Install Miniconda
uses: conda-incubator/setup-miniconda@v2
Expand Down Expand Up @@ -91,5 +91,5 @@ jobs:
mamba install anaconda-client
conda config --set anaconda_upload no
git fetch --prune --unshallow --tags
VERSION_FROM_GIT_TAG=$(git tag --list "v*[0-9]" --sort=version:refname | tail -1 | cut -c 2-) conda build . -c conda-forge -c slacgismo --numpy 1.16.4
VERSION_FROM_GIT_TAG=$(git tag --list "v*[0-9]" --sort=version:refname | tail -1 | cut -c 2-) conda build . -c conda-forge -c stanfordcvxgrp --numpy 1.16.4
echo '::set-output name=gitversion::$(git tag --list "v*[0-9]" --sort=version:refname | tail -1 | cut -c 2-)'
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="qss",
version="0.1.4",
version="0.1.6",
author="Luke Volpatti",
description="QSS: Quadratic-Separable Solver",
long_description=long_description,
Expand Down
7 changes: 3 additions & 4 deletions tests/test_proximal.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ def test_prox(self):

def test_subdiff(self):
ls, rs = self.g.subdiff(np.ones(self.v.shape), 1, self.v)
res = ls == rs
return np.all(res == 0)
assert np.allclose(ls, rs)


class TestAbs:
Expand Down Expand Up @@ -163,7 +162,7 @@ def test_prox(self):
objective = cp.Minimize(cp.sum(cp.pos(x)) + rho / 2 * cp.norm(x - self.v1) ** 2)
# Use SCS as MOSEK gives slightly different answer
cp.Problem(objective).solve(solver=cp.SCS)
assert np.allclose(res_qss, x.value)
assert np.allclose(res_qss, x.value, atol=1e-4)

def test_subdiff(self):
ls, rs = self.g.subdiff(np.ones_like(self.v1), 1, self.v1)
Expand All @@ -185,7 +184,7 @@ def test_prox(self):
x = cp.Variable(len(self.v1))
objective = cp.Minimize(cp.sum(cp.neg(x)) + rho / 2 * cp.norm(x - self.v1) ** 2)
cp.Problem(objective).solve(solver=cp.SCS)
assert np.allclose(res_qss, x.value)
assert np.allclose(res_qss, x.value, atol=1e-4)

def test_subdiff(self):
ls, rs = self.g.subdiff(np.ones_like(self.v1), 1, self.v1)
Expand Down

0 comments on commit 9a77a56

Please sign in to comment.