hpcflow.sdk.core.utils#
Functions
Given two sequences (the first of which of known length), get the two slices that are equivalent to a given slice if the two sequences were combined. |
|
Decorator factory for the various from_spec class methods that have attributes that should be replaced by an object from an object list. |
|
Check a string is (roughly) a valid Python variable identifier and return it. |
|
Get the index of an item in a list and append the item if it is not in the list. |
|
Flatten an arbitrarily (but of uniform depth) nested list and return shape information to enable un-flattening. |
|
Get a list of all items in an iterable that appear more than once, assuming items are hashable. |
|
Retrieve an enum by name or value, assuming uppercase names and integer values. |
|
Get the repeat index for each item in a list. |
|
Generate the set of nested indices of length n that correspond to a global idx. |
|
Get relative path components between two paths. |
|
Group a list of dicts according to specified equivalent key-values. |
|
Generate a linear space around a rectangle. |
|
API function decorator to ensure the configuration has been loaded, and load if not. |
|
Open a file or directory using the default system application. |
|
Walk through a nested data structure and process string nodes using a provided callable. |
|
Load a YAML string. |
|
Replaced a range of items in a list with items in another list. |
|
Search recursively for files in a directory by a regex pattern and return matching file paths, relative to the given directory. |
|
Split a parameter path into the path and the label, if present. |
|
Return a copy where top-level keys have been swapped with a second-level inner key. |
|
Classes
Overridden DirectorySnapshot from watchdog to allow saving and loading from JSON. |
|