Skip to content

Commit b17fc33

Browse files
authored
[CAT-12] Workflow Metrics in the SDK (#114)
* items submitted * workflow metrics changes * updated sphinx docs
1 parent 4435b2a commit b17fc33

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2504
-45
lines changed

docs/_sources/auto-review.rst.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Using Auto Review
1313
Auto review is currently only available via api call. To use it, the following steps must be performed:
1414

1515
- Submit a document through your workflow
16-
- Retreive the submission
16+
- Retrieve the submission
1717
- Add a flag on each prediction result you wish to Auto Review in the submission to designate if you would like to accept or reject it
1818
- Submit the changes to Review
1919

@@ -31,7 +31,7 @@ Example usage of Auto Review::
3131
workflow_id=workflow_id, files=["my_file.pdf"]
3232
)
3333
)
34-
# Retreive the submission results
34+
# Retrieve the submission results
3535
submissions = client.call(WaitForSubmissions(submission_ids))
3636
submission = submissions[0]
3737
raw_result = client.call(RetrieveStorageObject(submission.result_file))
@@ -79,7 +79,7 @@ When submitting changes for a given document using SubmitReview, you can reject
7979

8080
Accepting No Value
8181
==================
82-
Even when all predictions are accepted, a reviewer will still need to manually accept any labels that are empty. However, you can automatically accept empty values for specific lables using the "_no_value" key. Within the model results, set the dictionary key "_no_value" equal to a dictionary containing the name of your model keying to a list of labels. This list of labels should contain all the labels you would like to automatically accept empty values for. Accepted empty labels will appear in review as accepted labels. Please note that you can only auto-accept empty labels that do not contain any predictions. Labels that contain predictions should not be inlcuded in the list of no value labels. In the example below empty labels are only accepted if the specified label is not present in the predictions::
82+
Even when all predictions are accepted, a reviewer will still need to manually accept any labels that are empty. However, you can automatically accept empty values for specific labels using the "_no_value" key. Within the model results, set the dictionary key "_no_value" equal to a dictionary containing the name of your model keying to a list of labels. This list of labels should contain all the labels you would like to automatically accept empty values for. Accepted empty labels will appear in review as accepted labels. Please note that you can only auto-accept empty labels that do not contain any predictions. Labels that contain predictions should not be inlcuded in the list of no value labels. In the example below empty labels are only accepted if the specified label is not present in the predictions::
8383

8484
from indico.queries import (
8585
WorkflowSubmission,
@@ -93,7 +93,7 @@ Even when all predictions are accepted, a reviewer will still need to manually a
9393
workflow_id=workflow_id, files=["my_file.pdf"]
9494
)
9595
)
96-
# Retreive the submission results
96+
# Retrieve the submission results
9797
submissions = client.call(WaitForSubmissions(submission_ids))
9898
submission = submissions[0]
9999
raw_result = client.call(RetrieveStorageObject(submission.result_file))

docs/_sources/examples.rst.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ Examples
1515
image-predictions-ex
1616
submission-ex
1717
user-metrics-ex
18+
workflow-metrics-ex

docs/_sources/index.rst.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Reference
4141
filters
4242
graphql_queries
4343
user_metrics
44+
workflow-metrics
4445

4546
**Types**
4647

@@ -52,3 +53,4 @@ Reference
5253
model-group-type
5354
model-type
5455
user-metrics-types
56+
workflow-metrics-types
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Fetching Workflow Metrics
2+
***********************************************************
3+
4+
An example that illustrates how to fetch worklow metric data.
5+
6+
.. literalinclude:: ../examples/get-workflow-metrics.py
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**********************
2+
Workflow Metrics Types
3+
**********************
4+
5+
.. automodule:: indico.types.workflow_metrics
6+
.. autoclass:: indico.types.workflow_metrics.WorkflowMetricsOptions
7+
.. autoclass:: indico.types.workflow_metrics.TimeOnTaskMetric
8+
.. autoclass:: indico.types.workflow_metrics.TimeOnTaskMetrics
9+
.. autoclass:: indico.types.workflow_metrics.DailyTimeOnTaskMetric
10+
.. autoclass:: indico.types.workflow_metrics.SubmissionMetric
11+
.. autoclass:: indico.types.workflow_metrics.DailySubmissionMetric
12+
.. autoclass:: indico.types.workflow_metrics.DailyQueueMetric
13+
.. autoclass:: indico.types.workflow_metrics.QueueMetrics
14+
.. autoclass:: indico.types.workflow_metrics.PredictionMetric
15+
.. autoclass:: indico.types.workflow_metrics.PredictionMetrics
16+
.. autoclass:: indico.types.workflow_metrics.DailyPredictionMetric
17+
.. autoclass:: indico.types.workflow_metrics.StpMetric
18+
.. autoclass:: indico.types.workflow_metrics.DailyStpMetric
19+
.. autoclass:: indico.types.workflow_metrics.ClassStpMetrics
20+
.. autoclass:: indico.types.workflow_metrics.ModelStpMetrics
21+
.. autoclass:: indico.types.workflow_metrics.WorkflowStpMetrics
22+
.. autoclass:: indico.types.workflow_metrics.StraightThroughProcessing
23+
.. autoclass:: indico.types.workflow_metrics.WorkflowMetrics
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
*****************
2+
Workflow Metrics
3+
*****************
4+
5+
.. autoclass:: indico.queries.workflow_metrics.GetWorkflowMetrics
6+
7+

docs/auto-review.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,14 @@
124124
<li class="toctree-l1"><a class="reference internal" href="exports.html">Exports</a></li>
125125
<li class="toctree-l1"><a class="reference internal" href="filters.html">Filters</a></li>
126126
<li class="toctree-l1"><a class="reference internal" href="graphql_queries.html">Common GraphQL Queries</a></li>
127+
<li class="toctree-l1"><a class="reference internal" href="user_metrics.html">User Metrics</a></li>
127128
</ul>
128129
<ul>
129130
<li class="toctree-l1"><a class="reference internal" href="dataset-type.html">Dataset Types</a></li>
130131
<li class="toctree-l1"><a class="reference internal" href="jobs-type.html">Jobs Types</a></li>
131132
<li class="toctree-l1"><a class="reference internal" href="model-group-type.html">Model Group Types</a></li>
132133
<li class="toctree-l1"><a class="reference internal" href="model-type.html">Model Types</a></li>
134+
<li class="toctree-l1"><a class="reference internal" href="user-metrics-types.html">User Metrics Types</a></li>
133135
</ul>
134136

135137

@@ -210,7 +212,7 @@ <h2>Using Auto Review<a class="headerlink" href="#using-auto-review" title="Perm
210212
<p>Auto review is currently only available via api call. To use it, the following steps must be performed:</p>
211213
<ul class="simple">
212214
<li><p>Submit a document through your workflow</p></li>
213-
<li><p>Retreive the submission</p></li>
215+
<li><p>Retrieve the submission</p></li>
214216
<li><p>Add a flag on each prediction result you wish to Auto Review in the submission to designate if you would like to accept or reject it</p></li>
215217
<li><p>Submit the changes to Review</p></li>
216218
</ul>
@@ -227,7 +229,7 @@ <h2>Using Auto Review<a class="headerlink" href="#using-auto-review" title="Perm
227229
<span class="n">workflow_id</span><span class="o">=</span><span class="n">workflow_id</span><span class="p">,</span> <span class="n">files</span><span class="o">=</span><span class="p">[</span><span class="s2">&quot;my_file.pdf&quot;</span><span class="p">]</span>
228230
<span class="p">)</span>
229231
<span class="p">)</span>
230-
<span class="c1"># Retreive the submission results</span>
232+
<span class="c1"># Retrieve the submission results</span>
231233
<span class="n">submissions</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">call</span><span class="p">(</span><span class="n">WaitForSubmissions</span><span class="p">(</span><span class="n">submission_ids</span><span class="p">))</span>
232234
<span class="n">submission</span> <span class="o">=</span> <span class="n">submissions</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
233235
<span class="n">raw_result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">call</span><span class="p">(</span><span class="n">RetrieveStorageObject</span><span class="p">(</span><span class="n">submission</span><span class="o">.</span><span class="n">result_file</span><span class="p">))</span>
@@ -269,7 +271,7 @@ <h2>Auto Reject a Document<a class="headerlink" href="#auto-reject-a-document" t
269271
</div>
270272
<div class="section" id="accepting-no-value">
271273
<h2>Accepting No Value<a class="headerlink" href="#accepting-no-value" title="Permalink to this headline"></a></h2>
272-
<p>Even when all predictions are accepted, a reviewer will still need to manually accept any labels that are empty. However, you can automatically accept empty values for specific lables using the “_no_value” key. Within the model results, set the dictionary key “_no_value” equal to a dictionary containing the name of your model keying to a list of labels. This list of labels should contain all the labels you would like to automatically accept empty values for. Accepted empty labels will appear in review as accepted labels. Please note that you can only auto-accept empty labels that do not contain any predictions. Labels that contain predictions should not be inlcuded in the list of no value labels. In the example below empty labels are only accepted if the specified label is not present in the predictions:</p>
274+
<p>Even when all predictions are accepted, a reviewer will still need to manually accept any labels that are empty. However, you can automatically accept empty values for specific labels using the “_no_value” key. Within the model results, set the dictionary key “_no_value” equal to a dictionary containing the name of your model keying to a list of labels. This list of labels should contain all the labels you would like to automatically accept empty values for. Accepted empty labels will appear in review as accepted labels. Please note that you can only auto-accept empty labels that do not contain any predictions. Labels that contain predictions should not be inlcuded in the list of no value labels. In the example below empty labels are only accepted if the specified label is not present in the predictions:</p>
273275
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">indico.queries</span> <span class="kn">import</span> <span class="p">(</span>
274276
<span class="n">WorkflowSubmission</span><span class="p">,</span>
275277
<span class="n">WaitForSubmissions</span><span class="p">,</span>
@@ -282,7 +284,7 @@ <h2>Accepting No Value<a class="headerlink" href="#accepting-no-value" title="Pe
282284
<span class="n">workflow_id</span><span class="o">=</span><span class="n">workflow_id</span><span class="p">,</span> <span class="n">files</span><span class="o">=</span><span class="p">[</span><span class="s2">&quot;my_file.pdf&quot;</span><span class="p">]</span>
283285
<span class="p">)</span>
284286
<span class="p">)</span>
285-
<span class="c1"># Retreive the submission results</span>
287+
<span class="c1"># Retrieve the submission results</span>
286288
<span class="n">submissions</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">call</span><span class="p">(</span><span class="n">WaitForSubmissions</span><span class="p">(</span><span class="n">submission_ids</span><span class="p">))</span>
287289
<span class="n">submission</span> <span class="o">=</span> <span class="n">submissions</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
288290
<span class="n">raw_result</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">call</span><span class="p">(</span><span class="n">RetrieveStorageObject</span><span class="p">(</span><span class="n">submission</span><span class="o">.</span><span class="n">result_file</span><span class="p">))</span>

docs/client.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,14 @@
118118
<li class="toctree-l1"><a class="reference internal" href="exports.html">Exports</a></li>
119119
<li class="toctree-l1"><a class="reference internal" href="filters.html">Filters</a></li>
120120
<li class="toctree-l1"><a class="reference internal" href="graphql_queries.html">Common GraphQL Queries</a></li>
121+
<li class="toctree-l1"><a class="reference internal" href="user_metrics.html">User Metrics</a></li>
121122
</ul>
122123
<ul>
123124
<li class="toctree-l1"><a class="reference internal" href="dataset-type.html">Dataset Types</a></li>
124125
<li class="toctree-l1"><a class="reference internal" href="jobs-type.html">Jobs Types</a></li>
125126
<li class="toctree-l1"><a class="reference internal" href="model-group-type.html">Model Group Types</a></li>
126127
<li class="toctree-l1"><a class="reference internal" href="model-type.html">Model Types</a></li>
128+
<li class="toctree-l1"><a class="reference internal" href="user-metrics-types.html">User Metrics Types</a></li>
127129
</ul>
128130

129131

docs/config.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<link rel="index" title="Index" href="genindex.html" />
4545
<link rel="search" title="Search" href="search.html" />
4646
<link rel="next" title="IndicoClient" href="client.html" />
47-
<link rel="prev" title="Sending New Samples to a Workflow (aka Workflow Submission)" href="submission-ex.html" />
47+
<link rel="prev" title="Fetching User Metrics" href="user-metrics-ex.html" />
4848
</head>
4949

5050
<body class="wy-body-for-nav">
@@ -118,12 +118,14 @@
118118
<li class="toctree-l1"><a class="reference internal" href="exports.html">Exports</a></li>
119119
<li class="toctree-l1"><a class="reference internal" href="filters.html">Filters</a></li>
120120
<li class="toctree-l1"><a class="reference internal" href="graphql_queries.html">Common GraphQL Queries</a></li>
121+
<li class="toctree-l1"><a class="reference internal" href="user_metrics.html">User Metrics</a></li>
121122
</ul>
122123
<ul>
123124
<li class="toctree-l1"><a class="reference internal" href="dataset-type.html">Dataset Types</a></li>
124125
<li class="toctree-l1"><a class="reference internal" href="jobs-type.html">Jobs Types</a></li>
125126
<li class="toctree-l1"><a class="reference internal" href="model-group-type.html">Model Group Types</a></li>
126127
<li class="toctree-l1"><a class="reference internal" href="model-type.html">Model Types</a></li>
128+
<li class="toctree-l1"><a class="reference internal" href="user-metrics-types.html">User Metrics Types</a></li>
127129
</ul>
128130

129131

@@ -234,7 +236,7 @@
234236
<footer>
235237
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
236238
<a href="client.html" class="btn btn-neutral float-right" title="IndicoClient" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
237-
<a href="submission-ex.html" class="btn btn-neutral float-left" title="Sending New Samples to a Workflow (aka Workflow Submission)" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
239+
<a href="user-metrics-ex.html" class="btn btn-neutral float-left" title="Fetching User Metrics" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
238240
</div>
239241

240242
<hr/>

docs/datasets.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,14 @@
118118
<li class="toctree-l1"><a class="reference internal" href="exports.html">Exports</a></li>
119119
<li class="toctree-l1"><a class="reference internal" href="filters.html">Filters</a></li>
120120
<li class="toctree-l1"><a class="reference internal" href="graphql_queries.html">Common GraphQL Queries</a></li>
121+
<li class="toctree-l1"><a class="reference internal" href="user_metrics.html">User Metrics</a></li>
121122
</ul>
122123
<ul>
123124
<li class="toctree-l1"><a class="reference internal" href="dataset-type.html">Dataset Types</a></li>
124125
<li class="toctree-l1"><a class="reference internal" href="jobs-type.html">Jobs Types</a></li>
125126
<li class="toctree-l1"><a class="reference internal" href="model-group-type.html">Model Group Types</a></li>
126127
<li class="toctree-l1"><a class="reference internal" href="model-type.html">Model Types</a></li>
128+
<li class="toctree-l1"><a class="reference internal" href="user-metrics-types.html">User Metrics Types</a></li>
127129
</ul>
128130

129131

docs/docextract.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,14 @@
118118
<li class="toctree-l1"><a class="reference internal" href="exports.html">Exports</a></li>
119119
<li class="toctree-l1"><a class="reference internal" href="filters.html">Filters</a></li>
120120
<li class="toctree-l1"><a class="reference internal" href="graphql_queries.html">Common GraphQL Queries</a></li>
121+
<li class="toctree-l1"><a class="reference internal" href="user_metrics.html">User Metrics</a></li>
121122
</ul>
122123
<ul>
123124
<li class="toctree-l1"><a class="reference internal" href="dataset-type.html">Dataset Types</a></li>
124125
<li class="toctree-l1"><a class="reference internal" href="jobs-type.html">Jobs Types</a></li>
125126
<li class="toctree-l1"><a class="reference internal" href="model-group-type.html">Model Group Types</a></li>
126127
<li class="toctree-l1"><a class="reference internal" href="model-type.html">Model Types</a></li>
128+
<li class="toctree-l1"><a class="reference internal" href="user-metrics-types.html">User Metrics Types</a></li>
127129
</ul>
128130

129131

docs/examples.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
<li class="toctree-l2"><a class="reference internal" href="image-predictions-ex.html">Get Predictions from Image Model</a></li>
115115
<li class="toctree-l2"><a class="reference internal" href="submission-ex.html">Sending New Samples to a Workflow (aka Workflow Submission)</a></li>
116116
<li class="toctree-l2"><a class="reference internal" href="user-metrics-ex.html">Fetching User Metrics</a></li>
117+
<li class="toctree-l2"><a class="reference internal" href="workflow-metrics-ex.html">Fetching Workflow Metrics</a></li>
117118
</ul>
118119
</li>
119120
</ul>
@@ -131,12 +132,15 @@
131132
<li class="toctree-l1"><a class="reference internal" href="filters.html">Filters</a></li>
132133
<li class="toctree-l1"><a class="reference internal" href="graphql_queries.html">Common GraphQL Queries</a></li>
133134
<li class="toctree-l1"><a class="reference internal" href="user_metrics.html">User Metrics</a></li>
135+
<li class="toctree-l1"><a class="reference internal" href="workflow-metrics.html">Workflow Metrics</a></li>
134136
</ul>
135137
<ul>
136138
<li class="toctree-l1"><a class="reference internal" href="dataset-type.html">Dataset Types</a></li>
137139
<li class="toctree-l1"><a class="reference internal" href="jobs-type.html">Jobs Types</a></li>
138140
<li class="toctree-l1"><a class="reference internal" href="model-group-type.html">Model Group Types</a></li>
139141
<li class="toctree-l1"><a class="reference internal" href="model-type.html">Model Types</a></li>
142+
<li class="toctree-l1"><a class="reference internal" href="user-metrics-types.html">User Metrics Types</a></li>
143+
<li class="toctree-l1"><a class="reference internal" href="workflow-metrics-types.html">User Metrics Types</a></li>
140144
</ul>
141145

142146

@@ -218,6 +222,7 @@ <h1>Examples<a class="headerlink" href="#examples" title="Permalink to this head
218222
<li class="toctree-l1"><a class="reference internal" href="image-predictions-ex.html">Get Predictions from Image Model</a></li>
219223
<li class="toctree-l1"><a class="reference internal" href="submission-ex.html">Sending New Samples to a Workflow (aka Workflow Submission)</a></li>
220224
<li class="toctree-l1"><a class="reference internal" href="user-metrics-ex.html">Fetching User Metrics</a></li>
225+
<li class="toctree-l1"><a class="reference internal" href="workflow-metrics-ex.html">Fetching Workflow Metrics</a></li>
221226
</ul>
222227
</div>
223228
</div>

docs/exports.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,14 @@
118118
<li class="toctree-l1 current"><a class="current reference internal" href="#">Exports</a></li>
119119
<li class="toctree-l1"><a class="reference internal" href="filters.html">Filters</a></li>
120120
<li class="toctree-l1"><a class="reference internal" href="graphql_queries.html">Common GraphQL Queries</a></li>
121+
<li class="toctree-l1"><a class="reference internal" href="user_metrics.html">User Metrics</a></li>
121122
</ul>
122123
<ul>
123124
<li class="toctree-l1"><a class="reference internal" href="dataset-type.html">Dataset Types</a></li>
124125
<li class="toctree-l1"><a class="reference internal" href="jobs-type.html">Jobs Types</a></li>
125126
<li class="toctree-l1"><a class="reference internal" href="model-group-type.html">Model Group Types</a></li>
126127
<li class="toctree-l1"><a class="reference internal" href="model-type.html">Model Types</a></li>
128+
<li class="toctree-l1"><a class="reference internal" href="user-metrics-types.html">User Metrics Types</a></li>
127129
</ul>
128130

129131

0 commit comments

Comments
 (0)