Skip to content

Commit

Permalink
Improvement of Entities documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
tcezard committed Jun 28, 2017
1 parent ba7b3ff commit 2828bf8
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions pyclarity_lims/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ class Sample(Entity):
"""List of files associated with the sample."""
externalids = ExternalidListDescriptor()
"""list of external identifiers associated with the sample"""
# biosource XXX
artifact = None # See bottom of the file
"""Initial :py:class:`Artifact <pyclarity_lims.entities.Artifact>` associated with the sample."""


@classmethod
Expand Down Expand Up @@ -433,7 +434,7 @@ def outputs_per_input(self, inart, ResultFile=False, SharedResultFile=False, Ana
return outs

def input_per_sample(self, sample):
"""getting all the input artifacts dereved from the specified sample
"""Getting all the input artifacts dereved from the specified sample
:param sample: the sample name to check against
Expand Down Expand Up @@ -474,6 +475,7 @@ def all_inputs(self, unique=True, resolve=False):
def all_outputs(self, unique=True, resolve=False):
"""Retrieving all output artifacts from input_output_maps
if unique is true, no duplicates are returned.
:param unique: boolean specifying if the list of artifact should be uniqued
:param resolve: boolean specifying if the artifacts entities should be resolved through a batch query.
:return: list of output artifact.
Expand Down Expand Up @@ -562,6 +564,8 @@ class Artifact(Entity):
"""List of :py:class:`files <pyclarity_lims.entities.File>` associated with the artifact."""
reagent_labels = ReagentLabelList()
"""List of :py:class:`Reagent label <pyclarity_lims.entities.Reagent_label>` associated with the artifact."""
workflow_stages = None # See bottom of the file
"""List of workflow stages :py:class:`Step <pyclarity_lims.entities.Step>` that this artifact ran through."""

# artifact_flags XXX
# artifact_groups XXX
Expand Down Expand Up @@ -616,7 +620,12 @@ def _get_workflow_stages_and_statuses(self):
return result

workflow_stages_and_statuses = property(_get_workflow_stages_and_statuses)
"""List of tuple containing three elements (A, B, C) where:
- A is a :py:class:`Step <pyclarity_lims.entities.Step>` this artifact has run through.
- B is the status of said Step.
- C the name of the Step.
"""

class StepPlacements(Entity):
"""Placements from within a step. Supports POST"""
Expand Down Expand Up @@ -653,6 +662,8 @@ class StepActions(Entity):
- artifact: The :py:class:`artifact <pyclarity_lims.entities.Artifact>` associated with this Action
- step: The next :py:class:`step <pyclarity_lims.entities.Step>` associated with this action
- rework-step: The :py:class:`step <pyclarity_lims.entities.Step>` associated with this action when the Artifact need to be requeued"""
step = None # See bottom of the file
""":py:class:`Step <pyclarity_lims.entities.Step>` associated with the actions."""

@property
def escalation(self):
Expand Down Expand Up @@ -786,6 +797,8 @@ class Step(Entity):
date_completed = StringDescriptor('date-completed')
"""The date at which the step completed in format Year-Month-DayTHour:Min:Sec i.e. 2016-11-22T10:43:32.857+00:00"""
_available_programs = None
configuration = None
""":py:class:`Step configuration<pyclarity_lims.entities.ProtocolStep>` associated with the step."""

def advance(self):
"""
Expand Down Expand Up @@ -953,6 +966,8 @@ class Stage(Entity):
""":py:class:`Protocol <pyclarity_lims.entities.Protocol>` associated with this stage."""
step = EntityDescriptor('step', ProtocolStep)
""":py:class:`Step <pyclarity_lims.entities.ProtocolStep>` associated with this stage."""
workflow = None # See bottom of the file
""":py:class:`Workflow <pyclarity_lims.entities.Workflow>` associated with the stage."""


class Workflow(Entity):
Expand Down Expand Up @@ -1001,12 +1016,7 @@ class Queue(Entity):
"""List of :py:class:`artifacts <pyclarity_lims.entities.Artifact>` associated with this workflow."""

Sample.artifact = EntityDescriptor('artifact', Artifact)
"""Initial :py:class:`Artifact <pyclarity_lims.entities.Artifact>` associated with the sample."""
StepActions.step = EntityDescriptor('step', Step)
""":py:class:`Step <pyclarity_lims.entities.Step>` associated with the actions."""
Stage.workflow = EntityDescriptor('workflow', Workflow)
""":py:class:`Workflow <pyclarity_lims.entities.Workflow>` associated with the stage."""
Artifact.workflow_stages = EntityListDescriptor(tag='workflow-stage', klass=Stage, nesting=['workflow-stages'])
"""List of workflow stages :py:class:`Step <pyclarity_lims.entities.Step>` that this artifact ran through."""
Step.configuration = EntityDescriptor('configuration', ProtocolStep)
""":py:class:`Step configuration<pyclarity_lims.entities.ProtocolStep>` associated with the step."""

0 comments on commit 2828bf8

Please sign in to comment.