Revision bd70db79eff31b1d953117fc73898c68f1d6860e authored by Mathis Gerdes on 10 April 2020, 06:16:53 UTC, committed by GitHub on 10 April 2020, 06:16:53 UTC
* Implement np.roots.

* Expose jit-compatible variant of np.roots.

General np.roots implementation has a value dependent output shape.
If the input coefficients are guaranteed to have no leading zeros,
output shape is independent of values. Skip checking for leading
zeros by setting a keyword argument.

* Fix typo.

* Make roots jit-argument keyword only.

Co-Authored-By: Stephan Hoyer <shoyer@google.com>

* Format docstring to enable parsing.

Co-Authored-By: Stephan Hoyer <shoyer@google.com>

* Add np.roots function to documentation.

* Add more tests for np.roots function.

- Include length 0 polynomial coefficients
- Test strip_zeros=False argument
- Test jit compiled version (only on cpu due to eigvals)
- Confirm that adding leading zeros while skipping check
  for them results in nan's (expected behavior)

* Fix bug in np.roots test.

The polynomial with coefficents [0] never fails because the number of
roots is 0.

* Avoid bug in eigvals and adjust test accuracy.

The parameters of the test that was changed are non-essential
since they test for how the code behaves given invalid inputs.

The accuracy in comparing to the numpy result is changed because
the algorithm in those cases is slightly changed with respect to
the original numpy algorithm (to allow jit).

Co-authored-by: Stephan Hoyer <shoyer@google.com>
1 parent 65692db
Raw File
pylintrc
[MASTER]

# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code
extension-pkg-whitelist=numpy


[MESSAGES CONTROL]

# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once).You can also use "--disable=all" to
# disable everything first and then reenable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=missing-docstring,
        too-many-locals,
        invalid-name,
        redefined-outer-name,
        redefined-builtin,
        protected-name,
        no-else-return,
        fixme,
        protected-access,
        too-many-arguments,
        blacklisted-name,
        too-few-public-methods,
        unnecessary-lambda,


# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
# multiple time (only on the command line, not in the configuration file where
# it should appear only once). See also the "--disable" option for examples.
enable=c-extension-no-member


[FORMAT]

# String used as indentation unit. This is usually "    " (4 spaces) or "\t" (1
# tab).
indent-string="  "
back to top