pestifer.core.resourcemanager module¶
Defines the ResourceManager class for managing access to pestifer.resources.
- class pestifer.core.resourcemanager.ResourceManager(charmmff_config: dict = {})[source]¶
Bases:
objectA class for managing pestifer’s built-in resources. This class provides access to various resources such as CHARMM force fields, example input files, and TcL scripts. The resources are organized into directories, and the class provides methods to access these resources.
- append_example(scriptname: str, example_id: int = 0, author_name='', author_email='', title='', db_id='', auxiliary_inputs=[], outputs=[])[source]¶
Add an example to the pestifer package. Minimally, the name of the example’s YAML input file must be specified.
- Parameters:
scriptname (str) – The name of the example’s YAML input file (with or without the .yaml extension).
example_id (int) – The unique identifier for the example. If not provided, a new ID will be assigned.
author_name (str) – The name of the author.
author_email (str) – The email address of the author.
title (str) – The title of the example.
db_id (str) – The database ID of the example.
auxiliary_inputs (list) – A list of auxiliary input files for the example.
outputs (list) – A list of output files for the example.
- property charmmff_content¶
- charmmff_version_dirs() list[Path][source]¶
Return all available charmmff version directories, sorted by release date (oldest first).
- charmmff_version_path(version_str: str = '') Path[source]¶
Return the version-specific charmmff directory path.
If version_str is given (e.g.
'July2024'), the corresponding subdirectory is returned. Otherwise the most-recently-modified version directory is used as the default.
- delete_example(example_id: int)[source]¶
Delete an example from the pestifer examples directory.
- Parameters:
example_index (int) – The index of the example to delete. This should be a positive integer indicating the position in the examples list (1-based).
- property example_manager¶
- get_charmmff_customdir()[source]¶
Get the path to the custom CHARMM force field directory. This directory is used for storing custom CHARMM force field files that are not part of the standard distribution.
- Returns:
The path to the custom CHARMM force field directory.
- Return type:
- get_resource_path(r)[source]¶
Get the path to a specific resource.
- Parameters:
r (str) – The name of the resource to get the path for. This should be one of the base resources defined in
ResourceManager._base_resources.
- get_tcl_pkgdir()[source]¶
Get the path to the TcL package directory. This directory contains TcL packages that are used by pestifer for various tasks, such as loading additional functionality or libraries.
- Returns:
The path to the TcL package directory.
- Return type:
- get_tcl_scriptsdir()[source]¶
Get the path to the TcL scripts directory. This directory contains TcL scripts that are used by pestifer for various tasks, such as setting up simulations or processing data.
- Returns:
The path to the TcL scripts directory.
- Return type:
- get_tcldir()[source]¶
Get the path to the TcL scripts and packages directory.
- Returns:
The path to the TcL scripts and packages directory.
- Return type:
- rename_example(example_id: int, new_name: str)[source]¶
Rename an existing example in the pestifer examples directory.
- set_example_author(example_id: int, author_name: str, author_email: str)[source]¶
Set the author information for an example in the pestifer examples directory.
- show(out_stream: Callable = <built-in function print>, components: dict = {}, fullnames=False, missing_fullnames={})[source]¶
Show a summary of the specified components.
- Parameters:
out_stream (callable, optional) – A callable that takes a string and outputs it. Default is print.
components (dict, optional) – A dictionary specifying the components to show. The keys are the component names and the values are the specifications for each component.
fullnames (bool, optional) – If True, show full names for the components. Default is False.
missing_fullnames (dict, optional) – A dictionary of missing full names for the components. Default is an empty dictionary.
- update_atomselect_macros()[source]¶
Update the atomselect macros in the macros.tcl file based on the content of labels.py. This method updates atomselect macros for residues that aren’t already part of atomselect macros in a base VMD installation.
- update_example(example_id: int, shortname: str = '', title: str = '', db_id: str = '', author_name: str = '', author_email: str = '', auxiliary_inputs: list = [], outputs: list = [])[source]¶
Update an existing example in the pestifer examples directory.
- Parameters:
example_id (int) – The unique identifier for the example to update.
shortname (str) – The short name of the example.
title (str) – The title of the example.
db_id (str) – The database ID of the example.
author_name (str) – The name of the author.
author_email (str) – The email address of the author.
auxiliary_inputs (list) – A list of auxiliary input files for the example.
outputs (list) – A list of output files for the example.
- pestifer.core.resourcemanager.USER_TOPPAR_DIR = PosixPath('/home/docs/.pestifer/toppar')¶
Well-known per-user cache directory for custom CHARMM stream files. When this directory exists, it is implicitly prepended to
charmmff.user_custom.searchpathso that a build picks up any.str/.rtf/.prmfiles the user has dropped there without needing to declare it in YAML. Project-local searchpath entries override anything in the cache (last-loaded wins).