Special paths related to PTS. More...
Functions | |
def | absPath (inpath) |
This function returns the absolute canonical path corresponding to the given path. More... | |
def | dataPath (object) |
This function returns the absolute path to the data subdirectory for the PTS package in which the given object is defined. More... | |
def | projectParentPath () |
This function returns the absolute path to the directory containing the SKIRT and PTS project directories as a pathlib.Path object. More... | |
def | ptsPath () |
This function returns the absolute path to the top-level directory of the pts repository as a pathlib.Path object. More... | |
def | ptsResourcesPath () |
This function returns the absolute path to the PTS resources directory as part of the project structure including this PTS source file, or None if no such directory is found. More... | |
def | savePath (defFilePath, suffix, *outDirPath=None, outFileName=None, outFilePath=None) |
This function returns the absolute canonical path corresponding to the file path that will be used to save a result to file, such as a PDF plot or a PNG image. More... | |
def | skirtPath () |
This function returns the absolute path to the SKIRT executable built as part of the project structure including this PTS source file, or None if no executable is found. More... | |
def | skirtResourcesPath () |
This function returns the absolute path to the SKIRT resources directory as part of the project structure including this PTS source file, or None if no such directory is found. More... | |
Special paths related to PTS.
This module allows retrieving some special paths related to PTS, such as for example the path to the pts repository.
def pts.utils.path.absPath | ( | inpath | ) |
This function returns the absolute canonical path corresponding to the given path.
The input path may be specified as a string or as a pathlib.Path object. If the input path is relative, it is interpreted relative to the current working directory. If it starts with a tilde, the tilde is expanded to the home directory of the current user. In all cases, the path is streamlined by removing and "." and ".." segments and following symbolic links.
def pts.utils.path.dataPath | ( | object | ) |
This function returns the absolute path to the data
subdirectory for the PTS package in which the given object is defined.
def pts.utils.path.projectParentPath | ( | ) |
This function returns the absolute path to the directory containing the SKIRT and PTS project directories as a pathlib.Path object.
In the canonical SKIRT/PTS developer directory structure, this is the grandparent of the pts repository.
def pts.utils.path.ptsPath | ( | ) |
This function returns the absolute path to the top-level directory of the pts repository as a pathlib.Path object.
def pts.utils.path.ptsResourcesPath | ( | ) |
This function returns the absolute path to the PTS resources directory as part of the project structure including this PTS source file, or None if no such directory is found.
def pts.utils.path.savePath | ( | defFilePath, | |
suffix, | |||
* | outDirPath = None , |
||
outFileName = None , |
|||
outFilePath = None |
|||
) |
This function returns the absolute canonical path corresponding to the file path that will be used to save a result to file, such as a PDF plot or a PNG image.
The returned path is derived from the input arguments:
The three input paths may be specified as a string or as a pathlib.Path object. If the input path is relative, it is interpreted relative to the current working directory. If it starts with a tilde, the tilde is expanded to the home directory of the current user.
def pts.utils.path.skirtPath | ( | ) |
This function returns the absolute path to the SKIRT executable built as part of the project structure including this PTS source file, or None if no executable is found.
The function assumes that a SKIRT release version is built under a ~/SKIRT9
or SKIRT
directory in the directory returned by the projectParent() function. The SKIRT9
directory is tried first.
def pts.utils.path.skirtResourcesPath | ( | ) |
This function returns the absolute path to the SKIRT resources directory as part of the project structure including this PTS source file, or None if no such directory is found.
The function assumes that SKIRT is installed under a ~/SKIRT9
or SKIRT
directory in the directory returned by the projectParent() function. The SKIRT9
directory is tried first.