This function is used to encapsulate paths to allow for behaviour switches. One use is for example when plotting. The plot_all method will encapsulate a path so that plots may be saved to a directory structure. Other plot methods, e.g. plot_model_performance do not encapsulate a path, and if the user calls these functions directly, the plot may be written to the provided path instead of a directory structure.
encapsulate_path(path)
encapsulated_path object