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

Some tests fail #80

Closed
yurivict opened this issue Sep 14, 2018 · 9 comments
Closed

Some tests fail #80

yurivict opened this issue Sep 14, 2018 · 9 comments

Comments

@yurivict
Copy link

yurivict commented Sep 14, 2018

Tests fail in the FreeBSD port:

======================================================================
ERROR: Failure: ImportError (cannot import name _spglib)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/local/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/local/lib/python2.7/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/usr/ports/science/py-phonopy/work-py27/phonopy-1.13.2.107/test/structure/test_grid_points.py", line 4, in <module>
    from phonopy.structure.grid_points import GridPoints
  File "/usr/ports/science/py-phonopy/work-py27/phonopy-1.13.2.107/phonopy/__init__.py", line 36, in <module>
    from phonopy.api_phonopy import Phonopy
  File "/usr/ports/science/py-phonopy/work-py27/phonopy-1.13.2.107/phonopy/api_phonopy.py", line 40, in <module>
    from phonopy.structure.symmetry import Symmetry
  File "/usr/ports/science/py-phonopy/work-py27/phonopy-1.13.2.107/phonopy/structure/symmetry.py", line 37, in <module>
    import phonopy.structure.spglib as spg
  File "/usr/ports/science/py-phonopy/work-py27/phonopy-1.13.2.107/phonopy/structure/spglib.py", line 35, in <module>
    from phonopy import _spglib as spg
ImportError: cannot import name _spglib
@atztogo
Copy link
Collaborator

atztogo commented Sep 14, 2018

How do you run this test?

@yurivict
Copy link
Author

I run nosetests in the freshly rebuilt directory.

@atztogo
Copy link
Collaborator

atztogo commented Sep 14, 2018

Like % python setup.py test?
As far as I see the traceback, your build didn't go well, i.e., a C module _spglib is not compiled or installed properly. I don't have FreeBSD environment.

@atztogo
Copy link
Collaborator

atztogo commented Oct 17, 2018

Is there any news?

@yurivict
Copy link
Author

It installs _spglib.so:

/usr/local/lib/python2.7/site-packages/phonopy/_spglib.so

but the tests fail.

They are run using python setup.py nosetests-2.7. It fails with python-3.6 too.

The FreeBSD port exists, but tests fail in it. I don't know where do I go from here.

@atztogo
Copy link
Collaborator

atztogo commented Oct 17, 2018

Do you know if your PYTHONPATH is correctly set?

@yurivict
Copy link
Author

I made it to run. It was actually running a command nosetests. Changing to python setup.py test helped.

Now one case fails:

======================================================================
FAIL: test_IXS_G_to_L (spectrum.test_dynamic_structure_factor.TestDynamicStructureFactor)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/ports/science/py-phonopy/work-py27/phonopy-1.13.2.107/test/spectrum/test_dynamic_structure_factor.py", line 102, in test_IXS_G_to_L
    S[:, i].sum(axis=1), data_cmp[:, i].sum(axis=1), atol=1e-1)
  File "/usr/local/lib/python2.7/site-packages/numpy/testing/_private/utils.py", line 1443, in assert_allclose
    verbose=verbose, header=header, equal_nan=equal_nan)
  File "/usr/local/lib/python2.7/site-packages/numpy/testing/_private/utils.py", line 780, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Not equal to tolerance rtol=1e-07, atol=0.1

(mismatch 10.0%)
 x: array([2.990558e+01, 8.017501e+00, 3.839426e+00, 2.339812e+00,
       1.633024e+00, 1.245578e+00, 7.558085e-05, 8.032014e-04,
       8.445302e-05, 1.604957e-01])
 y: array([2.990558e+01, 8.017501e+00, 3.839426e+00, 2.339812e+00,
       1.633024e+00, 1.245578e+00, 6.772900e-05, 3.625850e-04,
       2.829889e-02, 5.767737e-03])

----------------------------------------------------------------------
Ran 51 tests in 32.343s

FAILED (failures=1)

@atztogo
Copy link
Collaborator

atztogo commented Oct 17, 2018

Good!
Sorry, it's a known bug in the test script. See #79.
It was already fixed but it's not yet merged to master branch.

@yurivict
Copy link
Author

Thank you for your help!

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

2 participants