slycat.web.server

slycat.web.server.checkjob(sid, jid)[source]

Submits a command to the slycat-agent to check the status of a submitted job to a cluster running SLURM.

Parameters:
  • sid (int) – Session identifier
  • jid (int) – Job identifier
Returns:

response – A dictionary with the following keys: jid, status, errors

Return type:

dict

slycat.web.server.create_session(hostname, username, password)[source]

Create a cached remote session for the given host.

Parameters:
  • hostname (string) – Name of the remote host to connect via SSH.
  • username (string) – Username for SSH authentication.
  • password (string) – Password for SSH authentication
Returns:

sid – A unique session identifier.

Return type:

string

slycat.web.server.evaluate(hdf5_array, expression, expression_type, expression_level=0)[source]

Evaluate a hyperchunk expression.

slycat.web.server.get_model_file(database, model, aid)[source]
slycat.web.server.get_model_parameter(database, model, aid)[source]
slycat.web.server.get_remote_file(sid, path)[source]

Returns the content of a file from a remote system.

Parameters:
  • sid (int) – Session identifier
  • path (string) – Path for the requested file
Returns:

content – Content of the requested file

Return type:

string

slycat.web.server.mix(a, b, amount)[source]

Linear interpolation between two numbers. Useful for computing model progress.

slycat.web.server.post_model_file(mid, input=None, sid=None, path=None, aid=None, parser=None, **kwargs)[source]
slycat.web.server.put_model_array(database, model, aid, array_index, attributes, dimensions)[source]

store array for model

Parameters:
  • database – database of model
  • model – model as an object
  • aid – artifact id (eg data-table)
  • array_index – index of the array
  • attributes – name and type in column
  • dimensions – number of data rows
Returns:

slycat.web.server.put_model_arrayset(database, model, aid, input=False)[source]

Start a new model array set artifact. :param database: the database with our model :param model: the model :param aid: artifact id :param input: :return:

slycat.web.server.put_model_arrayset_data(database, model, aid, hyperchunks, data)[source]

Write data to an arrayset artifact.

Parameters:
  • database (database object, required) –
  • model (model object, required) –
  • aid (string, required) – Unique (to the model) arrayset artifact id.
  • hyperchunks (string or hyperchunks parse tree, required) – Specifies where the data will be stored, in Hyperchunks format.
  • data (iterable, required)) – A collection of numpy.ndarray data chunks to be stored. The number of data chunks must match the number implied by the hyperchunks parameter.
slycat.web.server.put_model_file(database, model, aid, value, content_type, input=False)[source]
slycat.web.server.put_model_inputs(database, model, source, deep_copy=False)[source]
slycat.web.server.put_model_parameter(database, model, aid, value, input=False)[source]
slycat.web.server.update_model(database, model, **kwargs)[source]

Update the model, and signal any waiting threads that it’s changed. will only update model base on “state”, “result”, “started”, “finished”, “progress”, “message”