pyworkflow.project.usage module

class pyworkflow.project.usage.ProtStat(count=0, nextProtsDict=None)[source]

Bases: object

Class to store the usage part of a reported ScipionWorkflow

addCountToNextProtocol(nextProt, count=1)[source]
addUsage(count=1)[source]
getCount()[source]
toJSON()[source]
class pyworkflow.project.usage.ScipionWorkflow(jsonStr=None)[source]

Bases: object

Class to serialize and deserialize what is reported from scipion. Example: {“ProtA”:

[2, {

“ProtB”:2, “ProtC”:3, …

}

], …

}

Instantiate this class optionally with a JSON string serialized from this class (what is sent by Scipion to this web service).

addCount(protName)[source]

Adds one to the count of a protocol

addCountToNextProtocol(protName, nextProtName)[source]
deserialize(jsonStr)[source]

Deserialize a JSONString serialized by this class with the toJSON method

deserializeList(jsonObj)[source]

Deserializes old data: a list of protocol names repeated: [“ProtA”,”ProtA”, “ProtB”, …]

deserializeV2(jsonObj)[source]

Deserializes v2 usage stats: something like {“ProtA”: [2,{..}],…}

getCount()[source]

Returns the number of protocols in the workflow

getProtStat(protName)[source]
getProtStats()[source]
toJSON()[source]

Returns a valid JSON string

pyworkflow.project.usage.getNextProtocolSuggestions(protocol)[source]

Returns the suggestions from the Scipion website for the next protocols to the protocol passed