how to run loe-coe
Instructions to Run the Pipe-Breaks App
Flow 1: Running the Streamlit UI (app.py)
Note : deepdive on app.py link
Load the Python Environment: Ensure you are in the correct Python environment:
workon pipe-break38Run the Streamlit App: Execute the
app.pyfile to start the Streamlit UI:streamlit run app.pyUse the Streamlit Interface:
- Open your web browser and navigate to the local server address provided by Streamlit (usually
http://localhost:8501). - Use the sidebar to select algorithms and utilities, create shell scripts, find buildings affected by water main breaks, and view results.
- Open your web browser and navigate to the local server address provided by Streamlit (usually
Flow 2: Running Scripts with script_runner.py
Note : additional info on script_runner.py mermaid
Load the Python Environment: Ensure you are in the correct Python environment:
workon pipe-break38Run
script_runner.pywith Debugger: To run the script with a debugger, use your preferred IDE. Below are instructions for setting up debugging in VSCode.
How to Debug the Pipe-Breaks App in VSCode
Create a
launch.jsonfor Python file:In your VSCode workspace, create or update the
.vscode/launch.jsonfile with the following configuration:{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "script_runner.py",
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"args": ["-s", "cox_ph", "-u", "dnv"],
"justMyCode": true
}
]
}Explanation of
launch.jsonConfiguration:program: Should contain the entry point of your package which calls all the other files.cwd: Sets the Current Working Directory to theworkspaceFolder.args: Any additional arguments that need to be passed to the script (e.g.,-s xgbse_gqc -u dnv).
Run the Debugger:
- Open the
script_runner.pyfile in VSCode. - Press
F5to start debugging using the specified configuration inlaunch.json.
- Open the
This setup allows you to run and debug the script_runner.py script with specific arguments, enabling you to switch between different algorithms and utilities as needed.