|
| 1 | + |
| 2 | +.. _manage-data-files: |
| 3 | + |
| 4 | +Datafile Management |
| 5 | +=================== |
| 6 | + |
| 7 | +We provide a command line tool to optionally manage Grackle's datafiles. |
| 8 | + |
| 9 | +At a Quick Glance |
| 10 | +----------------- |
| 11 | + |
| 12 | +Currently, this command line tool is only accessible when :ref:`pygrackle is installed <install-pygrackle>`. |
| 13 | +To execute the tool execute |
| 14 | + |
| 15 | +.. code-block:: shell-session |
| 16 | +
|
| 17 | + $ python -m pygrackle <args>... |
| 18 | +
|
| 19 | +Where ``<args>...`` is replaced with one or more command-line arguments. |
| 20 | +For example, ``fetch`` will invoke a subcommand that downloads all associated files (if they aren't already downloaded). |
| 21 | +You can use the ``--help`` option to get a list of all subcommands. |
| 22 | +You can also pass the ``--help`` option after the name of a subcommand (e.g. you can use ``fetch --help``) to get more details about subcommand-specific options. |
| 23 | + |
| 24 | +.. note:: |
| 25 | + |
| 26 | + At the moment, this functionality is most useful for pygrackle. |
| 27 | + In the near future [#df1]_\ , it will be possible install pygrackle without manually downloading the grackle repository. |
| 28 | + At that time, this will be the most efficient way to retrieve the files. |
| 29 | + The pygrackle examples and some of the pygrackle tests rely upon this functionality. |
| 30 | + However, you are free to completely ignore this functionality for your own purposes. |
| 31 | + |
| 32 | + There is ongoing work to implement functionality for the Grackle C library to directly access the datafiles managed by this tool. |
| 33 | + When these efforts are finished, we plan to additionally provide this command-line-tool as a standalone program that is always installed alongside Grackle (so that you can access this functionality without installing pygrackle) |
| 34 | + |
| 35 | +Description |
| 36 | +----------- |
| 37 | + |
| 38 | +.. include:: ../../src/python/pygrackle/utilities/grdata.py |
| 39 | + :start-after: [[[BEGIN-SECTION:DESCRIPTION]]] |
| 40 | + :end-before: [[[END-SECTION:DESCRIPTION]]] |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | +Motivation |
| 45 | +---------- |
| 46 | + |
| 47 | +.. include:: ../../src/python/pygrackle/utilities/grdata.py |
| 48 | + :start-after: [[[BEGIN-SECTION:MOTIVATION]]] |
| 49 | + :end-before: [[[END-SECTION:MOTIVATION]]] |
| 50 | + |
| 51 | + |
| 52 | +How it works |
| 53 | +------------ |
| 54 | + |
| 55 | +.. include:: ../../src/python/pygrackle/utilities/grdata.py |
| 56 | + :start-after: [[[BEGIN-SECTION:INTERNALS-OVERVIEW]]] |
| 57 | + :end-before: [[[END-SECTION:INTERNALS-OVERVIEW]]] |
| 58 | + |
| 59 | + |
| 60 | +Sample Directory Structure |
| 61 | +++++++++++++++++++++++++++ |
| 62 | + |
| 63 | +Down below, we sketch out what the directory-structure might look like: |
| 64 | + |
| 65 | + |
| 66 | +.. literalinclude:: ../../src/python/pygrackle/utilities/grdata.py |
| 67 | + :language: none |
| 68 | + :start-after: [[[BEGIN:DIRECTORY-CARTOON]]] |
| 69 | + :end-before: [[[END:DIRECTORY-CARTOON]]] |
| 70 | + |
| 71 | + |
| 72 | +.. rubric:: Footnotes |
| 73 | + |
| 74 | +.. [#df1] Once `GH-#208 <https://github.com/grackle-project/grackle/pull/208>`__ is merged, you will be able to instruct pip to install pygrackle by just specifying the URL of the GitHub repository. |
| 75 | + We also have plans to upload pygrackle to pip. |
0 commit comments