Optimize interface a python basic#843
Merged
dmitry-kabanov merged 58 commits intoMaRDI4NFDI:mainfrom Jan 28, 2026
Merged
Conversation
b7192db to
f6b8df7
Compare
…ected arguments matches
…h stricter tolerances
…th tighter tolerances
…to keep reference
Somehow, this small refactoring took too much time, and I still do not quite understand why. For some reason, the reference to the sysconfig module must be preserved.
…r backward compatibility
…ting it each time
…object For some reason, this problem has never manifested itself before, although it is clear from the code that I have the same fix for a Python OIF_CALLBACK object. When I have started to work on the `optim` interface, this reference deficit started to happen quite often, hence the fix with `Py_INCREF`. Reference deficit is when a `PyObject *` does not have its refcount incremented enough times.
…ointers If the user passes to `oif_create_array_f64` for the `dimensions` parameter a stack-allocated array, then it can easily happen that in the created array the field `dimensions` will be a dangling pointer at some point. To prevent this, we copy the passed array so that it stays with the array during its lifetime.
…imensions I really do not know how this thing were working before: Python was using 32-bit integers while C and Julia 64-bit integers to represent dimensions of an array. How they were able to convert them, remains unknown.
f6b8df7 to
1009373
Compare
2c5ad6f to
413e47b
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Optiminterface and a Python implementation usingscipy.optimize.