adaptivemd.Location

class adaptivemd.Location(location)[source]

A representation of a path in adaptiveMD

This is an important part of adaptiveMD. It allows you to specify file paths also relative to certain special folders in adaptiveMD, like the project folder. These special paths will be interpreted by the schedulers when they actually execute tasks

Note that folder names ALWAYS end in / while filenames NEVER

You can use special prefixes

  • file://{relative}/{path} references local files. If you want absolute paths you start with file:///{absolute}/{path}
  • worker://{relative_to_worker} relative to the working directory
  • staging:// relative to staging directory
  • sandbox:// relative to the sandbox, the folder that contains worker directories
  • shared:// relative to the main shared FS folder
  • project:// relative to the specific project folder. Usually in shared://projects/{project-name}/
Variables:location (str) – the full location using special prefixed
__init__(location)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

Methods

__init__(location) x.__init__(…) initializes x; see help(type(x)) for signature
args() Return a list of args of the __init__ function of a class
base() Return the most parent class actually derived from StorableMixin
clone() Make a deep copy of the objects
descendants() Return a list of all subclassed objects
from_dict(dct) Reconstruct an object from a dictionary representation
get_uuid() Create a new unique ID :returns: the unique number for an object in the project :rtype: long
idx(store) Return the index which is used for the object in the given store.
named(name) Attach a .name property to an object
objects() Returns a dictionary of all storable objects
to_dict() Convert object into a dictionary representation

Attributes

ACTIVE_LONG
CREATION_COUNT
INSTANCE_UUID
allowed_drives
base_cls Return the base class
base_cls_name Return the name of the base class
basename
returns:the file basename
basename_short
returns:the basename without extension
cls Return the class name as a string
default_drive
dirname
returns:the path of the directory, like os.path.dirname
drive return the prefix name
extension
returns:the filename extension or ‘’ of non exists
is_folder
returns:True if location is a folder
is_temp
returns:True when the location is a temporary folder that might be
path
returns:the complete path without prefix
short
returns:a shortened form of the path
split
returns:
split_drive
returns:
  • str – the drive (prefix with ://)
url
returns:return the full form always with a prefix
use_absolute_local_paths
clone()[source]

Make a deep copy of the objects

Returns:the deep copy
Return type:Location
is_temp
Returns:True when the location is a temporary folder that might be deleted
Return type:bool
short
Returns:a shortened form of the path
Return type:str
url
Returns:return the full form always with a prefix
Return type:str
basename
Returns:the file basename
Return type:str
is_folder
Returns:True if location is a folder
Return type:bool
path
Returns:the complete path without prefix
Return type:str
split
Returns:
Return type:os.path.split on the path without prefixes
dirname
Returns:the path of the directory, like os.path.dirname
Return type:str
drive

return the prefix name

Returns:the prefix name like staging, project, worker, file`
Return type:str
extension
Returns:the filename extension or ‘’ of non exists
Return type:str
basename_short
Returns:the basename without extension
Return type:str
split_drive
Returns:
  • str – the drive (prefix with ://)
  • str – the full path without prefix