Skip to content

Conversation

@edwinjosechittilappilly
Copy link
Contributor

@edwinjosechittilappilly edwinjosechittilappilly commented Jan 14, 2025

Add new FastAPI application with endpoints for data upload, preprocessing, and optimization.

  • API Endpoints:

    • Add /upload endpoint to upload data and return a data ID.
    • Add /preprocess/{data_id} endpoint to preprocess data using the data ID.
    • Add /optimize/{data_id} endpoint to start optimization using the data ID.
    • Implement background task for running optimization asynchronously.
    • Add /task/{task_id} endpoint to check the status and progress of ongoing tasks.
  • Data Handling:

    • Store uploaded data as .pkl files for future use.
    • Add functions to handle data storage and retrieval by data ID in data.py.
  • Optimization:

    • Modify Optimizer class to accept data ID and retrieve data accordingly in optimizer.py.
  • Database:

    • Add SQLModel classes for storing task IDs and data references in models.py.
    • Use SQLModel to store task IDs and data references in a SQLite database.
  • Tests:

    • Add tests for the new FastAPI endpoints in test_api.py.
    • Test /upload endpoint for data upload and data ID generation.
    • Test /preprocess/{data_id} endpoint for data preprocessing.
    • Test /optimize/{data_id} endpoint for starting optimization.
    • Test /task/{task_id} endpoint for checking task status.

For more details, open the Copilot Workspace session.

Add new FastAPI application with endpoints for data upload, preprocessing, and optimization.

* **API Endpoints**:
  - Add `/upload` endpoint to upload data and return a data ID.
  - Add `/preprocess/{data_id}` endpoint to preprocess data using the data ID.
  - Add `/optimize/{data_id}` endpoint to start optimization using the data ID.
  - Implement background task for running optimization asynchronously.
  - Add `/task/{task_id}` endpoint to check the status and progress of ongoing tasks.

* **Data Handling**:
  - Store uploaded data as .pkl files for future use.
  - Add functions to handle data storage and retrieval by data ID in `data.py`.

* **Optimization**:
  - Modify `Optimizer` class to accept data ID and retrieve data accordingly in `optimizer.py`.

* **Database**:
  - Add SQLModel classes for storing task IDs and data references in `models.py`.
  - Use SQLModel to store task IDs and data references in a SQLite database.

* **Tests**:
  - Add tests for the new FastAPI endpoints in `test_api.py`.
  - Test `/upload` endpoint for data upload and data ID generation.
  - Test `/preprocess/{data_id}` endpoint for data preprocessing.
  - Test `/optimize/{data_id}` endpoint for starting optimization.
  - Test `/task/{task_id}` endpoint for checking task status.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/Qentora/quoptuna?shareId=XXXX-XXXX-XXXX-XXXX).
@codecov
Copy link

codecov bot commented Jan 14, 2025

❌ 4 Tests Failed:

Tests completed Failed Passed Skipped
4 4 0 0
View the top 3 failed tests by shortest run time
tests/test_api.py::tests.test_api
Stack Traces | 0s run time
ImportError while importing test module '.../quoptuna/tests/test_api.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
.../usr/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_api.py:1: in <module>
    from fastapi.testclient import TestClient
E   ModuleNotFoundError: No module named 'fastapi'
tests/test_create_model.py::tests.test_create_model
Stack Traces | 0s run time
ImportError while importing test module '.../quoptuna/tests/test_create_model.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
.../usr/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_create_model.py:6: in <module>
    from quoptuna.backend.models import (
src/quoptuna/__init__.py:2: in <module>
    from .backend.optimizer import Optimizer
.../quoptuna/backend/optimizer.py:10: in <module>
    from quoptuna.backend.models import create_model
.../quoptuna/backend/models.py:4: in <module>
    from sqlmodel import Field, SQLModel
E   ModuleNotFoundError: No module named 'sqlmodel'
tests/test_xai.py::tests.test_xai
Stack Traces | 0s run time
ImportError while importing test module '.../quoptuna/tests/test_xai.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
.../usr/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_xai.py:5: in <module>
    from quoptuna.backend.models import MLPClassifier
.../quoptuna/backend/models.py:4: in <module>
    from sqlmodel import Field, SQLModel
E   ModuleNotFoundError: No module named 'sqlmodel'

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

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