Skip to content
Snippets Groups Projects
Unverified Commit c1434c9e authored by Wolfgang Merkt's avatar Wolfgang Merkt Committed by GitHub
Browse files

Fix flake8 errors (#318)


* Fix flake8 errors

* flake8: ignore E203

* flake8: 119 cols for now

* black

* fix comment style

* exclude cmake.py

* clang-format: sort include

Co-authored-by: default avatarGuilhem Saurel <guilhem.saurel@laas.fr>
parent ad7d1fed
No related branches found
No related tags found
No related merge requests found
Pipeline #21864 passed with warnings
......@@ -5,7 +5,7 @@ repos:
rev: v14.0.6
hooks:
- id: clang-format
args: ['--style={BasedOnStyle: Google, SortIncludes: false}']
args: [--style=Google]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
......
......@@ -7,6 +7,7 @@ EigenPy — Efficient Python bindings between Numpy/Eigen
<a href="https://anaconda.org/conda-forge/eigenpy"><img src="https://img.shields.io/conda/dn/conda-forge/eigenpy.svg" alt="Conda Downloads"/></a>
<a href="https://anaconda.org/conda-forge/eigenpy"><img src="https://img.shields.io/conda/vn/conda-forge/eigenpy.svg" alt="Conda Version"/></a>
<a href="https://badge.fury.io/py/eigenpy"><img src="https://badge.fury.io/py/eigenpy.svg" alt="PyPI version"></a>
<a href="https://github.com/psf/black"><img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code style: black"></a>
</p>
**EigenPy** is an open source framework which allows to bind the famous [Eigen](http://eigen.tuxfamily.org) C++ library in Python.
......
......@@ -3,8 +3,8 @@ from __future__ import print_function
import eigenpy
import numpy as np
import time
import timeit
import time # noqa
import timeit # noqa
from IPython import get_ipython
......
......@@ -2,5 +2,5 @@
# Copyright (c) 2017-2021 CNRS INRIA
#
from .eigenpy_pywrap import *
from .eigenpy_pywrap import __version__, __raw_version__
from .eigenpy_pywrap import * # noqa
from .eigenpy_pywrap import __version__, __raw_version__ # noqa
[flake8]
extend-ignore = E203
max-line-length = 88
exclude = cmake/.docs/cmake.py
......@@ -6,6 +6,7 @@
#include <iostream>
#include "eigenpy/eigenpy.hpp"
// include main header first
#include "eigenpy/eigen-from-python.hpp"
using namespace Eigen;
......
import eigenpy
import numpy as np
import numpy.linalg as la
dim = 100
A = np.random.rand(dim, dim)
......
from __future__ import print_function
import numpy as np
from complex import *
from complex import switchToNumpyArray, real, imag, ascomplex
switchToNumpyArray()
......
from __future__ import print_function
import eigenpy
import numpy as np
quat = eigenpy.Quaternion()
# By default, we convert as numpy.matrix
......
import numpy as np
from eigen_ref import *
from eigen_ref import (
printMatrix,
asRef,
asConstRef,
fill,
getBlock,
editBlock,
modify_block,
has_ref_member,
)
def test(mat):
......
from __future__ import print_function
from geometry import *
from geometry import (
AngleAxis,
Quaternion,
testOutAngleAxis,
testInAngleAxis,
testOutQuaternion,
testInQuaternion,
)
import numpy as np
from numpy import cos, sin
from numpy import cos
verbose = True
......
......@@ -21,7 +21,7 @@ def test_shared(mat):
try:
m_const_ref.fill(2)
assert False
except:
except Exception:
assert True
......@@ -43,7 +43,7 @@ def test_not_shared(mat):
try:
m_const_ref.fill(2)
assert True
except:
except Exception:
assert False
......
import eigenpy
eigenpy.switchToNumpyArray()
import numpy as np
import numpy.linalg as la
eigenpy.switchToNumpyArray()
dim = 100
A = np.random.rand(dim, dim)
......
......@@ -14,11 +14,12 @@ def test(dtype):
assert (mat == mat_copy).all()
assert not (mat != mat_copy).all()
# if version.parse(np.__version__) >= version.parse("1.21.0"): # check if it fixes for new versio of NumPy
# mat.fill(mat.dtype.type(20.))
# mat_copy = mat.copy()
# assert((mat == mat_copy).all())
# assert(not (mat != mat_copy).all())
# if version.parse(np.__version__) >= version.parse("1.21.0"):
# # check if it fixes for new version of NumPy
# mat.fill(mat.dtype.type(20.0))
# mat_copy = mat.copy()
# assert (mat == mat_copy).all()
# assert not (mat != mat_copy).all()
mat_op = mat + mat
mat_op = mat.copy(order="F") + mat.copy(order="C")
......@@ -28,7 +29,7 @@ def test(dtype):
mat_op = mat.dot(mat.T)
mat_op = mat / mat
mat_op = -mat
mat_op = -mat # noqa
assert (mat >= mat).all()
assert (mat <= mat).all()
......@@ -47,7 +48,7 @@ def test_cast(from_dtype, to_dtype):
np.can_cast(from_dtype, to_dtype)
from_mat = np.zeros((rows, cols), dtype=from_dtype)
to_mat = from_mat.astype(dtype=to_dtype)
to_mat = from_mat.astype(dtype=to_dtype) # noqa
test(user_type.CustomDouble)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment