Skip to content

Vector substitution unit test error #1576

@whoburg

Description

@whoburg

Found two failing tests on a fresh install. One of is already captured in #1573; the other one in test_vector_sweep seems new.

Per the instructions printed after running import gpkit.tests, here is the output:

Found no installed solvers, beginning a build.
# Building GPkit version 1.1
# Moving to the directory from which GPkit was imported.

Attempting to find and build solvers:

# Looking for `mosek_cli`
#   (A "success" is if mskexpopt complains that
#    we haven't specified a file for it to open.)
#     Calling 'mskexpopt'
##
### CALL BEGINS
/bin/sh: mskexpopt: command not found
### CALL ENDS
##
# Looks like `mskexpopt` was not found in the default PATH,
#  so let's try locating that binary ourselves.
# expected MOSEK directory not found: /Users/serenity/mosek
# Did not find
# mosek_cli

# Looking for `mosek_conif`
#   Trying to import mosek...
# Did not find
# mosek_conif

# Looking for `cvxopt`
#   Trying to import cvxopt...

Found cvxopt in the default PYTHONPATH

Found the following solvers: cvxopt
#     Replacing directory env
..........................E...............................................................................................................................................E......................................
======================================================================
ERROR: test_vector_sweep (gpkit.tests.t_sub.TestModelSubs)
Test sweep involving VectorVariables
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/serenity/code/gpkit/gpkit/tests/t_sub.py", line 205, in test_vector_sweep
    sol = m.solve(verbosity=0)
  File "/Users/serenity/code/gpkit/gpkit/constraints/prog_factories.py", line 123, in solvefn
    constants, sweep, linked = parse_subs(self.varkeys, self.substitutions)
  File "/Users/serenity/code/gpkit/gpkit/nomials/substitution.py", line 25, in parse_subs
    append_sub(sub, keys, constants, sweep, linkedsweep)
  File "/Users/serenity/code/gpkit/gpkit/nomials/substitution.py", line 47, in append_sub
    sub = np.array(sub) if not hasattr(sub, "shape") else sub
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part.

======================================================================
ERROR: test_breakdowns_cvxopt (gpkit.tests.t_examples.TestExamples)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/serenity/code/gpkit/gpkit/tests/helpers.py", line 55, in test
    testfn(name, import_dict, path)(self)
  File "/Users/serenity/code/gpkit/gpkit/tests/helpers.py", line 90, in test
    imported[name] = importlib.import_module(name)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/serenity/code/gpkit/docs/source/examples/breakdowns.py", line 11, in <module>
    sol = pickle.load(open(dirpath+"solar_13.p", "rb"))
ModuleNotFoundError: No module named 'pint.quantity'

----------------------------------------------------------------------
Ran 209 tests in 20.246s

FAILED (errors=2)

GPkit is now installed with solver(s) ['cvxopt']
To incorporate new solvers at a later date, run `gpkit.build()`.

If any tests didn't pass, please post the output above
(starting from "Found no installed solvers, beginning a build.")
to gpkit@mit.edu or https://github.com/convexengineering/gpkit/issues/new
so we can prevent others from having these errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions