Repository navigation
Conversation
QuLogic
left a comment
There was a problem hiding this comment.
If we could depend on C++20, we could directly use std::format, but that seems to not be portable yet and SciPy still hasn't recommended it.
Changing the call sites to a similar signature does seem a good idea for that future, whenever it may be.
(plus a bonus tab-to-space fix)
|
the coverage changes are real, so is there a way to mitigate that? even by using a no coverage pragma if it's not feasible to test? |
I think I need some guidance or explanation here. I don't understand how the coverage has changed, other than there are less lines now and thus the already-not-handled branch is now a greater percentage? |
story645
left a comment
There was a problem hiding this comment.
I like the namespacing, am concerned about the coverage (but also it could be a case of picking up stuff that wasn't ever covered)
commented before I saw your comment. Either that or it was left out of the initial coverage baseline and only got flagged in the coverage report b/c the code got changed. I think either this should get tests that those error messages get triggered or we can for now omit those files? Potentially a different discussion but we should maybe use a c++ coverage tool for the c++ so we can exclude specific c++ lines? |
|
I am not worried about the decrease in qhull_wrapper as it is in a branch where we had to get qhull initialization to fail and it is definitely not worth the effort to force that to get coverage on error-message formatting! |
My concern is coverage errors persisting and adding noise to the coverage reports going forward. |
I feel like we are all starting to ignore AppVeyor because it frequently times out at the hour mark. Should we prioritize #32395 or try to fix it some other way? |
PR summary
From yesterday's meeting, it sounds like nanobind is a direction that we want to take. I think it might be easier to create smaller PRs for "preparing the repository for nanobind" rather than one huge PR. I can still do the huge PR if people prefer.
This PR adds
mpl::format()to mplutils.h and uses it to format error messages rather than directly usingpybind11::str.Why?
nanobind's
strclass is simpler than pybind11's. There is no_sUDL nor implicit conversion tostd::string. Hence, when porting to nanobind, the following code:becomes:
With this PR, both the pybind11 and nanobind versions are the same:
This PR also makes the following changes:
mpl_roundgoes into themplnamespace and is renamed toround. As far as I can tell, thempl_prefix was due to including this file from pure C in the 2010's.mpl_round_to_intgoes into themplnamespace and is renamed toround_to_int.#ifdef __cplusplus // not for macosx.m. The old macOS backend doesn't include this file. The new macOS backend may include this file, but will do so from Objective-C++.#includes higher in the file. I wish they were at the top, but I wasn't sure if they needed to be placed after the#defineshenanigans.Note: more code will be added to the
mplnamespace in the future.AI Disclosure
The robot taught me how to use
std::forwardseveral months ago.PR quality check