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

python3Packages.clifford: fix tests #98404

Closed
wants to merge 1 commit into from

Conversation

drewrisinger
Copy link
Contributor

Motivation for this change
  • Tests failed using nose.
  • Switched to pytest b/c that's what the official travis builds run.
  • Disabled slow and/or flaky tests as needed.
  • Changed patching from preConfigure to postPatch

ZHF: #97479

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

* Tests failed using nose.
* Switched to pytest b/c that's what the official travis builds run.
* Disabled slow and/or flaky tests as needed.
* Changed patching from preConfigure to postPatch
Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure why, but it fails:

  clifford/test/test_cga.py .......x.......xx....x/nix/store/gnylh7dnvw9rcaz4y64f89z6x69rkcz2-pytest-check-hook/nix-support/setup-hook: line 40:    62 Aborted                 (core dumped) /nix/store/z65l1jqvxa58zzwwa3bvglb6asj4y8cv-python3-3.8.5/bin/python3.8 -m pytest -k "not test_iterative_model_match and not test_estimate_rotor and not test_estimate_motor and not test_array_control and not test_clustering and not test_write_and_read and not test_assign_objects_to_objects and not test_general_logarithm_conformal and not test_get_properties_of_sphere and not test_get_midpoint_between_lines" --pyargs clifford --benchmark-skip -m 'not veryslow'
cannot build derivation '/nix/store/gcfmri4ic7g7bsks63wbnzjhm3ca109z-env.drv': 1 dependencies couldn't be built
[1 built (1 failed), 0.0 MiB DL]
error: build of '/nix/store/gcfmri4ic7g7bsks63wbnzjhm3ca109z-env.drv' failed
https://github.com/NixOS/nixpkgs/pull/98404
1 package failed to build:
python38Packages.clifford

1 package built:
python37Packages.clifford

@risicle
Copy link
Contributor

risicle commented Sep 21, 2020

Test failure on macos 10.14 for me with python 3.8:

============================= test session starts ==============================
platform darwin -- Python 3.8.5, pytest-5.4.3, py-1.9.0, pluggy-0.13.1
benchmark: 3.2.2 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /private/tmp/nix-build-python3.8-clifford-1.3.1.drv-0/clifford-1.3.1, inifile: setup.cfg
plugins: benchmark-3.2.2
collected 432 items / 47 deselected / 385 selected

clifford/test/test_algebra_initialisation.py sssssss                     [  1%]
clifford/test/test_aliases.py .........                                  [  4%]
clifford/test/test_bit_helpers.py ..                                     [  4%]
clifford/test/test_cga.py .......x.......xx....x/nix/store/kld0w0jn0iq86h0n5vnvbza3lkqrq1fk-pytest-check-hook/nix-support/setup-hook: line 40: 41866 Abort trap: 6           /nix/store/cp9nlaz4a24n8sp9f738ngdnrd19s4rp-python3-3.8.5/bin/python3.8 -m pytest -k "not test_iterative_model_match and not test_estimate_rotor and not test_estimate_motor and not test_array_control and not test_clustering and not test_write_and_read and not test_assign_objects_to_objects and not test_general_logarithm_conformal and not test_get_properties_of_sphere and not test_get_midpoint_between_lines" --pyargs clifford --benchmark-skip -m 'not veryslow'

@drewrisinger
Copy link
Contributor Author

Test failure on macos 10.14 for me with python 3.8:

============================= test session starts ==============================
platform darwin -- Python 3.8.5, pytest-5.4.3, py-1.9.0, pluggy-0.13.1
benchmark: 3.2.2 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /private/tmp/nix-build-python3.8-clifford-1.3.1.drv-0/clifford-1.3.1, inifile: setup.cfg
plugins: benchmark-3.2.2
collected 432 items / 47 deselected / 385 selected

clifford/test/test_algebra_initialisation.py sssssss                     [  1%]
clifford/test/test_aliases.py .........                                  [  4%]
clifford/test/test_bit_helpers.py ..                                     [  4%]
clifford/test/test_cga.py .......x.......xx....x/nix/store/kld0w0jn0iq86h0n5vnvbza3lkqrq1fk-pytest-check-hook/nix-support/setup-hook: line 40: 41866 Abort trap: 6           /nix/store/cp9nlaz4a24n8sp9f738ngdnrd19s4rp-python3-3.8.5/bin/python3.8 -m pytest -k "not test_iterative_model_match and not test_estimate_rotor and not test_estimate_motor and not test_array_control and not test_clustering and not test_write_and_read and not test_assign_objects_to_objects and not test_general_logarithm_conformal and not test_get_properties_of_sphere and not test_get_midpoint_between_lines" --pyargs clifford --benchmark-skip -m 'not veryslow'

Strange @risicle, can replicate. investigating.

@risicle
Copy link
Contributor

risicle commented Sep 21, 2020

The python 3.7 version fails for me too on linux x86_64:

============================= test session starts ==============================
platform linux -- Python 3.7.9, pytest-5.4.3, py-1.9.0, pluggy-0.13.1
benchmark: 3.2.2 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /build/clifford-1.3.1, inifile: setup.cfg
plugins: benchmark-3.2.2
collected 432 items / 47 deselected / 385 selected

clifford/test/test_algebra_initialisation.py sssssss                     [  1%]
clifford/test/test_aliases.py .........                                  [  4%]
clifford/test/test_bit_helpers.py ..                                     [  4%]
clifford/test/test_cga.py .......x.......xx....xxx.xx.                   [ 11%]
clifford/test/test_clifford.py ......................................... [ 22%]
.........................................                                [ 33%]
clifford/test/test_degenerate.py ....                                    [ 34%]
clifford/test/test_dg3c.py ..........                                    [ 36%]
clifford/test/test_dpga.py .......                                       [ 38%]
clifford/test/test_g3c_CUDA.py ssssssssssssss                            [ 42%]
clifford/test/test_g3c_tools.py .....F.................................. [ 52%]
...............................x............ssss                         [ 65%]
clifford/test/test_io.py .                                               [ 65%]
clifford/test/test_layout.py ......                                      [ 67%]
clifford/test/test_layout_helpers.py .............                       [ 70%]
clifford/test/test_parser.py .........                                   [ 72%]
clifford/test/test_tools.py ssss........                                 [ 75%]
clifford/test/test_tools_classify.py ................................... [ 84%]
...................................................                      [ 98%]
clifford/test/test_transformations.py .......                            [100%]

=================================== FAILURES ===================================
_____________ TestGeneralLogarithm.test_general_logarithm_rotation _____________

self = <clifford.test.test_g3c_tools.TestGeneralLogarithm object at 0x7fffd5841550>

    def test_general_logarithm_rotation(self):
        # Check we can reverse rotations
        for i in range(50):
            R = random_rotation_rotor()
            biv_2 = general_logarithm(R)
            biv_3 = ga_log(R)
>           assert_allclose(biv_2.value, biv_3.value)
E           AssertionError: 
E           Not equal to tolerance rtol=0.0001, atol=1e-06
E           
E           Mismatched elements: 3 / 32 (9.38%)
E           Max absolute difference: 1.18097551
E           Max relative difference: 0.99991057
E            x: array([-0.000000e+00, -0.000000e+00, -0.000000e+00, -0.000000e+00,
E                  -0.000000e+00, -0.000000e+00, -1.056186e-04, -7.419946e-05,
E                  -0.000000e+00, -0.000000e+00,  5.538197e-05, -0.000000e+00,...
E            y: array([ 0.      ,  0.      ,  0.      ,  0.      ,  0.      ,  0.      ,
E                  -1.181081, -0.829737,  0.      ,  0.      ,  0.61931 ,  0.      ,
E                   0.      ,  0.      ,  0.      ,  0.      ,  0.      ,  0.      ,...

clifford/test/test_g3c_tools.py:101: AssertionError
=============================== warnings summary ===============================
clifford/test/test_cga.py::test_from_points_construction[flat]
  /build/clifford-1.3.1/clifford/_multivector.py:262: RuntimeWarning: divide by zero encountered in true_divide
    newValue = self.value / other

clifford/test/test_cga.py::test_from_points_construction[flat]
clifford/test/test_clifford.py::TestBasicConformal41::test_categorization
  /build/clifford-1.3.1/clifford/_multivector.py:262: RuntimeWarning: invalid value encountered in true_divide
    newValue = self.value / other

clifford/test/test_cga.py::test_from_points_construction[flat]
  /build/clifford-1.3.1/clifford/_multivector.py:552: RuntimeWarning: invalid value encountered in subtract
    if (np.absolute(self.value - other.value) < _settings._eps).all():

clifford/test/test_io.py::TestParseMultivector::test_parse_multivector
  /build/clifford-1.3.1/clifford/test/test_io.py:16: UserWarning: Parentheses are not parsed, behavior may be surprising
    B = layout.parse_multivector(str(A))

-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED clifford/test/test_g3c_tools.py::TestGeneralLogarithm::test_general_logarithm_rotation
= 1 failed, 346 passed, 29 skipped, 47 deselected, 9 xfailed, 5 warnings in 344.41s (0:05:44) =

@drewrisinger
Copy link
Contributor Author

drewrisinger commented Sep 27, 2020

I rebuilt this on Friday via nix-review on Linux x86_64 (Windows Subsystem for Linux), and got a clean build. Not sure why this failed. Would anyone be able to try rebuilding?

1 package built:
python37Packages.clifford

EDIT: whoops, apparently must have missed the scroll up to get the python38Package.

@jonringer
Copy link
Contributor

[1 built (1 failed), 2 copied (0.9 MiB), 0.2 MiB DL]
error: build of '/nix/store/71hk7918w2pmmv4p92ri4x4fvlbdk8d2-env.drv' failed
https://github.com/NixOS/nixpkgs/pull/98404
1 package failed to build:
python38Packages.clifford

1 package built:
python37Packages.clifford

unfortunately, the python38 failure isn't very useful:

/nix/store/gnylh7dnvw9rcaz4y64f89z6x69rkcz2-pytest-check-hook/nix-support/setup-hook: line 40:    62 Aborted                 (core dumped) /nix/store/z65l1jqvxa58zzwwa3bvglb6asj4y8cv-python3-3.8.5/bin/python...

@drewrisinger
Copy link
Contributor Author

Closing because fixed in d65aba6

@drewrisinger drewrisinger deleted the zhf/py-clifford branch October 7, 2020 13:10
@jonringer
Copy link
Contributor

jonringer commented Oct 7, 2020

oh yea, sorry.

I just wanted to fix all the reverse dependencies

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

Successfully merging this pull request may close these issues.

None yet

3 participants