Skip to content
Snippets Groups Projects

PyCore: Re-implementation of embedded Python as a separate module (Major change)

Merged Ammar Nejati requested to merge newEmbeddedPython into main
1 file
+ 3
2
Compare changes
  • Side-by-side
  • Inline
+ 3
2
@@ -214,6 +214,9 @@ PyObject* Datafield::npArray() const
Status init{PythonInterpreter::Numpy::initialize()};
if (init.isError())
return nullptr;
ASSERT(rank() <= 2);
std::vector<size_t> dimensions;
for (size_t i = 0; i < rank(); i++)
dimensions.push_back(axis(i).size());
@@ -246,8 +249,6 @@ PyObject* Datafield::npArray() const
} else if (rank() == 1) {
for (size_t i = 0; i < size(); ++i)
*array_buffer++ = (*this)[i];
} else {
return nullptr;
}
// returns a _new_ reference; ie. caller is responsible for the ref-count
Loading