Skip to content

[WIP] Add indicators structure and tasks mapping for CLIME and Vortex - #2

Merged
Brucesquared2 merged 1 commit into
mainfrom
copilot/devmonorepo-plugins
Oct 17, 2025
Merged

[WIP] Add indicators structure and tasks mapping for CLIME and Vortex#2
Brucesquared2 merged 1 commit into
mainfrom
copilot/devmonorepo-plugins

Conversation

Copilot AI commented Oct 17, 2025

Copy link
Copy Markdown
Contributor
  • Create tasks.yml at repo root mapping task names to module:callable
  • Create src/indicators/vortex package with init.py and vortex.py
  • Create src/indicators/clime package with init.py and clime.py
  • Create app/main.py with FastAPI supporting tasks.yml and /run/{task_name} endpoint
  • Test the FastAPI server and task endpoints
  • Verify all files work together correctly
Original prompt

Add a plugin-style indicators structure, tasks mapping, and devcontainer setup to the MDPS repo so we can add CLIME and Vortex as plugins and call them via the existing FastAPI wrapper.

Files to add and modify (create a new branch dev/monorepo-plugins targeting main):

  1. Add tasks.yml at repo root mapping short task names to module:callable:
vortex: indicators.vortex:vortex_run
clime: indicators.clime:clime_run
  1. Add src/indicators/vortex/init.py (expose vortex_run) and src/indicators/vortex/vortex.py (placeholder implementation):
  • src/indicators/vortex/init.py:
from .vortex import vortex_run

__all__ = ["vortex_run"]
  • src/indicators/vortex/vortex.py:
"""Simple placeholder Vortex indicator module.
Replace the implementation with your production Vortex code.
"""

def vortex_run(params: dict) -> dict:
    """Run the Vortex indicator logic.

    params example: {"symbol": "BTCUSDT", "window": 14}
    Returns a JSON-serializable dict with signals and metrics.
    """
    symbol = params.get("symbol", "UNKNOWN")
    window = int(params.get("window", 14))

    # placeholder computation
    signals = [{"timestamp": 0, "signal": "hold"}]
    metrics = {"window": window, "symbol": symbol}

    return {"job": "vortex", "symbol": symbol, "signals": signals, "metrics": metrics}
  1. Add src/indicators/clime/init.py and src/indicators/clime/clime.py (skeleton for CLIME integration):
  • src/indicators/clime/init.py:
from .clime import clime_run

__all__ = ["clime_run"]
  • src/indicators/clime/clime.py:
"""CLIME integration placeholder.
Replace with the actual CLIME algorithm and interface.
"""

def clime_run(params: dict) -> dict:
    """Run CLIME algorithm with given params and return results as a dict."""
    symbol = params.get("symbol", "UNKNOWN")
    # placeholder
    results = {"job": "clime", "symbol": symbol, "status": "ok"}
    return results
  1. Modify app/main.py to support tasks.yml mapping and new endpoint /run/{task_name}. The modified main.py should still support MDPS_ENTRYPOINT but prefer tasks.yml when task endpoint is used. If tasks.yml present, load mappings at startup and add an endpoint to run a named task. When running a named task, resolve the module:callable from tasks.yml and run it in background (same write to .quant_runs/<job_id>.json). Use safe importlib.import_module and existing _safe_call_entrypoint logic.

(Provide the exact contents to replace app/main.py with a version that supports both dynamic MDPS_ENTRYPOINT and tasks.yml mapping.)

  1. Add a devcontainer postCreateCommand to .devcontainer/devcontainer.json to automatically install deps and register kernel:
  • Add or update devcontainer.json snippet to include:
    "postCreateCommand": "python -m pip install --upgrade pip && python -m pip install -r requirements.txt -r requirements-api.txt && python -m pip install -e . && python -m ipykernel install --user --name mdps-dev --display-name 'MDPS (devcontainer)'"
  1. Add a package-friendly setup.py if not already present (if present, update to include packages=find_packages(where='src'), package_dir={'': 'src'}). If setup.py exists, update it accordingly.

Constraints and notes:

  • Do NOT add secrets. Only add example .env files if needed.
  • Use package import paths consistent with setup.py package_dir mapping (src as root).
  • Keep functions small and placeholders obvious so user can paste production code later.

Please create the branch dev/monorepo-plugins, add/modify these files, commit and open a PR titled "Add indicators plugin structure, tasks.yml and devcontainer setup" targeting main. Return the PR URL and branch name when done.

This pull request was created as a result of the following prompt from Copilot chat.

Add a plugin-style indicators structure, tasks mapping, and devcontainer setup to the MDPS repo so we can add CLIME and Vortex as plugins and call them via the existing FastAPI wrapper.

Files to add and modify (create a new branch dev/monorepo-plugins targeting main):

  1. Add tasks.yml at repo root mapping short task names to module:callable:
vortex: indicators.vortex:vortex_run
clime: indicators.clime:clime_run
  1. Add src/indicators/vortex/init.py (expose vortex_run) and src/indicators/vortex/vortex.py (placeholder implementation):
  • src/indicators/vortex/init.py:
from .vortex import vortex_run

__all__ = ["vortex_run"]
  • src/indicators/vortex/vortex.py:
"""Simple placeholder Vortex indicator module.
Replace the implementation with your production Vortex code.
"""

def vortex_run(params: dict) -> dict:
    """Run the Vortex indicator logic.

    params example: {"symbol": "BTCUSDT", "window": 14}
    Returns a JSON-serializable dict with signals and metrics.
    """
    symbol = params.get("symbol", "UNKNOWN")
    window = int(params.get("window", 14))

    # placeholder computation
    signals = [{"timestamp": 0, "signal": "hold"}]
    metrics = {"window": window, "symbol": symbol}

    return {"job": "vortex", "symbol": symbol, "signals": signals, "metrics": metrics}
  1. Add src/indicators/clime/init.py and src/indicators/clime/clime.py (skeleton for CLIME integration):
  • src/indicators/clime/init.py:
from .clime import clime_run

__all__ = ["clime_run"]
  • src/indicators/clime/clime.py:
"""CLIME integration placeholder.
Replace with the actual CLIME algorithm and interface.
"""

def clime_run(params: dict) -> dict:
    """Run CLIME algorithm with given params and return results as a dict."""
    symbol = params.get("symbol", "UNKNOWN")
    # placeholder
    results = {"job": "clime", "symbol": symbol, "status": "ok"}
    return results
  1. Modify app/main.py to support tasks.yml mapping and new endpoint /run/{task_name}. The modified main.py should still support MDPS_ENTRYPOINT but prefer tasks.yml when task endpoint is used. If tasks.yml present, load mappings at startup and add an endpoint to run a named task. When running a named task, resolve the module:callable from tasks.yml and run it in background (same write to .quant_runs/<job_id>.json). Use safe importlib.import_module and existing _safe_call_entrypoint logic.

(Provide the exact contents to replace app/main.py with a version that supports both dynamic MDPS_ENTRYPOINT and tasks.yml mapping.)

  1. Add a devcontainer postCreateCommand to .devcontainer/devcontainer.json to automatically install deps and register kernel:
  • Add or update devcontainer.json snippet to include:
    "postCreateCommand": "python -m pip install --upgrade pip && python -m pip install -r requirements.txt -r requirements-api.txt && python -m pip install -e . && python -m ipykernel install --user --name mdps-dev --display-name 'MDPS (devcontainer)'"
  1. Add a package-friendly setup.py if not already present (if present, update to include packages=find_packages(where='src'), package_dir={'': 'src'}). If setup.py exists, update it accordingly.

Constraints and notes:

  • Do NOT add secrets. Only add example .env files if needed.
  • Use package import paths consistent with setup.py package_dir mapping (src as root).
  • Keep functions small and placeholders obvious so user can paste production code later.

Please create the branch dev/monorepo-plugins, add/modify these files, commit and open a PR titled "Add indicators plugin structure, tasks.yml and devcontainer setup" targeting main. Return the PR URL and branch name when done.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@Brucesquared2
Brucesquared2 marked this pull request as ready for review October 17, 2025 04:04
@Brucesquared2
Brucesquared2 merged commit 50a49f5 into main Oct 17, 2025
1 check failed
Copilot AI requested a review from Brucesquared2 October 17, 2025 04:05
Copilot AI added a commit that referenced this pull request Apr 6, 2026
Agent-Logs-Url: https://github.com/Brucesquared2/MDPS/sessions/5712f530-c0ad-45bd-b299-5c4c5ceed8eb

Co-authored-by: Brucesquared2 <192056090+Brucesquared2@users.noreply.github.com>
Copilot AI added a commit that referenced this pull request Apr 6, 2026
…vcontainer, tasks.yml, and update setup.py

Agent-Logs-Url: https://github.com/Brucesquared2/MDPS/sessions/5712f530-c0ad-45bd-b299-5c4c5ceed8eb

Co-authored-by: Brucesquared2 <192056090+Brucesquared2@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants