Skip to content

Commit c6bef32

Browse files
committed
added init functions to docs and minor formatting updates
1 parent 86dc2bc commit c6bef32

7 files changed

+55
-22
lines changed

docs/backends.rst

+4
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,25 @@ SQLite
2525

2626
.. automodule:: dsi.backends.sqlite
2727
:members:
28+
:special-members: __init__
2829

2930
SQLAlchemy
3031
------
3132

3233
.. automodule:: dsi.backends.sqlalchemy
3334
:members:
35+
:special-members: __init__
3436

3537
GUFI
3638
------
3739

3840
.. automodule:: dsi.backends.gufi
3941
:members:
42+
:special-members: __init__
4043

4144
Parquet
4245
------
4346

4447
.. automodule:: dsi.backends.parquet
4548
:members:
49+
:special-members: __init__

docs/contributing_readers.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Example ``add_rows``: ::
5050

5151
self.add_to_output(my_data)
5252

53-
*Alternate* Add Rows: ``add_rows(self) -> None``
53+
*Newer* Add Rows: ``add_rows(self) -> None``
5454
-------------------------------------
5555
If you are confident that the the data you read in ``add_rows`` is in the form of an OrderedDict (the data structure used to store all ingested data), you can bypass the use of ``pack_header`` and ``add_to_output`` with an alternate ``set_schema`` function.
5656

docs/core.rst

+38-13
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Core
22
====
33

4-
The DSI Core middleware defines the Terminal concept. An instantiated Terminal is the human/machine DSI interface.
5-
The person setting up a Core Terminal only needs to know how they want to ask questions, and what metadata they want to ask questions about.
6-
If they don’t see an option to ask questions the way they like, or they don’t see the metadata they want to ask questions about, then they should ask a Backend Contributor or a Plugin Contributor, respectively.
4+
The DSI Core middleware defines the Terminal and Sync concept.
5+
An instantiated Terminal is the human/machine DSI interface to connect Reader/Writer plugins and DSI backends.
6+
An instantiated Sync supports data movement capabilities between local and remote locations and captures metadata documentation
77

88
Core: Terminal
99
--------------
@@ -24,43 +24,68 @@ Notes for users:
2424
- Terminal handles errors from any loaded DSI/user-written modules (plugins/backends). If writing an external plugin/backend, return a caught error as a tuple (error, error_message_string). Do not print in a new class
2525
.. autoclass:: dsi.core.Terminal
2626
:members:
27+
:special-members: __init__
2728

2829
Core: Sync
2930
----------
3031

31-
The DSI Core middleware also defines data management functionality in ``Sync``. The purpose of ``Sync`` is to provide file metadata documentation and data movement capabilities when moving data to/from local and remote locations. The purpose of data documentation is to capture and archive metadata (i.e. location of local file structure, their access permissions, file sizes, and creation/access/modification dates) and track their movement to the remote location for future access. The primary functions, ``Copy``, ``Move``, and ``Get`` serve as mechanisms to copy data, move data, or retrieve data from remote locations by creating a DSI database in the process, or retrieving an existing DSI database that contains the location(s) of the target data.
32+
The DSI Core middleware also defines data management functionality in ``Sync``.
33+
The purpose of ``Sync`` is to provide file metadata documentation and data movement capabilities when moving data to/from local and remote locations.
34+
The purpose of data documentation is to capture and archive metadata (i.e. location of local file structure, their access permissions, file sizes, and creation/access/modification dates) and track their movement to the remote location for future access.
35+
The primary functions, ``Copy``, ``Move``, and ``Get`` serve as mechanisms to copy data, move data, or retrieve data from remote locations by creating a DSI database in the process, or retrieving an existing DSI database that contains the location(s) of the target data.
3236

3337
.. autoclass:: dsi.core.Sync
3438
:members:
39+
:special-members: __init__
3540

3641
Examples
3742
--------
38-
Before interacting with the plugins and backends, they must each be loaded. Examples below display various ways that users can incorporate DSI into their data science workflows.
43+
Before interacting with the plugins and backends, they must each be loaded.
44+
Examples below display various ways users can incorporate DSI into their data science workflows.
45+
They can be found and run in ``examples/core/``
3946

40-
Example 1: Baseline use of DSI to list Modules
47+
Example 1: Intro use case
48+
~~~~~~~~~~
49+
Baseline use of DSI to list Modules
4150

4251
.. literalinclude:: ../examples/core/baseline.py
4352

44-
Example 2: Ingesting data from a Reader to a backend
53+
Example 2: Ingest data
54+
~~~~~~~~~~
55+
Ingesting data from a Reader to a backend
4556

4657
.. literalinclude:: ../examples/core/ingest.py
4758

48-
Example 3: Querying data from a backend
59+
Example 3: Query data
60+
~~~~~~~~~~
61+
Querying data from a backend
4962

5063
.. literalinclude:: ../examples/core/query.py
5164

52-
Example 4: Processing data from a backend to generate an Entity Relationship diagram using a Writer
65+
Example 4: Process data
66+
~~~~~~~~~~
67+
Processing data from a backend to generate an Entity Relationship diagram using a Writer
5368

5469
.. literalinclude:: ../examples/core/process.py
5570

56-
Example 5: Generating a python notebook file (mostly Jupyter notebook) from a backend to view data interactively
71+
Example 5: Generate notebook
72+
~~~~~~~~~~
73+
Generating a python notebook file (mostly Jupyter notebook) from a backend to view data interactively
5774

5875
.. literalinclude:: ../examples/core/notebook.py
5976

60-
Example 6: Finding data from a backend - tables, columns, cells, or all matches
77+
Example 6: Find data
78+
~~~~~~~~~~
79+
Finding data from a backend - tables, columns, cells, or all matches
6180

6281
.. literalinclude:: ../examples/core/find.py
6382

64-
Example 7: Loading an external plugin from another python file
83+
Example 7: External plugin
84+
~~~~~~~~~~
85+
Loading an external python plugin reader from a separate file:
6586

66-
.. literalinclude:: ../examples/core/external_plugin.py
87+
.. literalinclude:: ../examples/core/external_plugin.py
88+
89+
``text_file_reader``:
90+
91+
.. literalinclude:: ../examples/core/text_file_reader.py

docs/examples.rst

-4
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,12 @@ In the first step, a python script is used to parse the slurm output files and c
1919
2020
./parse_slurm_output.py --testname leblanc
2121
22-
23-
.. .. literalinclude:: ../examples/pennant/parse_slurm_output.py
24-
2522
In the second step, another python script,
2623

2724
.. code-block:: unixconfig
2825
2926
./create_and_query_dsi_db.py --testname leblanc
3027
31-
3228
reads in the CSV file and creates a database:
3329

3430
.. literalinclude:: ../examples/pennant/create_and_query_dsi_db.py

docs/introduction.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Currently, DSI has the following readers:
4848
.. figure:: PluginClassHierarchy.png
4949
:alt: Figure depicting the current plugin class hierarchy.
5050
:class: with-shadow
51-
:scale: 100%
51+
:scale: 70%
5252

5353
Figure depicting the current DSI plugin class hierarchy.
5454

docs/plugins.rst

+10-2
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,22 @@ Note that any contributed plugins or extension should include unit tests in ``p
99
.. figure:: PluginClassHierarchy.png
1010
:alt: Figure depicting the current plugin class hierarchy.
1111
:class: with-shadow
12-
:scale: 100%
12+
:scale: 70%
1313

1414
Figure depicts prominent portion of the current DSI plugin class hierarchy.
1515

1616
.. automodule:: dsi.plugins.plugin
1717
:members:
18+
:special-members: __init__
19+
20+
Metadata Processing
21+
-------------------
1822

1923
**Note for users:** StructuredMetadata class is used to assign data from a file_reader to the DSI abstraction in core. If data in a user-written reader is restructured as an OrderedDict, only need to call set_schema_2() at bottom of add_rows().
2024

2125
.. automodule:: dsi.plugins.metadata
2226
:members:
27+
:special-members: __init__
2328

2429
File Readers
2530
------------
@@ -32,6 +37,7 @@ Note for users:
3237
- if ingesting multiple tables at a time, users must pad tables with null data (YAML1 uses this and has example code at bottom of add_row() to implement this)
3338
.. automodule:: dsi.plugins.file_reader
3439
:members:
40+
:special-members: __init__
3541

3642
File Writers
3743
------------
@@ -40,14 +46,16 @@ Note for users:
4046
- If runTable flag is True in Terminal instantiation, the run table is only included in ER Diagram writer if data is processed from a backend. View Example 4 in Core Examples
4147
.. automodule:: dsi.plugins.file_writer
4248
:members:
49+
:special-members: __init__
4350

4451
Environment Plugins
4552
-------------------
4653
.. automodule:: dsi.plugins.env
4754
:members:
55+
:special-members: __init__
4856

4957
Optional Plugin Type Enforcement
50-
==================================
58+
--------------------------------
5159

5260
Plugins take data in an arbitrary format, and transform it into metadata which is queriable in DSI. Plugins may enforce types, but they are not required to enforce types. Plugin type enforcement can be static, like the Hostname default plugin. Plugin type enforcement can also be dynamic, like the Bueno default plugin.
5361

docs/plugins/generate_plugin_class_hierarchy.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def export_png(self, name: str) -> None:
3636
def process_children(r):
3737
print(r.clas.__name__)
3838
for ch in r.subclasses:
39-
if ch.clas.__name__ == "Environment" or (r.clas.__name__ == "FileReader" and ch.clas.__name__ in ["Wildfire", "Bueno", "TextFile", "MetadataReader1"]):
39+
if ch.clas.__name__ == "Environment" or (r.clas.__name__ == "FileReader" and ch.clas.__name__ in ["Wildfire", "Bueno", "MetadataReader1"]):
4040
continue
4141
dot.node(ch.clas.__name__)
4242
dot.edge(r.clas.__name__, ch.clas.__name__)

0 commit comments

Comments
 (0)