Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests don't find py3Dmol #293

Closed
yurivict opened this issue Jun 15, 2022 · 4 comments
Closed

Tests don't find py3Dmol #293

yurivict opened this issue Jun 15, 2022 · 4 comments

Comments

@yurivict
Copy link

2 tests always fail and the message about py3Dmol is printed:

==================================================================================== test session starts =====================================================================================
platform freebsd13 -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0
rootdir: /disk-samsung/freebsd-ports/science/py-qcelemental/work-py38/qcelemental-0.25.0
plugins: forked-1.4.0, hypothesis-6.47.0, xdist-2.5.0, cov-2.9.0, rerunfailures-10.1
collected 1066 items                                                                                                                                                                         

qcelemental/molutil/test_molutil.py .....................................                                                                                                              [  3%]
qcelemental/tests/test_constants.py .........................................x....                                                                                                     [  7%]
qcelemental/tests/test_covalentradii.py .........................                                                                                                                      [ 10%]
qcelemental/tests/test_datum.py ..............                                                                                                                                         [ 11%]
qcelemental/tests/test_importing.py ..........................                                                                                                                         [ 13%]
qcelemental/tests/test_info.py ........................................                                                                                                                [ 17%]
qcelemental/tests/test_model_general.py ........                                                                                                                                       [ 18%]
qcelemental/tests/test_model_results.py ............................................                                                                                                   [ 22%]
qcelemental/tests/test_molecule.py .............................................s...........                                                                                           [ 27%]
qcelemental/tests/test_molparse_align_chiral.py ..........                                                                                                                             [ 28%]
qcelemental/tests/test_molparse_from_schema.py ............                                                                                                                            [ 29%]
qcelemental/tests/test_molparse_from_string.py .....................................................................................................                                   [ 39%]
qcelemental/tests/test_molparse_parse_nucleus_label.py .............                                                                                                                   [ 40%]
qcelemental/tests/test_molparse_pubchem.py .........                                                                                                                                   [ 41%]
qcelemental/tests/test_molparse_reconcile_nucleus.py ...................................................                                                                               [ 46%]
qcelemental/tests/test_molparse_to_schema.py ..............                                                                                                                            [ 47%]
qcelemental/tests/test_molparse_to_string.py ................................                                                                                                          [ 50%]
qcelemental/tests/test_molparse_validate_and_fill_chgmult.py ...................................................................                                                       [ 56%]
qcelemental/tests/test_periodictable.py ....................................................................................................................x                          [ 67%]
qcelemental/tests/test_testing.py ............................................................                                                                                         [ 73%]
qcelemental/tests/test_units.py ...........................................................................................................................                            [ 84%]
qcelemental/tests/test_utils.py ........................................................................................                                                               [ 93%]
qcelemental/tests/test_vanderwaalsradii.py ........................                                                                                                                    [ 95%]
qcelemental/tests/test_zqcschema.py ssssssssssssssssssssssssssssssssssssssssss                                                                                                         [ 99%]
qcelemental/util/test_gph_uno_bipartite.py ....                                                                                                                                        [ 99%]
qcelemental/util/test_scipy_hungarian.py ..                                                                                                                                            [100%]

====================================================================================== warnings summary ======================================================================================
qcelemental/molutil/test_molutil.py::test_scramble_descrambles_chiral
qcelemental/molutil/test_molutil.py::test_model_b787
qcelemental/molutil/test_molutil.py::test_tropolone_b787
qcelemental/tests/test_molparse_align_chiral.py::test_simpleS
  /disk-samsung/freebsd-ports/science/py-qcelemental/work-py38/qcelemental-0.25.0/qcelemental/molutil/align.py:411: RuntimeWarning: invalid value encountered in reciprocal
    ccnremat = np.reciprocal(ccdistmat)

qcelemental/molutil/test_molutil.py::test_scramble_descrambles_chiral
qcelemental/molutil/test_molutil.py::test_model_b787
qcelemental/molutil/test_molutil.py::test_tropolone_b787
qcelemental/tests/test_molparse_align_chiral.py::test_simpleS
  /disk-samsung/freebsd-ports/science/py-qcelemental/work-py38/qcelemental-0.25.0/qcelemental/molutil/align.py:412: RuntimeWarning: invalid value encountered in reciprocal
    rrnremat = np.reciprocal(rrdistmat)

qcelemental/util/test_gph_uno_bipartite.py::test_example2[2]
  /usr/local/lib/python3.8/site-packages/scipy/sparse/_index.py:137: SparseEfficiencyWarning: Changing the sparsity structure of a csr_matrix is expensive. lil_matrix is more efficient.
    self._set_arrayXarray_sparse(i, j, x)

qcelemental/util/test_gph_uno_bipartite.py: 17 warnings
  /usr/local/lib/python3.8/site-packages/networkx/convert_matrix.py:680: DeprecationWarning: from_numpy_matrix is deprecated and will be removed in NetworkX 3.0.
  Use from_numpy_array instead, e.g. from_numpy_array(A, **kwargs)
    warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================================================================== short test summary info ===================================================================================
SKIPPED [1] qcelemental/tests/test_molecule.py:646: Not detecting module py3Dmol. Install package if necessary and add to envvar PYTHONPATH
SKIPPED [42] qcelemental/conftest.py:27: can't run with --validate option
================================================================= 1021 passed, 43 skipped, 2 xfailed, 26 warnings in 22.43s ==================================================================

Version: 0.25.0
py38-py3Dmol-1.8.0
FreeBSD 13.1

@loriab
Copy link
Collaborator

loriab commented Jun 16, 2022

Two tests "xfail" or expected fail, which is good.

On the py3Dmol, the environment must be failing import nglview, https://github.com/MolSSI/QCElemental/blob/master/qcelemental/tests/addons.py#L38, which would trigger that single test to skip. NGL is used for a single function, so it's not a required dependency.

@yurivict
Copy link
Author

On the py3Dmol, the environment must be failing import nglview [...]

So it should be listed in setup.py as a test dependency?

@loriab
Copy link
Collaborator

loriab commented Jun 16, 2022

So it should be listed in setup.py as a test dependency?

I'd think required test dependencies like pytest should be in tests in setup.py, which they are. The nglview is the "viz" variant in setup.py, https://github.com/MolSSI/QCElemental/blob/master/setup.py#L51-L53 . You can package qcel w/ or w/o the viz, but I expect nglview brings in a lot of extras (qcel alone is plain numpy, pint, and pydantic).

@coltonbh
Copy link
Collaborator

Fixed in #308 and further addressed in #310. Dependencies are now fully specified in (formerly setup.py in #308), now pyproject.tom in #310. All tests are passing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants