Skip to content

Commit

Permalink
v0.6 as seen on pypi (#1197)
Browse files Browse the repository at this point in the history
  • Loading branch information
bqpd authored Nov 3, 2017
1 parent 029c5df commit 413abe2
Show file tree
Hide file tree
Showing 15 changed files with 55 additions and 82 deletions.
2 changes: 1 addition & 1 deletion checkpy3.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cp gpkit/env/settings .
sed -i '1s/.*/installed_solvers : mosek_cli/' gpkit/env/settings
cat gpkit/env/settings
python3 -c "import gpkit.tests; gpkit.tests.helpers.run_tests(gpkit.tests.t_examples.TESTS)"
python3 -c docs/source/examples/simpleflight.py
mv settings gpkit/env
26 changes: 9 additions & 17 deletions docs/source/autodoc/gpkit.constraints.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,10 @@ gpkit.constraints.costed module
:undoc-members:
:show-inheritance:

gpkit.constraints.geometric_program module
------------------------------------------
gpkit.constraints.gp module
---------------------------

.. automodule:: gpkit.constraints.geometric_program
:members:
:undoc-members:
:show-inheritance:

gpkit.constraints.linked module
-------------------------------

.. automodule:: gpkit.constraints.linked
.. automodule:: gpkit.constraints.gp
:members:
:undoc-members:
:show-inheritance:
Expand Down Expand Up @@ -76,18 +68,18 @@ gpkit.constraints.set module
:undoc-members:
:show-inheritance:

gpkit.constraints.sigeq module
------------------------------
gpkit.constraints.sgp module
----------------------------

.. automodule:: gpkit.constraints.sigeq
.. automodule:: gpkit.constraints.sgp
:members:
:undoc-members:
:show-inheritance:

gpkit.constraints.signomial_program module
------------------------------------------
gpkit.constraints.sigeq module
------------------------------

.. automodule:: gpkit.constraints.signomial_program
.. automodule:: gpkit.constraints.sigeq
:members:
:undoc-members:
:show-inheritance:
Expand Down
20 changes: 14 additions & 6 deletions docs/source/autodoc/gpkit.nomials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ gpkit.nomials.array module
:undoc-members:
:show-inheritance:

gpkit.nomials.core module
-------------------------

.. automodule:: gpkit.nomials.core
:members:
:undoc-members:
:show-inheritance:

gpkit.nomials.data module
-------------------------

Expand All @@ -20,18 +28,18 @@ gpkit.nomials.data module
:undoc-members:
:show-inheritance:

gpkit.nomials.nomial_core module
--------------------------------
gpkit.nomials.map module
------------------------

.. automodule:: gpkit.nomials.nomial_core
.. automodule:: gpkit.nomials.map
:members:
:undoc-members:
:show-inheritance:

gpkit.nomials.nomial_math module
--------------------------------
gpkit.nomials.math module
-------------------------

.. automodule:: gpkit.nomials.nomial_math
.. automodule:: gpkit.nomials.math
:members:
:undoc-members:
:show-inheritance:
Expand Down
3 changes: 3 additions & 0 deletions docs/source/autodoc/gpkit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ Glossary

*For an alphabetical listing of all commands, check out the* :ref:`genindex`

gpkit package
=============

Subpackages
-----------

Expand Down
2 changes: 1 addition & 1 deletion docs/source/citinggpkit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ If you use GPkit, please cite it with the following bibtex::
title={GPkit software for geometric programming},
howpublished={\url{https://github.com/convexengineering/gpkit}},
year={2017},
note={Version 0.5.3}
note={Version 0.6.0}
}
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
# built documents.
#
# The short X.Y version.
version = '0.5'
version = '0.6'
# The full version, including alpha/beta/rc tags.
release = '0.5.3'
release = '0.6.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
6 changes: 6 additions & 0 deletions docs/source/releasenotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ Release Notes

This page lists the changes made in each point version of gpkit.

Version 0.6.0
=============
* new much faster NomialMap data structure (#682)
* Many bug fixes and small improvements.
* 6900 lines of code, 2200 lines of tests, 2100 lines of docstring.

Version 0.5.3
=============
* faster SP solves (#1109)
Expand Down
2 changes: 1 addition & 1 deletion gpkit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from os.path import dirname as os_path_dirname
SETTINGS_PATH = os_sep.join([os_path_dirname(__file__), "env", "settings"])

__version__ = "0.5.3"
__version__ = "0.6.0"
UNIT_REGISTRY = None
SIGNOMIALS_ENABLED = False
GPBLU = "#59ade4"
Expand Down
2 changes: 1 addition & 1 deletion gpkit/constraints/gp.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def _get_solver(solver):
nu=solver_out["nu"], la=solver_out["la"])
except RuntimeWarning as e:
if warn_on_check:
print "Solution check warning:", str(e)
print("Solution check warning: %s" % e)
else:
raise e
if verbosity > 1:
Expand Down
10 changes: 5 additions & 5 deletions gpkit/constraints/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ def debug(self, solver=None, verbosity=1, **solveargs):
solveargs["solver"] = solver
solveargs["verbosity"] = verbosity - 1

print "< DEBUGGING >"
print "> Trying with bounded variables and relaxed constants:"
print("< DEBUGGING >")
print("> Trying with bounded variables and relaxed constants:")

if self.substitutions:
constsrelaxed = ConstantsRelaxed(Bounded(self))
Expand Down Expand Up @@ -183,10 +183,10 @@ def debug(self, solver=None, verbosity=1, **solveargs):
% (orig, mag(self.substitutions[orig]),
mag(sol(orig))))
print
print ">> Success!"
print(">> Success!")
except (ValueError, RuntimeWarning):
print(">> Failure.")
print "> Trying with relaxed constraints:"
print("> Trying with relaxed constraints:")

try:
constrsrelaxed = ConstraintsRelaxed(self)
Expand All @@ -207,7 +207,7 @@ def debug(self, solver=None, verbosity=1, **solveargs):
" to %s <= %.4g"
% (i, relax_percent, constraint.right,
constraint.right, relaxval))
print "\n>> Success!"
print("\n>> Success!")
except (ValueError, RuntimeWarning):
print(">> Failure")
print
Expand Down
17 changes: 8 additions & 9 deletions gpkit/small_classes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Miscellaneous small classes"""
from collections import namedtuple
from operator import xor
import numpy as np
from . import ureg
Expand All @@ -12,7 +11,6 @@

Quantity = ureg.Quantity
Numbers = (int, float, np.number, Quantity)
CootMatrixTuple = namedtuple('CootMatrix', ['row', 'col', 'data'])


class Count(object):
Expand All @@ -36,16 +34,17 @@ def to_(self): # used in tocoo, tocsc, etc below
return to_


class CootMatrix(CootMatrixTuple):
class CootMatrix(object):
"A very simple sparse matrix representation."
def __init__(self, *args, **kwargs):
# pylint:disable=non-parent-init-called
# pylint:disable=super-init-not-called
# TODO these pylint disables go away with removal of namedtuple
CootMatrixTuple.__init__(self, *args, **kwargs)
def __init__(self, row, col, data):
self.row, self.col, self.data = row, col, data
self.shape = [(max(self.row) + 1) if self.row else 0,
(max(self.col) + 1) if self.col else 0]

def __eq__(self, other):
return (self.row == other.row and self.col == other.col
and self.data == other.data and self.shape == other.shape)

def append(self, row, col, data):
"Appends entry to matrix."
if row < 0 or col < 0:
Expand Down Expand Up @@ -207,7 +206,7 @@ def copy(self):

def __hash__(self):
"Allows HashVectors to be used as dictionary keys."
# pylint:disable=access-member-before-definition, attribute-defined-outside-init
# pylint:disable=access-member-before-definition, attribute-defined-outside-init
if not hasattr(self, "_hashvalue") or self._hashvalue is None:
self._hashvalue = reduce(xor, map(hash, self.items()), 0)
return self._hashvalue
Expand Down
2 changes: 1 addition & 1 deletion gpkit/solution_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def table(self, showvars=(),
def plot(self, posys=None, axes=None):
"Plots a sweep for each posy"
if len(self["sweepvariables"]) != 1:
print "SolutionArray.plot only supports 1-dimensional sweeps"
print("SolutionArray.plot only supports 1-dimensional sweeps")
if not hasattr(posys, "__len__"):
posys = [posys]
for i, posy in enumerate(posys):
Expand Down
4 changes: 2 additions & 2 deletions gpkit/tools/autosweep.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ def autosweep_1d(model, logtol, sweepvar, bounds, **solvekwargs):
tol = recurse_splits(model, bst, sweepvar, logtol, solvekwargs, sols)
bst.nsols = sols() # pylint: disable=attribute-defined-outside-init
if solvekwargs["verbosity"] > -1:
print "Solved after %2i passes, cost logtol +/-%.3g" % (bst.nsols, tol)
print "Autosweeping took %.3g seconds." % (time() - start_time)
print("Solved in %2i passes, cost logtol +/-%.3g" % (bst.nsols, tol))
print("Autosweeping took %.3g seconds." % (time() - start_time))
if original_val:
model.substitutions[sweepvar] = original_val
else:
Expand Down
35 changes: 0 additions & 35 deletions nomenclature.py

This file was deleted.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
author_email="[email protected]",
url="https://www.github.com/convexengineering/gpkit",
install_requires=["numpy >= 1.8.1", "pint", "scipy"],
version="0.5.3.0",
version="0.6.0.0",
packages=["gpkit", "gpkit._mosek", "gpkit.tests", "gpkit.interactive",
"gpkit.nomials", "gpkit.constraints", "gpkit.tools"],
package_data={"gpkit": ["pint/*", "env/*"],
Expand Down

0 comments on commit 413abe2

Please sign in to comment.