A Cloud Native, General Tree-based configuration tool for OpenFOAM. This project is fully refactored to support N-ary trees (General Trees) where any node can have any number of children, strictly adhering to the FOSSEE Task 1 requirements.
It runs entirely within Docker, ensuring consistency across Development, CI/CD, and Production environments.
graph TD
subgraph Docker["Cloud Native Container"]
CLI["main.py (CLI)"]
GUI["gui.py (Tkinter)"]
Helper["utils.py (TreeHelper)"]
Node["node.py (General Tree Node)"]
RY["ruamel.yaml"]
end
Files["YAML Config File"]
User[User]
User -->|docker compose run| CLI
User -->|docker compose run| GUI
CLI --> Helper
GUI --> Helper
Helper -->|Builds| Node
Helper -->|Reads/Writes| RY
RY -->|Persists| Files
- Docker & Docker Compose
Build the container once. This encapsulates Python 3.11, Tkinter, X11 libs, and all dependencies.
docker compose buildFollow these steps to verify the "General Tree" implementation.
Visualize the hierarchical General Tree structure.
Command:
docker compose run --rm app python main.py test_config.yaml --print-treeExpected Output:
├── simulation
│ ├── gravity
│ │ ├── ...
│ └── active: true
Add a new child node deeper in the tree. Note: This proves that we can add children to any parent, not just left/right.
Command:
docker compose run --rm app python main.py test_config.yaml --add-node "simulation.viscosity" --val 0.01Expected Output:
Added node 'simulation.viscosity' with value '0.01'
(You can run the --print-tree command again to see it added under simulation)
Modify an existing value in the tree.
Command:
docker compose run --rm app python main.py test_config.yaml --edit-node "simulation.endTime" --val 50Expected Output:
Updated node 'simulation.endTime' to '50'
Remove a child from a parent node.
Command:
docker compose run --rm app python main.py test_config.yaml --delete-node "simulation.active"Expected Output:
Deleted node 'simulation.active'
Launch the graphical interface from the cloud container to your local display.
Command:
docker compose run --rm app python gui.pyExpected Output:
- A window titled "OpenFOAM Tree Editor" appears.
- You can load
test_config.yaml. - The
Treeviewwidget displays the nested tree. - Double-clicking values allows editing.
MIT License