File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -338,16 +338,22 @@ struct char_to_explicit_char<false>
338338template <typename TargetType>
339339std::optional<TargetType> tryCast (py::object const &obj)
340340{
341+ std::cout << " tryCast<" << determineDatatype<TargetType>() << " >()"
342+ << std::endl;
341343 try
342344 {
343- return obj.cast <TargetType>();
345+ auto res = obj.cast <TargetType>();
346+ std::cout << " \t SUCCESS" << std::endl;
347+ return res;
344348 }
345349 catch (py::cast_error const &)
346350 {
351+ std::cout << " \t FAILURE 1" << std::endl;
347352 return std::nullopt ;
348353 }
349354 catch (py::value_error const &err)
350355 {
356+ std::cout << " \t FAILURE 2" << std::endl;
351357 return std::nullopt ;
352358 }
353359}
@@ -427,6 +433,11 @@ bool setAttributeFromObject(
427433 pybind11::dtype datatype)
428434{
429435 Datatype requestedDatatype = dtype_from_numpy (datatype);
436+ std::cout << " Setting attribute '" << key << " ' with type "
437+ << obj.get_type () << " ' and requested type " << datatype
438+ << " , i.e. openPMD type " << requestedDatatype << " \n\t 'char' is "
439+ << (std::is_signed_v<char > ? " signed" : " unsigned" )
440+ << " on the platform" << std::endl;
430441 return switchNonVectorType<SetAttributeFromObject>(
431442 requestedDatatype, attr, key, obj);
432443}
You can’t perform that action at this time.
0 commit comments