schrodinger.application.livedesign.upload_utils module

schrodinger.application.livedesign.upload_utils.upload_ld_attachment(file_path, project_id, ld_client, remote_file_name=None)

Upload a file to LiveDesign as an attachment and return the corresponding attachment ID.

Parameters:
  • file_path (str) – the path to the file to be uploaded
  • project_id (int) – the ID of the LiveDesign project that the file should be uploaded to
  • remote_file_name (str or None) – the name of the attachment once uploaded; None, use the name of the file prior to upload
  • ld_client (ldclient.client.LDClient) – an instance of the LD client to use for the upload
schrodinger.application.livedesign.upload_utils.get_template_vars(template_data, template_class)

Provided a list containing LiveDesign attachment IDs and names, generate and return a list of template variables.

Parameters:
  • template_data (list of 2-tuple`s of (`int, str)) – a list of 2-`tuple`s containing LD attachment IDs and corresponding names
  • template_class (class) – the template class to initialize, from the downloaded ldclient.models module.
Returns:

a list of template variables

Return type:

list of ldclient.models.ModelTemplateVar

schrodinger.application.livedesign.upload_utils.upload_ld_model(name, user_name, folder, project_id, template_vars, description, protocol_id, ld_client, model_class, model_recursive_class, predictions=None)

Create a LiveDesign model and upload it to a LiveDesign server.

Parameters:
  • name (str) – the name of the model
  • user_name (str) – the name of the user uploading this model
  • folder (str) – the directory path in which the model should be created on the LiveDesign server
  • project_id (int) – the ID of the LiveDesign project that the file should be uploaded to
  • template_vars – a list of template variables containing attachment data
  • description (str) – a description of the model
  • protocol_id (int) – the ID of the parent protocol for this model
  • ld_client (ldclient.client.LDClient) – an instance of the LD client to use for the upload
  • model_class (class) – the model class, from the downloaded ldclient.models module
  • model_recursive_class – the “model recursive class” that is necessary to build the model instance
Return type:

list of ldclient.models.ModelTemplateVar

:type model_recursive_class

Parameters:predictions (list of ldclient.models.ModelReturn) – the predictions to be added to the model
Returns:the model instance uploaded to the LiveDesign server, or None if the upload failed
Return type:ldclient.models.Model, or None