Development Setup

git branch

This section explains how to add or update modules for QGas.

Add Python Modules

  1. Add the package to environment.yml under dependencies or the pip: section.
  2. Update your environment:
    • conda env update -f environment.yml
    • Activate with conda activate QGas
  3. Verify the install by importing the module in Python.

Add JavaScript Modules

  1. Place the new module in js/ (or a subfolder like js/ui/).
  2. Import or reference it from the relevant entry file (usually js/core.js or a UI module).
  3. Reload the browser (Ctrl+F5) to see changes.

Add Other Assets

Set breakpoints in Server.py, then press F5 to start debugging.

JavaScript Debugging

Use browser developer tools:

  1. Open browser DevTools (F12)
  2. Go to Sources tab
  3. Find files under localhost:8000/js/
  4. Set breakpoints by clicking line numbers
  5. Use Console tab for console.log() output

Common Debugging Scenarios

Server Won't Start

Map Doesn't Load

Tool Not Working

Making Changes

Adding a New Tool

  1. Create new file: js/ui/tools/my_tool.js
  2. Implement tool with activation/deactivation functions
  3. Add script tag in GUI.html
  4. Register in js/ui/tools.js tool list
  5. Add button in tools popup grid