MCPcopy Create free account
hub / github.com/numpy/numpy / convert_datetime_metadata_to_tuple

Function convert_datetime_metadata_to_tuple

numpy/core/src/multiarray/datetime.c:1778–1794  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1776
1777
1778NPY_NO_EXPORT PyObject *
1779convert_datetime_metadata_to_tuple(PyArray_DatetimeMetaData *meta)
1780{
1781 PyObject *dt_tuple;
1782
1783 dt_tuple = PyTuple_New(2);
1784 if (dt_tuple == NULL) {
1785 return NULL;
1786 }
1787
1788 PyTuple_SET_ITEM(dt_tuple, 0,
1789 PyUnicode_FromString(_datetime_strings[meta->base]));
1790 PyTuple_SET_ITEM(dt_tuple, 1,
1791 PyLong_FromLong(meta->num));
1792
1793 return dt_tuple;
1794}
1795
1796/*
1797 * Converts a metadata tuple into a datetime metadata C struct.

Callers 1

array_datetime_dataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected