-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
fix(types): remove newlines from docstring signature #4735
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
c89e5b2
Remove newlines from docstring signature
JeanElsner 214b200
Jean/dev (#1)
JeanElsner 99cd8d0
style: pre-commit fixes
pre-commit-ci[bot] f795b7e
Don't use std::find_if for C++ 11 compatibility
JeanElsner 9640613
Avoid implicit char to bool conversion
JeanElsner 293e6e2
Merge branch 'pybind:master' into jean/patch/argval
JeanElsner d8e7d2d
Test default arguments for line breaks
JeanElsner 418bdef
style: pre-commit fixes
pre-commit-ci[bot] 4521195
Separate Eigen tests
JeanElsner d47aa39
style: pre-commit fixes
pre-commit-ci[bot] 7a9382a
Fix merge
JeanElsner 15196d1
Merge branch 'pybind:master' into jean/patch/argval
JeanElsner 5d7e555
Try importing numpy
JeanElsner a2d675f
Avoid unreferenced variable in catch block
JeanElsner 035a044
style: pre-commit fixes
pre-commit-ci[bot] 19a8d51
Update squash function
JeanElsner 122e15a
Reduce try block
JeanElsner e6be9d5
Additional test cases
JeanElsner 1b5a3d7
style: pre-commit fixes
pre-commit-ci[bot] 4c844d5
Merge branch 'pybind:master' into jean/patch/argval
JeanElsner 9918f22
Put statement inside braces
JeanElsner 25c9657
Move string into function body
JeanElsner 0ea0a13
Rename repr for better readability. Make constr explicit.
JeanElsner a2add0d
Add multiline string default argument test case
JeanElsner 1a9dd7b
style: pre-commit fixes
pre-commit-ci[bot] d53892c
Add std namespace, do not modify string repr
JeanElsner 9cefda8
Test for all space chars, test str repr not modified
JeanElsner 68c5643
Merge branch 'pybind:master' into jean/patch/argval
JeanElsner d3885da
Merge branch 'pybind:master' into jean/patch/argval
JeanElsner b391386
Merge branch 'pybind:master' into jean/patch/argval
JeanElsner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -330,6 +330,23 @@ TEST_SUBMODULE(eigen_matrix, m) { | |
m.def("dense_c", [mat]() -> DenseMatrixC { return DenseMatrixC(mat); }); | ||
m.def("dense_copy_r", [](const DenseMatrixR &m) -> DenseMatrixR { return m; }); | ||
m.def("dense_copy_c", [](const DenseMatrixC &m) -> DenseMatrixC { return m; }); | ||
// test_defaults | ||
bool have_numpy = true; | ||
try { | ||
py::module_::import("numpy"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Awesome that this works on all platforms. But this is a very large Could you please try if it still works like this:
|
||
} catch (const py::error_already_set &) { | ||
have_numpy = false; | ||
} | ||
if (have_numpy) { | ||
py::module_::import("numpy"); | ||
Eigen::Matrix<double, 3, 3> defaultMatrix = Eigen::Matrix3d::Identity(); | ||
m.def( | ||
"defaults_mat", [](const Eigen::Matrix3d &) {}, py::arg("mat") = defaultMatrix); | ||
|
||
Eigen::VectorXd defaultVector = Eigen::VectorXd::Ones(32); | ||
m.def( | ||
"defaults_vec", [](const Eigen::VectorXd &) {}, py::arg("vec") = defaultMatrix); | ||
} | ||
// test_sparse, test_sparse_signature | ||
m.def("sparse_r", [mat]() -> SparseMatrixR { | ||
// NOLINTNEXTLINE(clang-analyzer-core.uninitialized.UndefReturn) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please sprinkle
\r
,\f
,\v
into the tests below?What we want is that a test fails if any of the characters here is accidentally lost. (Imagine a silly typo slipping in while refactoring.)