filetimes.sh 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/sh
  2. # Usage:
  3. # conda env create -f filetimes.yml
  4. # source activate filetimes
  5. # mkdir times
  6. # python -c "import filetimes as ft ; ft.p.base='census' ; ft.p.x='easting' ; ft.p.y='northing' ; ft.p.categories=['race']; ft.DD_FORCE_LOAD=True; ft.DEBUG=True; ft.timed_write('data/tinycensus.csv',dftype='pandas',fsize='double')"
  7. # # (dftype can also be 'dask', fsize can also be 'single')
  8. # ./filetimes.sh times/tinycensus
  9. # # (add a second argument to filetimes.sh to set the caching mode)
  10. # # (add a third argument to filetimes.sh to set the ft.DEBUG variable)
  11. #
  12. # More examples of filetimes.sh:
  13. # 1) Use no caching, but enable DEBUG messages:
  14. # ./filetimes.sh times/tinycensus '' debug
  15. # 2) Use "persist" caching mode:
  16. # ./filetimes.sh times/tinycensus persist
  17. # 3) Use "cachey" caching mode (force-loads dask dataframes), enable DEBUG messages:
  18. # ./filetimes.sh times/tinycensus cachey debug
  19. timer=/usr/bin/time
  20. timer="" # External timing disabled to avoid unhelpful "Command terminated abnormally" messages
  21. # Display each command if a third argument is provided
  22. test -n "$3" && set -x
  23. ${timer} python filetimes.py ${1}.parq dask census easting northing race ${3:+--debug} ${2:+--cache=$2}
  24. ${timer} python filetimes.py ${1}.snappy.parq dask census easting northing race ${3:+--debug} ${2:+--cache=$2}
  25. ${timer} python filetimes.py ${1}.gz.parq dask census easting northing race ${3:+--debug} ${2:+--cache=$2}
  26. ${timer} python filetimes.py ${1}.bcolz dask census easting northing race ${3:+--debug} ${2:+--cache=$2}
  27. ${timer} python filetimes.py ${1}.h5 dask census easting northing race ${3:+--debug} ${2:+--cache=$2}
  28. ${timer} python filetimes.py ${1}.csv dask census easting northing race ${3:+--debug} ${2:+--cache=$2}
  29. ${timer} python filetimes.py ${1}.feather dask census easting northing race ${3:+--debug} ${2:+--cache=$2}
  30. ${timer} python filetimes.py ${1}.parq pandas census easting northing race ${3:+--debug} ${2:+--cache=$2}
  31. ${timer} python filetimes.py ${1}.snappy.parq pandas census easting northing race ${3:+--debug} ${2:+--cache=$2}
  32. ${timer} python filetimes.py ${1}.gz.parq pandas census easting northing race ${3:+--debug} ${2:+--cache=$2}
  33. ${timer} python filetimes.py ${1}.bcolz pandas census easting northing race ${3:+--debug} ${2:+--cache=$2}
  34. ${timer} python filetimes.py ${1}.h5 pandas census easting northing race ${3:+--debug} ${2:+--cache=$2}
  35. ${timer} python filetimes.py ${1}.csv pandas census easting northing race ${3:+--debug} ${2:+--cache=$2}
  36. ${timer} python filetimes.py ${1}.feather pandas census easting northing race ${3:+--debug} ${2:+--cache=$2}