Skip to content

Commit

Permalink
ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
Mustafa Kerem Kurban committed Sep 24, 2024
1 parent 64bdfe5 commit 8d58c2a
Show file tree
Hide file tree
Showing 23 changed files with 33 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/neuroagent/app/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
from neuroagent.multi_agents import BaseMultiAgent, SupervisorMultiAgent
from neuroagent.tools import (
ElectrophysFeatureTool,
GetMEModelTool,
GetMorphoTool,
GetTracesTool,
KGMorphoFeatureTool,
LiteratureSearchTool,
MorphologyFeatureTool,
ResolveBrainRegionTool,
GetMEModelTool,
)
from neuroagent.utils import RegionMeta, get_file_from_KG

Expand Down
2 changes: 1 addition & 1 deletion src/neuroagent/tools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Tools folder."""

from neuroagent.tools.electrophys_tool import ElectrophysFeatureTool, FeaturesOutput
from neuroagent.tools.get_me_model_tool import GetMEModelTool
from neuroagent.tools.get_morpho_tool import GetMorphoTool, KnowledgeGraphOutput
from neuroagent.tools.kg_morpho_features_tool import (
KGMorphoFeatureOutput,
Expand All @@ -19,7 +20,6 @@
ResolveBrainRegionTool,
)
from neuroagent.tools.traces_tool import GetTracesTool, TracesOutput
from neuroagent.tools.get_me_model_tool import GetMEModelTool

__all__ = [
"BRResolveOutput",
Expand Down
1 change: 1 addition & 0 deletions tests/agents/test_simple_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from pathlib import Path

import pytest

from neuroagent.agents import AgentOutput, AgentStep, SimpleAgent


Expand Down
1 change: 1 addition & 0 deletions tests/agents/test_simple_chat_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import pytest
from langchain_core.messages import HumanMessage, ToolMessage
from langgraph.checkpoint.sqlite.aio import AsyncSqliteSaver

from neuroagent.agents import AgentOutput, AgentStep, SimpleChatAgent


Expand Down
7 changes: 4 additions & 3 deletions tests/app/database/test_threads.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
"""Test of the thread router."""

import pytest
from sqlalchemy import MetaData, create_engine
from sqlalchemy.orm import Session
from sqlalchemy.sql.expression import Select

from neuroagent.app.config import Settings
from neuroagent.app.dependencies import get_language_model, get_settings
from neuroagent.app.main import app
from neuroagent.app.routers.database.schemas import GetThreadsOutput
from sqlalchemy import MetaData, create_engine
from sqlalchemy.orm import Session
from sqlalchemy.sql.expression import Select


def test_create_thread(patch_required_env, app_client, db_connection):
Expand Down
1 change: 1 addition & 0 deletions tests/app/database/test_tools.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Test of the tool router."""

import pytest

from neuroagent.app.config import Settings
from neuroagent.app.dependencies import get_language_model, get_settings
from neuroagent.app.main import app
Expand Down
3 changes: 2 additions & 1 deletion tests/app/test_config.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
"""Test config"""

import pytest
from neuroagent.app.config import Settings
from pydantic import ValidationError

from neuroagent.app.config import Settings


def test_required(monkeypatch, patch_required_env):
settings = Settings()
Expand Down
5 changes: 3 additions & 2 deletions tests/app/test_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from langchain_openai import ChatOpenAI
from langgraph.checkpoint.postgres.aio import AsyncPostgresSaver
from langgraph.checkpoint.sqlite.aio import AsyncSqliteSaver

from neuroagent.agents import SimpleAgent, SimpleChatAgent
from neuroagent.app.dependencies import (
Settings,
Expand All @@ -24,21 +25,21 @@
get_kg_morpho_feature_tool,
get_language_model,
get_literature_tool,
get_me_model_tool,
get_morpho_tool,
get_morphology_feature_tool,
get_traces_tool,
get_update_kg_hierarchy,
get_user_id,
get_me_model_tool,
)
from neuroagent.tools import (
ElectrophysFeatureTool,
GetMEModelTool,
GetMorphoTool,
GetTracesTool,
KGMorphoFeatureTool,
LiteratureSearchTool,
MorphologyFeatureTool,
GetMEModelTool,
)


Expand Down
1 change: 1 addition & 0 deletions tests/app/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from unittest.mock import patch

from fastapi.testclient import TestClient

from neuroagent.app.dependencies import get_settings
from neuroagent.app.main import app

Expand Down
1 change: 1 addition & 0 deletions tests/app/test_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import pytest
from fastapi.requests import Request
from fastapi.responses import Response

from neuroagent.app.config import Settings
from neuroagent.app.middleware import strip_path_prefix

Expand Down
7 changes: 4 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
from httpx import AsyncClient
from langchain_core.language_models.fake_chat_models import GenericFakeChatModel
from langchain_core.messages import AIMessage
from sqlalchemy import MetaData, create_engine
from sqlalchemy.exc import OperationalError
from sqlalchemy.orm import Session

from neuroagent.app.config import Settings
from neuroagent.app.dependencies import get_kg_token, get_settings
from neuroagent.app.main import app
from neuroagent.tools import GetMorphoTool
from sqlalchemy import MetaData, create_engine
from sqlalchemy.exc import OperationalError
from sqlalchemy.orm import Session


@pytest.fixture(name="app_client")
Expand Down
1 change: 1 addition & 0 deletions tests/test_cell_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from pathlib import Path

import pytest

from neuroagent.cell_types import CellTypesMeta, get_celltypes_descendants

CELL_TYPES_FILE = Path(__file__).parent / "data" / "kg_cell_types_hierarchy_test.json"
Expand Down
1 change: 1 addition & 0 deletions tests/test_resolving.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pytest
from httpx import AsyncClient

from neuroagent.resolving import (
es_resolve,
escape_punctuation,
Expand Down
1 change: 1 addition & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import pytest
from httpx import AsyncClient

from neuroagent.schemas import KGMetadata
from neuroagent.utils import (
RegionMeta,
Expand Down
3 changes: 2 additions & 1 deletion tests/tools/test_basic_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
from langchain_core.messages import AIMessage, HumanMessage
from langchain_core.tools import ToolException
from langgraph.prebuilt import create_react_agent
from neuroagent.tools.base_tool import BasicTool
from pydantic import BaseModel

from neuroagent.tools.base_tool import BasicTool


class input_for_test(BaseModel):
test_str: str
Expand Down
1 change: 1 addition & 0 deletions tests/tools/test_electrophys_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import httpx
import pytest
from langchain_core.tools import ToolException

from neuroagent.tools import ElectrophysFeatureTool
from neuroagent.tools.electrophys_tool import (
CALCULATED_FEATURES,
Expand Down
1 change: 1 addition & 0 deletions tests/tools/test_get_me_model_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import httpx
import pytest
from langchain_core.tools import ToolException

from neuroagent.tools.get_me_model_tool import GetMEModelTool, MEModelOutput


Expand Down
1 change: 1 addition & 0 deletions tests/tools/test_get_morpho_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import httpx
import pytest
from langchain_core.tools import ToolException

from neuroagent.tools import GetMorphoTool
from neuroagent.tools.get_morpho_tool import KnowledgeGraphOutput

Expand Down
1 change: 1 addition & 0 deletions tests/tools/test_kg_morpho_features_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import httpx
import pytest
from langchain_core.tools import ToolException

from neuroagent.tools import KGMorphoFeatureTool
from neuroagent.tools.kg_morpho_features_tool import (
FeatRangeInput,
Expand Down
1 change: 1 addition & 0 deletions tests/tools/test_literature_search_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import httpx
import pytest

from neuroagent.tools import LiteratureSearchTool
from neuroagent.tools.literature_search_tool import ParagraphMetadata

Expand Down
1 change: 1 addition & 0 deletions tests/tools/test_morphology_features_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import httpx
import pytest
from langchain_core.tools import ToolException

from neuroagent.tools import MorphologyFeatureTool
from neuroagent.tools.morphology_features_tool import MorphologyFeatureOutput

Expand Down
1 change: 1 addition & 0 deletions tests/tools/test_resolve_br_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import pytest
from httpx import AsyncClient

from neuroagent.tools import ResolveBrainRegionTool
from neuroagent.tools.resolve_brain_region_tool import (
BRResolveOutput,
Expand Down
1 change: 1 addition & 0 deletions tests/tools/test_traces_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import httpx
import pytest
from langchain_core.tools import ToolException

from neuroagent.tools import GetTracesTool
from neuroagent.tools.traces_tool import TracesOutput

Expand Down

0 comments on commit 8d58c2a

Please sign in to comment.