schrodinger.project_utils.project_utils module¶
-
schrodinger.project_utils.project_utils.set_entries_pinned(entry_ids, pin)¶ Pin or unpin entries from the workspace.
Parameters: - entry_ids (list(str)) – a list of entry IDs
- pin (bool) – whether to pin or unpin the specified entries to the workspace
-
schrodinger.project_utils.project_utils.set_entry_pinned(entry_id, pin)¶ Pin or unpin an entry from the workspace.
Parameters: - entry_id (str) – an entry ID
- pin (bool) – whether to pin or unpin the specified entry to the workspace
-
schrodinger.project_utils.project_utils.set_entries_included(entry_ids, include)¶ For the specified entries, either include them in or exclude them from the workspace. If the entries are pinned and
includeisTrue, keep the entries pinned. If the entries are pinned andincludeisFalse, exclude the entries anyway.Parameters: - entry_ids (list(str)) – a list of entry IDs
- include (bool) – whether to include (
True) or exclude (False)
-
schrodinger.project_utils.project_utils.set_entry_included(entry_id, include)¶ For the specified entry, either include it in or exclude it from the workspace. If the entry is pinned and
includeisTrue, keep the entry pinned. If the entry is pinned andincludeisFalse, exclude the entry anyway.Parameters: - entry_id (str) – an entry ID
- include (bool) – whether to include (
True) or exclude (False)
-
schrodinger.project_utils.project_utils.entry_is_pinned(entry_id)¶ Return whether the specified entry is pinned in the workspace.
Parameters: entry_id (str) – the entry ID of a row in the project Returns: whether the entry is pinned in the workspace Return type: bool
-
schrodinger.project_utils.project_utils.entry_is_included(entry_id)¶ Return whether the specified entry is included in the workspace.
Parameters: entry_id (str) – the entry ID of a row in the project Returns: whether the entry is included in the workspace Return type: bool
-
schrodinger.project_utils.project_utils.set_entry_locked(entry_id, lock)¶ Set the supplied project table entry to be “locked” or “unlocked.”
These operations are grouped because they are both performed when locking an entry in the visual interface.
Parameters: - entry_id (str) – the entry ID of a row in the project
- lock (bool) – whether to lock or unlock the specified entry
-
schrodinger.project_utils.project_utils.entry_is_locked(entry_id)¶ Return whether the supplied project entry is read-only and not deletable.
These properties are both tested because both values are set when locking an entry in the visual interface.
Parameters: entry_id (str) – the entry ID of a row in the project Returns: whether the entry is locked Return type: bool
-
schrodinger.project_utils.project_utils.remove_entries(entry_ids)¶ Cleanly remove the specified entries from the project. If an entry cannot be found, do not raise an exception.
Parameters: entry_id (list(str)) – a list of entry IDs
-
schrodinger.project_utils.project_utils.create_subgroup(entry_ids, group_name, subgroup_title)¶ Create a subgroup of the specified project group, and place the supplied entries into it.
Parameters: - entry_ids (list(str)) – entry IDs for project entries to be placed into the new subgroup
- group_name (str) – name of the group to which this new subgroup will belong
- subgroup_title (str) – the title of the new subgroup
Returns: the new group object
Return type:
-
schrodinger.project_utils.project_utils.move_group(group, row_number)¶ Move all of the entries in the specified group to be below a specified row number in the project, while still retaining their group identity.
Parameters: - group (project.EntryGroup) – a non-empty entry group
- row_number (int) – the number of a row in the project: one that designates order within the project, not an entry ID
-
schrodinger.project_utils.project_utils.get_rows(entry_ids)¶ Parameters: entry_id (list(str)) – a list of entry IDs Returns: a list of either project rows corresponding to the provided entry IDs, if they exist, or NoneotherwiseReturn type: list(project.ProjectRow or None)
-
schrodinger.project_utils.project_utils.get_row(entry_id)¶ Parameters: entry_id (str) – an entry ID Returns: row corresponding to the entry ID, if it exists Return type: project.ProjectRow or None
-
schrodinger.project_utils.project_utils.get_structures(entry_ids)¶ Parameters: entry_ids (list(str)) – a list of entry IDs Returns: a list of either structures copied from the specified entries or None if they don’t exist Return type: list(structure.Structure or None)
-
schrodinger.project_utils.project_utils.get_structure(entry_id)¶ Parameters: entry_ids (str) – an entry ID Returns: a structure from the specified entry, if available Return type: structure.Structure or None
-
schrodinger.project_utils.project_utils.preserve_selection(pt)¶ Save the selection state of the project, then restore it on exit.
Parameters: pt (project.Project) – the project instance
-
schrodinger.project_utils.project_utils.unlock_entries(entry_ids, update_pt=True)¶ Temporarily unlock the specified entries, if they are locked. Otherwise, do not modify their lock state. Suppress signals from the project model during this process.
Parameters: - entry_ids (list(str)) – a list of entry IDs
- update_pt (bool) – whether to update the project table on exiting the context environment
-
schrodinger.project_utils.project_utils.create_child_group(entry_ids, parent_group_name, group_name=None)¶ Create a new group using the supplied entry IDs as a child group of the specified parent group.
Raises: ValueError – if no entry IDs are provided
Parameters: - entry_ids (list(str)) – a list of entry IDs to put into the new group
- parent_group_name (str) – the name of the group that should be the parent of the group created by this function
- group_name (str or None) – the name of the group to be created; if not supplied, a unique name will be randomly generated
Returns: the new group
Return type:
-
schrodinger.project_utils.project_utils.get_entry_group(group_name)¶ Return the group in the project with the specified name.
Parameters: group_name (str) – the name of the desired group Returns: the group with the specified name, if available Return type: str or None
-
schrodinger.project_utils.project_utils.generate_unique_group_name()¶ Returns: a unique entry group name Return type: str