checks.pyx 588 B

123456789101112131415161718192021222324252627282930
  1. """
  2. Functions in this module give python-space wrappers for cython functions
  3. exposed in numpy/__init__.pxd, so they can be tested in test_cython.py
  4. """
  5. cimport numpy as cnp
  6. cnp.import_array()
  7. def is_td64(obj):
  8. return cnp.is_timedelta64_object(obj)
  9. def is_dt64(obj):
  10. return cnp.is_datetime64_object(obj)
  11. def get_dt64_value(obj):
  12. return cnp.get_datetime64_value(obj)
  13. def get_td64_value(obj):
  14. return cnp.get_timedelta64_value(obj)
  15. def get_dt64_unit(obj):
  16. return cnp.get_datetime64_unit(obj)
  17. def is_integer(obj):
  18. return isinstance(obj, (cnp.integer, int))