Skip to content
This repository was archived by the owner on Aug 25, 2024. It is now read-only.

Commit d01d09f

Browse files
John Andersenpdxjohnny
authored andcommitted
docs: Plugins
* Add spec field to Definition to allow for documenting of complex types Signed-off-by: John Andersen <[email protected]>
1 parent bc3c9c7 commit d01d09f

File tree

21 files changed

+1109
-139
lines changed

21 files changed

+1109
-139
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
### Added
9+
- Definition spec field to specify a class representative of key value pairs for
10+
definitions with primitives which are dictionaries
11+
- Auto generation of documentation for operation implementations, models, and
12+
sources. Generated docs include information on configuration options and
13+
inputs and outputs for operation implementations.
814
### Changed
915
- OperationImplementation add_label and add_orig_label methods now use op.name
1016
instead of ENTRY_POINT_ORIG_LABEL and ENTRY_POINT_NAME.

dffml/df/types.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ class Definition(NamedTuple):
1515
name: str
1616
primitive: str
1717
lock: bool = False
18+
# spec is a NamedTuple which could be populated via a dict
19+
spec: NamedTuple = None
1820

1921
def __repr__(self):
2022
return self.name

dffml/operation/output.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@
1111
)
1212
from ..df.exceptions import DefinitionNotInContext
1313

14-
group_by_spec = Definition(name="group_by_spec", primitive="Dict[str, Any]")
15-
16-
group_by_output = Definition(
17-
name="group_by_output", primitive="Dict[str, List[Any]]"
18-
)
19-
2014

2115
class GroupBySpec(NamedTuple):
2216
group: Definition
@@ -42,6 +36,15 @@ async def resolve(
4236
return cls(**exported)
4337

4438

39+
group_by_spec = Definition(
40+
name="group_by_spec", primitive="Dict[str, Any]", spec=GroupBySpec
41+
)
42+
43+
group_by_output = Definition(
44+
name="group_by_output", primitive="Dict[str, List[Any]]"
45+
)
46+
47+
4548
@op(
4649
name="group_by",
4750
inputs={"spec": group_by_spec},

docs/community.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Community
2+
=========
3+
4+
Miscellaneous questions can be asked on
5+
`Gitter <https://gitter.im/dffml/community>`_ or in the
6+
`GitHub Issue <https://github.com/intel/dffml/issues/12>`_ meant for questions.
7+
8+
We hold weekly meetings on Tuesday's at 9 AM PST. Meetings are held via Google
9+
Hangouts.
10+
11+
If you have questions about you might go about integrating machine learning, or
12+
using data flow programming, hop on the meeting and we'll do Q & A at the end of
13+
the agenda.
14+
15+
- `Join Meeting <https://hangouts.google.com/call/WpnVSFrZFJl-QfLReYcfAEEE>`_
16+
- `Meeting Minutes <https://docs.google.com/document/d/16u9Tev3O0CcUDe2nfikHmrO3Xnd4ASJ45myFgQLpvzM/>`_
17+
18+
If you have developed a plugin for DFFML and would like it listed in the docs,
19+
please open an `issue <https://github.com/intel/dffml/issues/new?assignees=&labels=documentation&template=new_plugin.md&title=plugin%3A+new%3A+>`_.
20+
21+
.. raw:: html
22+
23+
<iframe src="https://calendar.google.com/calendar/embed?src=0b6g0ki0qsq1fd1sr703ceeioc%40group.calendar.google.com&ctz=America%2FLos_Angeles" marginheight="0" marginwidth="0" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" width="688" height="600" frameborder="0"></iframe>

docs/concepts/index.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
Models
2-
======
1+
Concepts
2+
========
3+
4+
The following documents cover the core concepts of DFFML. They will be useful to
5+
understand as you work with the code to implement new plugins, or use existing
6+
pluings in the eco system.
37

48
.. toctree::
5-
:glob:
69
:maxdepth: 2
710
:caption: Contents:
811

9-
base
12+
data_flow

docs/index.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ set of feature generators which gather data from git repositories.
2828
:maxdepth: 2
2929
:caption: Contents:
3030

31+
community
3132
usage/*
33+
concepts/index
34+
plugins/index
3235
api
3336

3437

docs/plugins/dffml_model.rst

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
Models
2+
======
3+
4+
Models are implementations of :class:`dffml.model.model.Model`, they
5+
abstract the usage of machine learning models.
6+
7+
dffml_model_tensorflow
8+
----------------------
9+
10+
dnn
11+
~~~
12+
13+
*Core*
14+
15+
Implemented using Tensorflow's DNNClassifier. Models are saved under the
16+
``directory`` in subdirectories named after the hash of their feature names.
17+
18+
**Args**
19+
20+
- directory: String
21+
22+
- default: /home/user/.cache/dffml/tensorflow
23+
- Directory where state should be saved
24+
25+
- steps: Integer
26+
27+
- default: 3000
28+
- Number of steps to train the model
29+
30+
- epochs: Integer
31+
32+
- default: 30
33+
- Number of iterations to pass over all repos in a source
34+
35+
- hidden: List of integers
36+
37+
- default: [12, 40, 15]
38+
- List length is the number of hidden layers in the network. Each entry in the list is the number of nodes in that hidden layer

0 commit comments

Comments
 (0)