Internal environment
InternalEnvironment
Bases: Environment
Methods:
| Name | Description |
|---|---|
__init__ |
Use absolute path as name for micromamba to consider the activation from a folder path, not from a name |
execute |
Executes a function in the given module |
runScript |
Runs a Python script locally using runpy.run_path(), simulating |
Source code in wetlands/internal_environment.py
__init__(name, path, environmentManager)
Use absolute path as name for micromamba to consider the activation from a folder path, not from a name
Source code in wetlands/internal_environment.py
execute(modulePath, function, args=(), kwargs={})
Executes a function in the given module
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
modulePath
|
str | Path
|
the path to the module to import |
required |
function
|
str
|
the name of the function to execute |
required |
args
|
tuple
|
the argument list for the function |
()
|
kwargs
|
dict[str, Any]
|
the keyword arguments for the function |
{}
|
Returns:
| Type | Description |
|---|---|
Any
|
The result of the function |
Source code in wetlands/internal_environment.py
runScript(scriptPath, args=(), run_name='__main__')
Runs a Python script locally using runpy.run_path(), simulating 'python script.py arg1 arg2 ...'
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scriptPath
|
str | Path
|
Path to the script to execute. |
required |
args
|
tuple
|
List of arguments to pass (becomes sys.argv[1:] locally). |
()
|
run_name
|
str
|
Value for runpy.run_path(run_name=...); defaults to "main". |
'__main__'
|
Returns:
| Type | Description |
|---|---|
Any
|
The resulting globals dict from the executed script, or None on failure. |