ModelicaPath

class geojson_modelica_translator.utils.ModelicaPath(name, root_dir, overwrite=False)

Bases: object

Class for storing Modelica paths. This allows the path to point to the model directory, resources, and scripts directory.

__init__(name, root_dir, overwrite=False)

Create a new modelica-based path with name of ‘name’

Parameters

name – Name to create

Methods

__init__(name, root_dir[, overwrite])

Create a new modelica-based path with name of 'name'

clear_or_create_path(path)

Attributes

files_dir

Return the path to the files (models) for the specified ModelicaPath.

files_relative_dir

Return the path to the files relative to the project name.

resources_dir

Return the path to the resources directory for the specified ModelicaPath.

resources_relative_dir

Return the relative resource directory instead of the full path.

scripts_dir

Return the path to the scripts directory (in the resources dir) for the specified ModelicaPath.

scripts_relative_dir

Return the scripts directory that is in the resources directory.

property files_dir

Return the path to the files (models) for the specified ModelicaPath. This path does not include the trailing slash.

Returns

string, path to where files (models) are stored, without trailing slash

property files_relative_dir

Return the path to the files relative to the project name.

property resources_dir

Return the path to the resources directory for the specified ModelicaPath. This path does not include the trailing slash.

Returns

string, path to where resources are stored, without trailing slash.

property resources_relative_dir

Return the relative resource directory instead of the full path. This is useful when replacing strings within modelica files which are relative to the package.

Returns

string, relative resource’s data path

property scripts_dir

Return the path to the scripts directory (in the resources dir) for the specified ModelicaPath. This path does not include the trailing slash.

Returns

string, path to where scripts are stored, without trailing slash.

property scripts_relative_dir

Return the scripts directory that is in the resources directory. This only returns the relative directory and is useful when replacing string values within Modelica files.

Returns

string, relative scripts path