diff --git a/.gitignore b/.gitignore index f3bf63bc..24348d29 100644 --- a/.gitignore +++ b/.gitignore @@ -1,17 +1,20 @@ -# Ignore Gradle project-specific cache directory -.gradle -# Ignore Gradle build output directory -build -# Ignore vscode metadata -.vscode -# Ingore pyhton cache -__pycache__ -# Ignore macos -.DS_Store -# Ignore generated python code -src/python/account/ - -*.pyc - -node_modules/ -angular-app/.angular \ No newline at end of file +# Ignore Gradle project-specific cache directory +.gradle +# Ignore Gradle build output directory +build +# Ignore vscode metadata +.vscode +# Ingore pyhton cache +__pycache__ +# Ignore macos +.DS_Store +# Ignore generated python code +src/python/account/ + +*.pyc + +node_modules/ +angular-app/.angular + +# Ignore sentence-transformer local model cache +service/sentence_transformer/models/ \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index 4af1befe..c0715dad 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -28,6 +28,9 @@ pipeline { } stage('Save Docker image') { + when { + branch 'main' + } steps { sh 'docker save ${IMAGE_PREFIX}-app:${IMAGE_VERSION} | gzip > app-image.tar.gz' } diff --git a/service/Dockerfile b/service/Dockerfile index 2335ec87..90d1a619 100644 --- a/service/Dockerfile +++ b/service/Dockerfile @@ -1,9 +1,7 @@ -FROM python:3.12-slim-bookworm +ARG BASE_IMAGE=inse-base-static:latest +FROM $BASE_IMAGE -RUN mkdir /test && \ - mkdir /data && \ - pip install --root-user-action=ignore --no-cache-dir --upgrade pip && \ - pip install --root-user-action=ignore --no-cache-dir --disable-pip-version-check \ +RUN pip install --root-user-action=ignore --no-cache-dir --disable-pip-version-check \ "fastapi~=0.115.0" \ "SQLAlchemy~=2.0.0" \ "pyjwt~=2.8.0" \ diff --git a/service/Dockerfile.base b/service/Dockerfile.base new file mode 100644 index 00000000..77926c9a --- /dev/null +++ b/service/Dockerfile.base @@ -0,0 +1,10 @@ +FROM python:3.12-slim-bookworm + +RUN mkdir /test && \ + mkdir /data && \ + pip install --root-user-action=ignore --no-cache-dir --upgrade pip && \ + pip install --root-user-action=ignore --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu && \ + pip install --root-user-action=ignore --no-cache-dir "sentence-transformers~=5.5.1" + +ENV SENTENCE_TRANSFORMERS_HOME=/models +RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('paraphrase-multilingual-mpnet-base-v2')" diff --git a/service/build.gradle b/service/build.gradle index 0d569c9c..40510af3 100644 --- a/service/build.gradle +++ b/service/build.gradle @@ -2,7 +2,32 @@ plugins { id 'base' } +task createBaseImage(type: Exec) { + commandLine 'docker', 'build', '--platform', "${targetPlatform}", '-f', 'Dockerfile.base', '-t', "${imagePrefix}-base-static:latest", '.' +} + +task buildBaseImageIfNeeded { + doLast { + def baseImage = "${imagePrefix}-base-static:latest" + def checkCmd = ["docker", "image", "inspect", baseImage] + def process = checkCmd.execute() + process.waitFor() + if (process.exitValue() != 0) { + println "Base image ${baseImage} not found. Building it..." + def buildCmd = ["docker", "build", "--platform", "${targetPlatform}", "-f", "Dockerfile.base", "-t", baseImage, "."] + def buildProcess = buildCmd.execute([], projectDir) + buildProcess.consumeProcessOutput(System.out, System.err) + if (buildProcess.waitFor() != 0) { + throw new GradleException("Failed to build base image.") + } + } else { + println "Base image ${baseImage} found. Skipping build." + } + } +} + task createImage(type: Exec) { + dependsOn buildBaseImageIfNeeded commandLine 'docker', 'build', '--platform', "${targetPlatform}", '-t', "${imagePrefix}-service:${imageVersion}", '.' } diff --git a/service/pyproject.toml b/service/pyproject.toml index 689f20cf..9e45ebc4 100644 --- a/service/pyproject.toml +++ b/service/pyproject.toml @@ -19,4 +19,14 @@ dependencies = [ "pyyaml~=6.0.1", "sqlalchemy~=2.0.0", "uvicorn~=0.29.0", + "sentence-transformers~=5.5.1", + "torch", ] + +[[tool.uv.index]] +name = "pytorch-cpu" +url = "https://download.pytorch.org/whl/cpu" +explicit = true + +[tool.uv.sources] +torch = { index = "pytorch-cpu" } diff --git a/service/sentence_transformer/download_model.py b/service/sentence_transformer/download_model.py new file mode 100644 index 00000000..60db0a4b --- /dev/null +++ b/service/sentence_transformer/download_model.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python3 +""" +Download the sentence-transformers model to the default cache directory +so it is available for local runs or testing. + +Usage (run once from project root): + python service/sentence_transformer/download_model.py +""" +from sentence_transformers import SentenceTransformer + +MODEL_NAME = "paraphrase-multilingual-mpnet-base-v2" +print(f"Downloading '{MODEL_NAME}' to default cache directory...") +model = SentenceTransformer(MODEL_NAME) +print("Done.") diff --git a/service/sentence_transformer/index_topics.py b/service/sentence_transformer/index_topics.py new file mode 100644 index 00000000..35cea0cb --- /dev/null +++ b/service/sentence_transformer/index_topics.py @@ -0,0 +1,259 @@ +#!/usr/bin/env python3 +""" +One-time script to fetch all topics from 'openalex-topics', +vectorize display names and chunked descriptions using the sentence-transformers model, +and push them to the 'topicvectors' index with multi-vector hybrid mapping. +""" +import os +import sys +import json +import base64 +import re +from pathlib import Path +import httpx +import numpy as np +from dotenv import load_dotenv + +# Add service/src/main to python path to load settings +current_dir = Path(__file__).parent.resolve() +project_root = current_dir.parent.parent.resolve() +env_path = project_root / "service" / "src" / "main" / "inse" / ".env" +load_dotenv(dotenv_path=env_path) + +sys.path.append(str(project_root / "service" / "src" / "main")) +from inse.config import settings + +ELASTIC_URL = settings.elasticsearch_url +API_KEY = settings.elasticsearch_api_key +MODEL_NAME = "paraphrase-multilingual-mpnet-base-v2" + +# Import sentence-transformers +from sentence_transformers import SentenceTransformer + +headers = { + "Authorization": f"ApiKey {API_KEY}", + "Content-Type": "application/json" +} + +def float_array_to_base64(vector): + """ + Convert a float vector into a Base64 string representing 32-bit big-endian float bytes. + Elasticsearch expects big-endian floats for binary/Base64 dense_vector encoding. + """ + arr = np.asarray(vector, dtype=np.float32) + big_endian_bytes = arr.astype('>f4').tobytes() + return base64.b64encode(big_endian_bytes).decode('utf-8') + +def split_into_sentences(text): + if not text: + return [] + # Split on period, exclamation, or question mark followed by whitespace + sentences = re.split(r'(?<=[.!?])\s+', text.strip()) + # Filter out empty or extremely short sentences + return [s for s in sentences if len(s.strip()) > 3] + +def check_and_update_mapping(): + print("Checking 'topicvectors' index...") + + with httpx.Client(timeout=30.0) as client: + exists_resp = client.head(f"{ELASTIC_URL}topicvectors", headers=headers) + if exists_resp.status_code == 404: + print("Index 'topicvectors' does not exist. Creating index with mapping...") + create_payload = { + "mappings": { + "properties": { + "id": {"type": "keyword"}, + "display_name": { + "type": "text", + "fields": { + "keyword": {"type": "keyword", "ignore_above": 256} + } + }, + "display_name_vector": { + "type": "dense_vector", + "dims": 768, + "index": True, + "similarity": "cosine", + "index_options": { + "type": "int8_hnsw", + "m": 16, + "ef_construction": 100 + } + }, + "description": {"type": "text"}, + "description_vectors": { + "type": "nested", + "properties": { + "vector": { + "type": "dense_vector", + "dims": 768, + "index": True, + "similarity": "cosine", + "index_options": { + "type": "int8_hnsw", + "m": 16, + "ef_construction": 100 + } + } + } + }, + "keywords": { + "type": "text", + "fields": { + "keyword": {"type": "keyword"} + } + }, + "cited_by_count": {"type": "long"}, + "works_count": {"type": "long"}, + "updated_date": {"type": "date"}, + "created_date": {"type": "date"} + } + } + } + resp = client.put( + f"{ELASTIC_URL}topicvectors", + json=create_payload, + headers=headers + ) + if resp.status_code == 200: + print("Successfully created 'topicvectors' index.") + else: + print(f"Failed to create index: {resp.status_code} - {resp.text}") + resp.raise_for_status() + else: + print("Index 'topicvectors' already exists.") + +def fetch_all_topics(): + print("Fetching topics from 'openalex-topics'...") + topics = [] + size = 1000 + offset = 0 + + with httpx.Client(timeout=60.0) as client: + while True: + payload = { + "query": {"match_all": {}}, + "from": offset, + "size": size + } + resp = client.post( + f"{ELASTIC_URL}openalex-topics/_search", + json=payload, + headers=headers + ) + resp.raise_for_status() + data = resp.json() + hits = data.get("hits", {}).get("hits", []) + if not hits: + break + topics.extend(hits) + offset += len(hits) + print(f"Fetched {len(topics)} topics so far...") + if len(hits) < size: + break + + print(f"Total topics fetched: {len(topics)}") + return topics + +def bulk_index_topics(topics, display_name_vectors, nested_description_vectors): + print("Bulk indexing vectorized topics into 'topicvectors'...") + batch_size = 500 + + with httpx.Client(timeout=60.0) as client: + for i in range(0, len(topics), batch_size): + batch_topics = topics[i:i+batch_size] + batch_name_vecs = display_name_vectors[i:i+batch_size] + batch_desc_vecs_list = nested_description_vectors[i:i+batch_size] + + bulk_lines = [] + for t, name_vec, desc_vecs in zip(batch_topics, batch_name_vecs, batch_desc_vecs_list): + source = t["_source"] + + # Remove deprecated single vector if present + if "vector" in source: + del source["vector"] + + # Assign name vector as a standard float list + source["display_name_vector"] = name_vec.tolist() + + # Assign nested description vectors as standard float lists + source["description_vectors"] = [ + {"vector": vec.tolist()} for vec in desc_vecs + ] + + # Meta line + meta = {"index": {"_index": "topicvectors", "_id": t["_id"]}} + bulk_lines.append(json.dumps(meta)) + # Document line + bulk_lines.append(json.dumps(source)) + + payload = "\n".join(bulk_lines) + "\n" + resp = client.post( + f"{ELASTIC_URL}_bulk", + content=payload, + headers={"Authorization": f"ApiKey {API_KEY}", "Content-Type": "application/x-ndjson"} + ) + resp.raise_for_status() + resp_data = resp.json() + if resp_data.get("errors"): + print("Bulk indexing encountered errors! First few failed items:") + failed_items = [item for item in resp_data.get("items", []) if item.get("index", {}).get("status", 200) >= 400] + for item in failed_items[:5]: + print(json.dumps(item, indent=2)) + raise ValueError("Bulk indexing failed with document errors.") + print(f"Indexed batch {i} to {i + len(batch_topics)}") + +def main(): + check_and_update_mapping() + + topics = fetch_all_topics() + if not topics: + print("No topics found. Exiting.") + return + + print(f"Initializing SentenceTransformer model '{MODEL_NAME}'...") + model = SentenceTransformer(MODEL_NAME) + + # 1. Gather all texts to embed + display_names = [] + description_sentences_by_topic = [] + all_texts_to_embed = [] + + for t in topics: + source = t["_source"] + name = source.get("display_name") or "" + display_names.append(name) + all_texts_to_embed.append(name) + + desc = source.get("description") or "" + sentences = split_into_sentences(desc) + description_sentences_by_topic.append(sentences) + all_texts_to_embed.extend(sentences) + + print(f"Embedding {len(all_texts_to_embed)} texts (display names and description passages)...") + all_vectors = model.encode(all_texts_to_embed, show_progress_bar=True, batch_size=32) + + # 2. Map embeddings back to topics + display_name_vectors = [] + nested_description_vectors = [] + + vector_idx = 0 + for idx, t in enumerate(topics): + # First vector is the display name + display_name_vectors.append(all_vectors[vector_idx]) + vector_idx += 1 + + # Next N vectors are the description chunks + sentences = description_sentences_by_topic[idx] + topic_desc_vecs = [] + for _ in range(len(sentences)): + topic_desc_vecs.append(all_vectors[vector_idx]) + vector_idx += 1 + nested_description_vectors.append(topic_desc_vecs) + + # Bulk index + bulk_index_topics(topics, display_name_vectors, nested_description_vectors) + print("Done!") + +if __name__ == "__main__": + main() diff --git a/service/src/data/search_scores.json b/service/src/data/search_scores.json new file mode 100644 index 00000000..3f7d4e0b --- /dev/null +++ b/service/src/data/search_scores.json @@ -0,0 +1,150 @@ +{ + "query": "Robotics", + "max_score": 22.734766, + "results": [ + { + "topic_name": "Soft Robotics and Applications", + "score": 22.734766 + }, + { + "topic_name": "Robotics and Automated Systems", + "score": 21.997686 + }, + { + "topic_name": "Educational Robotics and Engineering", + "score": 21.919401 + }, + { + "topic_name": "Prosthetics and Rehabilitation Robotics", + "score": 21.846806 + }, + { + "topic_name": "Micro and Nano Robotics", + "score": 21.820261 + }, + { + "topic_name": "Reinforcement Learning in Robotics", + "score": 21.757397 + }, + { + "topic_name": "Robotics and Sensor-Based Localization", + "score": 19.993645 + }, + { + "topic_name": "Social Robot Interaction and HRI", + "score": 13.187252 + }, + { + "topic_name": "Robotic Locomotion and Control", + "score": 12.283064 + }, + { + "topic_name": "Power Line Inspection Robots", + "score": 11.873396 + }, + { + "topic_name": "Mechatronics Education and Applications", + "score": 11.171629 + }, + { + "topic_name": "Educational Technology and Optimization", + "score": 10.924184 + }, + { + "topic_name": "Mechanical and Thermal Properties Analysis", + "score": 10.924184 + }, + { + "topic_name": "Psychiatry, Mental Health, Neuroscience", + "score": 10.687462 + }, + { + "topic_name": "Advanced Materials and Mechanics", + "score": 10.460782 + }, + { + "topic_name": "Wetland Management and Conservation", + "score": 10.460782 + }, + { + "topic_name": "Artificial Intelligence Applications", + "score": 10.243518 + }, + { + "topic_name": "Digitalization, Law, and Regulation", + "score": 10.243518 + }, + { + "topic_name": "Engineering and Technology Innovations", + "score": 10.243518 + }, + { + "topic_name": "Advanced Algorithms and Applications", + "score": 10.035095 + }, + { + "topic_name": "Teaching and Learning Programming", + "score": 10.035095 + }, + { + "topic_name": "Distributed Control Multi-Agent Systems", + "score": 10.035095 + }, + { + "topic_name": "Advanced Scientific and Engineering Studies", + "score": 9.834986 + }, + { + "topic_name": "Space Satellite Systems and Control", + "score": 9.6427 + }, + { + "topic_name": "Smart Agriculture and AI", + "score": 9.279837 + }, + { + "topic_name": "Underwater Vehicles and Communication Systems", + "score": 9.279837 + }, + { + "topic_name": "Modular Robots and Swarm Intelligence", + "score": 7.7584143 + }, + { + "topic_name": "Diverse Perspectives in Modern Studies", + "score": 5.6107 + }, + { + "topic_name": "Teleoperation and Haptic Systems", + "score": 5.2510495 + }, + { + "topic_name": "Optimization and Search Problems", + "score": 5.1682277 + }, + { + "topic_name": "Adaptive Dynamic Programming Control", + "score": 4.8615155 + }, + { + "topic_name": "Robotic Mechanisms and Dynamics", + "score": 2.6450925 + }, + { + "topic_name": "Control and Dynamics of Mobile Robots", + "score": 2.5917463 + }, + { + "topic_name": "Robot Manipulation and Learning", + "score": 2.5859585 + }, + { + "topic_name": "Robotic Process Automation Applications", + "score": 1.7370787 + }, + { + "topic_name": "Robotic Path Planning Algorithms", + "score": 1.6302633 + } + ] +} diff --git a/service/src/data/users.json b/service/src/data/users.json index 6d5b0836..f7311478 100644 --- a/service/src/data/users.json +++ b/service/src/data/users.json @@ -1,18 +1,22 @@ { - "users": [ - { - "account": 0, - "organization": 0, - "username": "superadmin", - "password": "superadmin", - "superadmin": true - }, - { - "account": 1, - "organization": 1, - "username": "user", - "password": "user", - "superadmin": false - } - ] -} + "users": [ + { + "username": "superadmin", + "password": "superadmin", + "email": "some_email@uni-due.de", + "account": 0, + "organization": 0, + "organization_name": "University of Duisburg-Essen", + "superadmin": true + }, + { + "username": "user", + "password": "user", + "email": "user_email@uni-due.de", + "account": 1, + "organization": 1, + "organization_name": "University of Duisburg-Essen", + "superadmin": false + } + ] +} \ No newline at end of file diff --git a/service/src/main/inse/account/logic.py b/service/src/main/inse/account/logic.py index 96257b7e..b443254c 100644 --- a/service/src/main/inse/account/logic.py +++ b/service/src/main/inse/account/logic.py @@ -33,3 +33,34 @@ def validate_user(username: str, password: str) -> typing.Optional[model.User]: if user and user.password == password: return user return None + +def create_user(username, password, email, institution, superadmin) -> typing.Optional[model.User]: + ''' Adds a new user to the user configuration file. ''' + users = _get_users() + if any(u.username == username for u in users): + logger.warning("Attempt to create duplicate user: %s", username) + return None + + # Determine new IDs + next_account = max((u.account for u in users), default=0) + 1 + next_org = max((u.organization for u in users), default=0) + 1 + + new_user = model.User( + username=username, + password=password, + email=email, + account=next_account, + organization=next_org, + organization_name=institution, + superadmin=superadmin + ) + + users.append(new_user) + user_file = model.UserFile(users=users) + try: + with open('../data/users.json', 'w') as file: + file.write(user_file.model_dump_json(indent=4)) + return new_user + except Exception as e: + logger.error('Could not write user configuration file.', exc_info=e) + return None diff --git a/service/src/main/inse/account/model.py b/service/src/main/inse/account/model.py index dd409091..6a2cca19 100644 --- a/service/src/main/inse/account/model.py +++ b/service/src/main/inse/account/model.py @@ -13,8 +13,10 @@ class User(BaseModel): ''' An entry in the user configuration file. ''' username: str = Field(description="The username of the user.") password: str = Field(description="The password of the user.") + email: str = Field(description="The email of the user.") account: StrictInt = Field(description="The account id of the user.") organization: StrictInt = Field(description="The organization id of the user.") + organization_name: str = Field(description="The organization name of the user.") superadmin: bool = Field(default=False, description="Indicates whether the user is a superadmin.") @@ -27,6 +29,8 @@ class AuthAccount(BaseModel): i: int l: str o: int + e: str + on: str class AuthScope(BaseModel): diff --git a/service/src/main/inse/account/service.py b/service/src/main/inse/account/service.py index 7e67bb19..ae99cd7b 100644 --- a/service/src/main/inse/account/service.py +++ b/service/src/main/inse/account/service.py @@ -27,6 +27,7 @@ router = fastapi.APIRouter( @router.post( "/auth/id", + operation_id="getIdentityGrant", responses={ HTTP_200_OK: {"model": model.IdentityGrant}, HTTP_400_BAD_REQUEST: { @@ -55,7 +56,11 @@ async def get_identity_grant( exp = 12 * 60 * 60 token = security.id_token(user, exp=exp) account = model.AuthAccount( - i=user.account, l=user.username, o=user.organization + i=user.account, + l=user.username, + o=user.organization, + e=user.email, + on=user.organization_name, ) scope = model.AuthScope(t="ID", a=account, d=None, r=[]) grant = model.IdentityGrant( @@ -70,6 +75,7 @@ async def get_identity_grant( @router.post( "/auth/access", + operation_id="getAccessGrant", responses={ HTTP_200_OK: {"model": model.AccessGrant}, HTTP_400_BAD_REQUEST: { @@ -104,7 +110,11 @@ async def get_access_grant( token = security.access_token(user, exp=exp) refresh = security.refresh_token(user, exp=exp) auth_account = model.AuthAccount( - i=user.account, l=user.username, o=user.organization + i=user.account, + l=user.username, + o=user.organization, + e=user.email, + on=user.organization_name, ) scope = model.AuthScope( t="ACCESS", @@ -124,3 +134,36 @@ async def get_access_grant( except Exception as e: logger.error("Token generation failed (%s).", user.username, exc_info=e) raise fastapi.HTTPException(status_code=HTTP_500_INTERNAL_SERVER_ERROR) + + +@router.post( + "/create", + operation_id="createUser", + responses={ + HTTP_200_OK: {"model": model.User}, + HTTP_400_BAD_REQUEST: { + "model": None, + "description": "User creation failed (e.g. duplicate username).", + }, + HTTP_500_INTERNAL_SERVER_ERROR: { + "model": None, + "description": "Internal server error.", + }, + }, +) +async def create_user( + username: typing.Annotated[str, fastapi.Body()], + password: typing.Annotated[str, fastapi.Body()], + email: typing.Annotated[str, fastapi.Body()], + institution: typing.Annotated[str, fastapi.Body()], + superadmin: typing.Annotated[bool, fastapi.Body()] = False, +): + user = logic.create_user(username, password, email, institution, superadmin) + if user is None: + logger.info("User creation failed for (%s).", username) + raise fastapi.HTTPException( + status_code=HTTP_400_BAD_REQUEST, + detail="User creation failed. Username might already exist." + ) + logger.info("User created successfully (%s).", username) + return user diff --git a/service/src/main/inse/exceptions.py b/service/src/main/inse/exceptions.py new file mode 100644 index 00000000..772a9607 --- /dev/null +++ b/service/src/main/inse/exceptions.py @@ -0,0 +1,3 @@ +class NotFoundException(Exception): + def __init__(self, message: str): + super().__init__(message) diff --git a/service/src/main/inse/institutions/institutions_search_client.py b/service/src/main/inse/institutions/institutions_search_client.py index d2ea9f38..dd895930 100644 --- a/service/src/main/inse/institutions/institutions_search_client.py +++ b/service/src/main/inse/institutions/institutions_search_client.py @@ -1,78 +1,73 @@ import logging from typing import List, Set -import httpx - from inse.models.openalex.institution import Institution +from inse.exceptions import NotFoundException +from inse.integrations import elasticsearch logger = logging.getLogger(__name__) class InstitutionsSearchClient: - def __init__( - self, - base_url: str, - api_key: str, - ): - self.base_url = base_url - self.api_key = api_key - self.headers = { - "Content-Type": "application/json", - "Authorization": f"ApiKey {self.api_key}", - } + def __init__(self): + """ + Initializes the client. Credentials and URLs are handled by the + centralized elasticsearch integration. + """ + pass async def get_institution_by_id(self, raw_institution_id: str) -> Institution: + """ + Retrieves a single institution by its OpenAlex ID from the local Elasticsearch cluster. + """ query = { - "query": { - "match": { - "id": f"https://openalex.org/{raw_institution_id.upper()}", - } - }, - "size": 1, + "match": { + "id": f"https://openalex.org/{raw_institution_id.upper()}", + } } + + res = elasticsearch.search( + index="openalex-institutions", + query=query, + size=1 + ) + + hits = res.get("hits", {}).get("hits", []) + if not hits: + raise NotFoundException(f"Institution with ID '{raw_institution_id}' not found.") + authors = await self.get_authors_by_institution_id(raw_institution_id) logger.debug( "Retrieved authors for institution_id=%s: %s", raw_institution_id, authors ) - - async with httpx.AsyncClient() as client: - response = await client.post( - f"{self.base_url}/openalex-institutions/_search", - json=query, - headers=self.headers, - ) - response.raise_for_status() - hits = response.json().get("hits", {}).get("hits", []) - if not hits: - raise ValueError( - f"Institution with ID '{raw_institution_id}' not found." - ) - - return Institution.from_dict(hits[0]["_source"]) + + return Institution.from_dict(hits[0]["_source"]) async def get_authors_by_institution_id(self, raw_institution_id: str) -> List[str]: + """ + Fetches authors associated with an institution. + Note: This query is specifically looking for current affiliations (2026). + """ query = { - "query": { - "nested": { - "path": "affiliations", - "query": { - "bool": { - "must": [ - { - "term": { - "affiliations.institution.id": f"https://openalex.org/{raw_institution_id.upper()}" - } - }, - { - "range": { - "affiliations.years": {"gte": 2026, "lte": 2026} - } - }, - ] - } - }, - } + "nested": { + "path": "affiliations", + "query": { + "bool": { + "must": [ + { + "term": { + "affiliations.institution.id": f"https://openalex.org/{raw_institution_id.upper()}" + } + }, + { + "range": { + "affiliations.years": {"gte": 2026, "lte": 2026} + } + }, + ] + } + }, } } logger.debug( @@ -80,30 +75,103 @@ class InstitutionsSearchClient: raw_institution_id, query, ) - async with httpx.AsyncClient() as client: - response = await client.post( - "https://project.nes.uni-due.de/elastic/openalex-authors/_search", - json=query, - headers=self.headers, - ) - try: - response.raise_for_status() - except httpx.HTTPStatusError as e: - logger.exception( - "Error fetching authors for institution_id=%s: %s, response content: %s", - raw_institution_id, - str(e), - response.text, - ) - return [] - hits = response.json().get("hits", {}).get("hits", []) - authors = set() - for hit in hits: - authors.update( - auth["author"]["display_name"] - for auth in hit["_source"].get("authorships", []) - ) - return list(authors) + + res = elasticsearch.search(index="openalex-authors", query=query) + hits = res.get("hits", {}).get("hits", []) + + # Extracting display_name directly from the author document source + authors = {hit["_source"].get("display_name") for hit in hits if hit["_source"].get("display_name")} + return list(authors) + async def search_institutions( + self, + query_text: str, + country_code: str | None = None, + institution_type: str | None = None, + limit: int = 10, + ) -> list[Institution]: + """ + Autocomplete search for institutions using multi_match on search_as_you_type fields. + Falls back to fuzzy match for typo tolerance on longer queries. + """ + must = [] + + if query_text: + stripped = query_text.strip() + + must.append({ + "bool": { + "should": [ + # Fast prefix matching via search_as_you_type shingles + { + "multi_match": { + "query": stripped, + "type": "bool_prefix", + "fields": [ + "display_name.search", + "display_name.search._2gram", + "display_name.search._3gram", + "display_name_alternatives.search", + "display_name_alternatives.search._2gram", + ], + "boost": 2, + } + }, + # Exact acronym match — high confidence signal + { + "term": { + "display_name_acronyms.keyword": { + "value": stripped.upper(), + "boost": 10, + } + } + }, + # Fuzzy fallback for typos (only worth it for longer input) + *( + [{ + "match": { + "display_name": { + "query": stripped, + "fuzziness": "AUTO", + "boost": 1, + } + } + }] + if len(stripped) >= 4 else [] + ), + ], + "minimum_should_match": 1, + } + }) + + filter_queries = [] + + if country_code: + filter_queries.append({"term": {"country_code": country_code.upper()}}) + + if institution_type: + filter_queries.append({"term": {"type": institution_type}}) + + query = { + "bool": { + "must": must, + "filter": filter_queries, + } + } + + res = elasticsearch.search( + index="openalex-institutions", + query=query, + size=limit, + # Blend relevance score with works_count popularity signal + sort=[ + {"works_count": {"order": "desc"}}, + ], + source=["id", "display_name", "country_code", "type", "works_count", "cited_by_count", "geo"], + ) + + hits = res.get("hits", {}).get("hits", []) + + return [Institution.from_dict(hit["_source"]) for hit in hits] async def get_institution_aliases_by_id(self, raw_institution_id: str) -> List[str]: """Get a list of institution aliases for a given institution ID, including both display name alternatives and predefined aliases. diff --git a/service/src/main/inse/institutions/logic.py b/service/src/main/inse/institutions/logic.py index a4f834ee..7562672e 100644 --- a/service/src/main/inse/institutions/logic.py +++ b/service/src/main/inse/institutions/logic.py @@ -114,34 +114,29 @@ async def autocomplete_institutions( country_code: str | None = None, institution_type: str | None = None, limit: int = 10, - client: OpenAlexInstitutionsClient | None = None, + client: InstitutionsSearchClient, ) -> AutocompleteResponse: - filters = [] - if country_code: - filters.append(f"country_code:{country_code}") - if institution_type: - filters.append(f"type:{institution_type}") - - response = await list_institutions( - search=query, - filter=",".join(filters) if filters else None, - sort="works_count:desc", - per_page=limit, - page=1, - select=("id,ror,display_name,country_code,type,works_count,cited_by_count,geo"), - client=client, + """ + Returns institution options for autocomplete inputs using the local + Elasticsearch cluster via the provided client. + """ + institutions = await client.search_institutions( + query_text=query, + country_code=country_code, + institution_type=institution_type, + limit=limit, ) results = [] - for institution in response.results or []: + for institution in institutions: if not institution.id or not institution.display_name: continue hint_parts = [] - if institution.geo: - if institution.geo.city: + if hasattr(institution, "geo") and institution.geo: + if hasattr(institution.geo, "city") and institution.geo.city: hint_parts.append(institution.geo.city) - if institution.geo.country: + if hasattr(institution.geo, "country") and institution.geo.country: hint_parts.append(institution.geo.country) elif institution.country_code: hint_parts.append(institution.country_code) @@ -161,12 +156,7 @@ async def autocomplete_institutions( ) return AutocompleteResponse( - meta=AutocompleteResponseMeta( - count=response.meta.count if response.meta else len(results), - db_response_time_ms=( - response.meta.db_response_time_ms if response.meta else None - ), - ), + meta=AutocompleteResponseMeta(count=len(results)), results=results, ) diff --git a/service/src/main/inse/institutions/service.py b/service/src/main/inse/institutions/service.py index dd13b718..5c08bbdf 100644 --- a/service/src/main/inse/institutions/service.py +++ b/service/src/main/inse/institutions/service.py @@ -18,44 +18,12 @@ from . import logic from inse.institutions.institutions_search_client import InstitutionsSearchClient -router = APIRouter(prefix="/api/institutions", tags=[Tags.INSTITUTIONS]) +router = APIRouter(prefix="/api/inse-service/institutions", tags=[Tags.INSTITUTIONS]) @lru_cache def get_institutions_search_client() -> InstitutionsSearchClient: - settings = get_settings() - if not settings.elasticsearch_url: - raise ValueError("Elasticsearch URL is missing in settings.") - if not settings.elasticsearch_api_key: - raise ValueError("Elasticsearch API key is missing in settings.") - - return InstitutionsSearchClient( - api_key=settings.elasticsearch_api_key, - base_url=settings.elasticsearch_url, - ) - - -@router.get( - "/{id}", - summary="Returns a single institution by ID.", - description="Returns a single institution by its OpenAlex ID.", - operation_id="getInstitutionById", - responses={ - status.HTTP_200_OK: { - "description": "Successful Response", - "model": Institution, - }, - status.HTTP_404_NOT_FOUND: {"description": "Institution not found"}, - }, -) -async def get_institution( - id: str, - client: Annotated[ - InstitutionsSearchClient, Depends(get_institutions_search_client) - ], -) -> Institution: - return await logic.get_institution_by_id(raw_institution_id=id, client=client) - + return InstitutionsSearchClient() @router.get( "/autocomplete", @@ -84,12 +52,14 @@ async def autocomplete_institutions( int, Query(description="Maximum number of autocomplete options.", ge=1, le=25), ] = 10, + client: Annotated[InstitutionsSearchClient, Depends(get_institutions_search_client)] = None, ): return await logic.autocomplete_institutions( query=query, country_code=country_code, institution_type=institution_type, limit=limit, + client=client, ) @@ -155,3 +125,25 @@ async def list_institutions( sample=sample, select=select, ) + + +@router.get( + "/{id}", + summary="Returns a single institution by ID.", + description="Returns a single institution by its OpenAlex ID.", + operation_id="getInstitutionById", + responses={ + status.HTTP_200_OK: { + "description": "Successful Response", + "model": Institution, + }, + status.HTTP_404_NOT_FOUND: {"description": "Institution not found"}, + }, +) +async def get_institution( + id: str, + client: Annotated[ + InstitutionsSearchClient, Depends(get_institutions_search_client) + ], +) -> Institution: + return await logic.get_institution_by_id(raw_institution_id=id, client=client) diff --git a/service/src/main/inse/institutions/test_logic.py b/service/src/main/inse/institutions/test_logic.py index e079ff8e..bebf52c0 100644 --- a/service/src/main/inse/institutions/test_logic.py +++ b/service/src/main/inse/institutions/test_logic.py @@ -176,61 +176,3 @@ async def test_list_institutions_accepts_practical_openalex_type_variants(): assert result.results[0].counts_by_year[0].cited_by_count is None assert result.group_by[0].key == "true" - -@pytest.mark.anyio -async def test_autocomplete_institutions_returns_frontend_options(): - def handler(request: httpx.Request) -> httpx.Response: - assert request.url.params["search"] == "Duisburg Essen" - assert request.url.params["filter"] == "country_code:DE,type:education" - assert request.url.params["sort"] == "works_count:desc" - assert request.url.params["per_page"] == "5" - assert request.url.params["select"] == ( - "id,ror,display_name,country_code,type,works_count," - "cited_by_count,geo" - ) - return httpx.Response( - 200, - json={ - "meta": {"count": 1, "db_response_time_ms": 12}, - "results": [ - { - "id": "https://openalex.org/I123", - "ror": "https://ror.org/04mz5ra38", - "display_name": "University of Duisburg-Essen", - "country_code": "DE", - "type": "education", - "works_count": 123, - "cited_by_count": 456, - "geo": { - "city": "Duisburg", - "country": "Germany", - }, - } - ], - }, - ) - - client = OpenAlexInstitutionsClient( - api_key="test-key", - transport=httpx.MockTransport(handler), - ) - - result = await logic.autocomplete_institutions( - query="Duisburg Essen", - country_code="DE", - institution_type="education", - limit=5, - client=client, - ) - - assert result.meta.count == 1 - assert result.meta.db_response_time_ms == 12 - assert len(result.results) == 1 - option = result.results[0] - assert option.id == "https://openalex.org/I123" - assert option.display_name == "University of Duisburg-Essen" - assert option.hint == "Duisburg · Germany · education" - assert option.works_count == 123 - assert option.cited_by_count == 456 - assert option.entity_type == "institution" - assert option.external_id == "https://ror.org/04mz5ra38" diff --git a/service/src/main/inse/main.py b/service/src/main/inse/main.py index a65368d9..450a4dd9 100644 --- a/service/src/main/inse/main.py +++ b/service/src/main/inse/main.py @@ -7,8 +7,8 @@ webapp. """ import logging -from fastapi import FastAPI -from fastapi.responses import RedirectResponse +from fastapi import FastAPI, Request +from fastapi.responses import JSONResponse, RedirectResponse from fastapi.middleware.cors import CORSMiddleware from inse.collaboration_network.router import router as collaboration_network_router from inse.institutions.service import router as institutions_service_router @@ -18,8 +18,9 @@ from inse.persons.service import router as persons_service_router from inse.funders.service import router as funders_service_router from inse.projects.router import router as projects_router -#caching +# caching from inse.middleware.etag_cache import ETagCacheMiddleware +from inse.exceptions import NotFoundException from . import config from .service import router as service_router from .account.service import router as account_router @@ -50,7 +51,7 @@ app.include_router(projects_router) app.add_middleware( ETagCacheMiddleware, - ttl=300 # 5 minutes expiration time + ttl=300, # 5 minutes expiration time ) app.add_middleware( CORSMiddleware, @@ -58,10 +59,15 @@ app.add_middleware( allow_credentials=True, allow_methods=["*"], allow_headers=["*"], - expose_headers=["ETag"] + expose_headers=["ETag"], ) +@app.exception_handler(NotFoundException) +async def handle_not_found(request: Request, exc: NotFoundException): + return JSONResponse(status_code=404, content={"message": str(exc)}) + + @app.exception_handler(404) async def redirect(_, __): return RedirectResponse(url="/inse-webapp/") diff --git a/service/src/main/inse/models/openalex/institution.py b/service/src/main/inse/models/openalex/institution.py index a81ae678..6121af94 100644 --- a/service/src/main/inse/models/openalex/institution.py +++ b/service/src/main/inse/models/openalex/institution.py @@ -55,13 +55,20 @@ class Institution(BaseModel): updated_date: Optional[datetime] = Field(default=None, description="When this institution was last updated (ISO 8601 datetime).") __properties: ClassVar[List[str]] = ["id", "ror", "display_name", "country_code", "type", "homepage_url", "image_url", "image_thumbnail_url", "display_name_acronyms", "display_name_alternatives", "works_count", "cited_by_count", "summary_stats", "geo", "lineage", "ids", "counts_by_year", "works_api_url", "created_date", "updated_date"] + @field_validator('created_date', mode='before') + @classmethod + def normalize_created_date(cls, v: Any) -> Any: + if isinstance(v, str) and len(v) > 10: + return v[:10] + return v + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(['education', 'healthcare', 'company', 'archive', 'nonprofit', 'government', 'facility', 'other']): + if value not in set(['education','funder', 'healthcare', 'company', 'archive', 'nonprofit', 'government', 'facility', 'other']): raise ValueError("must be one of enum values ('education', 'healthcare', 'company', 'archive', 'nonprofit', 'government', 'facility', 'other')") return value @@ -154,5 +161,3 @@ class Institution(BaseModel): "updated_date": obj.get("updated_date") }) return _obj - - diff --git a/service/src/main/inse/persons/logic.py b/service/src/main/inse/persons/logic.py index a2def5a9..76db43c7 100644 --- a/service/src/main/inse/persons/logic.py +++ b/service/src/main/inse/persons/logic.py @@ -29,7 +29,28 @@ from inse.persons.model import ( CareerMetrics, ) logger = logging.getLogger(__name__) -INDEX_NAME="openalex-authors" +INDEX_NAME = "openalex-authors" + + +def get_author_name_by_id(author_id: str) -> Optional[str]: + try: + query = { + "_source": ["id", "display_name"], + "query": { + "term": {"id": {"value": f"https://openalex.org/{author_id.upper()}"}} + }, + "size": 1, + } + + data = elasticsearch.search(index=INDEX_NAME, body=query) + hits = data.get("hits", {}).get("hits", []) + if not hits: + return None + return hits[0].get("_source", {}).get("display_name") + except Exception as e: + logger.exception(f"Error fetching author name for id {author_id}: {str(e)}") + return None + def search_persons( author_id: Optional[str] = None, @@ -90,7 +111,7 @@ def _fetch_author_display_name(author_id: str) -> Optional[str]: if not hits: return None - + return hits[0].get("_source", {}).get("display_name") @@ -103,7 +124,7 @@ def _fetch_works_and_topics(author_id: str) -> tuple[list, list]: "cited_by_count", "primary_topic", ] - + author_url = f"https://openalex.org/{author_id.strip()}" authorship_query = { @@ -147,18 +168,22 @@ def _fetch_works_and_topics(author_id: str) -> tuple[list, list]: works.append(hit.get("_source", {})) topics = [] - buckets = response.get("aggregations", {}).get("primary_topics", {}).get("buckets", []) + buckets = ( + response.get("aggregations", {}).get("primary_topics", {}).get("buckets", []) + ) for bucket in buckets: topic_hits = bucket.get("topic_name", {}).get("hits", {}).get("hits", []) display_name = None if topic_hits: primary_topic = topic_hits[0].get("_source", {}).get("primary_topic", {}) display_name = primary_topic.get("display_name") - topics.append({ - "id": bucket.get("key"), - "display_name": display_name, - "count": bucket.get("doc_count"), - }) + topics.append( + { + "id": bucket.get("key"), + "display_name": display_name, + "count": bucket.get("doc_count"), + } + ) return works, topics @@ -283,13 +308,15 @@ def _build_papers(works: list) -> list: for work in works: name = work.get("title") or work.get("display_name") abstract = work.get("abstract") - papers.append({ - "name": name, - "abstract": abstract, - "stats": { - "cited_by_count": work.get("cited_by_count"), - }, - }) + papers.append( + { + "name": name, + "abstract": abstract, + "stats": { + "cited_by_count": work.get("cited_by_count"), + }, + } + ) return papers @@ -326,7 +353,12 @@ def generate_person_bio(author_id: str, include: Optional[set[str]] = None) -> s user_prompt = f"Daten zur Person:\n{person_json}" - bio = llm.call(system_prompt=system_prompt, user_prompt=user_prompt, temperature=0.8, top_p=0.95) + bio = llm.call( + system_prompt=system_prompt, + user_prompt=user_prompt, + temperature=0.8, + top_p=0.95, + ) elapsed_time = time.time() - start_time logger.info( @@ -339,20 +371,16 @@ def generate_person_bio(author_id: str, include: Optional[set[str]] = None) -> s def get_person_by_id( author_id: str, include: Optional[str] = None ) -> CustomAuthorsListResponse: - source = include.split(",") if include else None + body = { + "_source": include.split(",") if include else True, + } try: - if source: - hit = elasticsearch.get( - index="openalex-authors", - doc_id=author_id, - source=source, - ) - else: - hit = elasticsearch.get( - index="openalex-authors", - doc_id=author_id, - ) + hit = elasticsearch.get( + index="openalex-authors", + body=body, + doc_id=author_id, + ) except NotFoundError: raise HTTPException( status_code=404, detail=f"Person with id {author_id} not found" @@ -373,7 +401,10 @@ def get_person_by_id( def search_persons_by_name( - author_name: str, limit: Optional[int] = 10, page_offset: Optional[int] = 0, include: Optional[str] = None + author_name: str, + limit: Optional[int] = 10, + page_offset: Optional[int] = 0, + include: Optional[str] = None, ) -> AuthorsListResponse: if not author_name: raise HTTPException(status_code=400, detail="name must be provided") @@ -405,78 +436,73 @@ def search_persons_by_name( offset=page_offset, source=include.split(",") if include else True, size=limit, - track_total_hits=True + track_total_hits=True, ) except Exception as e: raise HTTPException( status_code=500, detail=f"Elasticsearch search failed: {str(e)}" ) - total_count = response.get("hits",{}).get("total",{}).get("value",0) + total_count = response.get("hits", {}).get("total", {}).get("value", 0) hits = response.get("hits", {}).get("hits", []) persons = [util.get_persons_data(hit) for hit in hits] - return AuthorsListResponse(results=persons,meta=Meta(count=total_count,page=page_offset)) + return AuthorsListResponse( + results=persons, meta=Meta(count=total_count, page=page_offset) + ) -def search_persons_autocomplete(author_name: str, limit: Optional[int] = 5, include: Optional[str] = None) -> AuthorsListResponse: +def search_persons_autocomplete( + author_name: str, limit: Optional[int] = 5, include: Optional[str] = None +) -> AuthorsListResponse: if not author_name: - raise HTTPException( - status_code=400, - detail="name must be provided" - ) + raise HTTPException(status_code=400, detail="name must be provided") search_query = { "function_score": { - "query": { - "wildcard": { - "display_name.keyword": { - "value": author_name + "*", - "case_insensitive": True - } - } - }, - "functions": [ - { - "script_score": { - "script": { - "lang": "painless", - "source": "String name = doc['display_name.keyword'].value.toLowerCase(); String[] parts = name.splitOnToken(' '); Set unique = new HashSet(); for (String p : parts) { unique.add(p); } return unique.size() > 1 ? 1.0 : 0.3;" + "query": { + "wildcard": { + "display_name.keyword": { + "value": author_name + "*", + "case_insensitive": True, + } } - } - } - ], - "boost_mode": "multiply" + }, + "functions": [ + { + "script_score": { + "script": { + "lang": "painless", + "source": "String name = doc['display_name.keyword'].value.toLowerCase(); String[] parts = name.splitOnToken(' '); Set unique = new HashSet(); for (String p : parts) { unique.add(p); } return unique.size() > 1 ? 1.0 : 0.3;", + } + } + } + ], + "boost_mode": "multiply", } - } - collapse ={ - "field":"display_name.keyword" } + collapse = {"field": "display_name.keyword"} body = { - "size":limit, - "query":search_query, - "_source":include.split(",") if include else True, - "sort":[{"works_count": {"order": "desc"}}], - "collapse":collapse + "size": limit, + "query": search_query, + "_source": include.split(",") if include else True, + "sort": [{"works_count": {"order": "desc"}}], + "collapse": collapse, } try: - response = elasticsearch.search( - index="openalex-authors", - body=body - ) + response = elasticsearch.search(index="openalex-authors", body=body) except Exception as e: raise HTTPException( - status_code=500, - detail=f"Elasticsearch search failed: {str(e)}" + status_code=500, detail=f"Elasticsearch search failed: {str(e)}" ) hits = response.get("hits", {}).get("hits", []) persons = [] for hit in hits: - fields = hit.get("fields",{}) - source = hit.get("_source",{}) - source_copy = dict (source) + fields = hit.get("fields", {}) + source = hit.get("_source", {}) + source_copy = dict(source) source_copy["id"] = hit.get("_id", "") or source_copy.get("id") # Resilient sanitization of IDs to protect against model regeneration type conflicts (#Generated) @@ -487,16 +513,20 @@ def search_persons_autocomplete(author_name: str, limit: Optional[int] = 5, incl if orcid_val: ids_copy["orcid"] = str(orcid_val) source_copy["ids"] = ids_copy - - for key,value in fields.items(): - source_copy[key] = value + + for key, value in fields.items(): + source_copy[key] = value author = Author.from_dict(source_copy) persons.append(author) - + return AuthorsListResponse(results=persons) + def search_persons_by_institution( - institution_name: str, limit: Optional[int] = 10, page_offset: Optional[int] = 0, include: Optional[str] = None + institution_name: str, + limit: Optional[int] = 10, + page_offset: Optional[int] = 0, + include: Optional[str] = None, ) -> AuthorsListResponse: if not institution_name: @@ -515,7 +545,7 @@ def search_persons_by_institution( } ] } - } + }, } } try: @@ -526,32 +556,34 @@ def search_persons_by_institution( size=limit, offset=page_offset, sort=[{"works_count": {"order": "desc"}}], - track_total_hits=True + track_total_hits=True, ) except Exception as e: raise HTTPException( status_code=500, detail=f"Elasticsearch search failed: {str(e)}" ) - total_count = response.get("hits",{}).get("total",{}).get("value",0) + total_count = response.get("hits", {}).get("total", {}).get("value", 0) hits = response.get("hits", {}).get("hits", []) persons = [util.get_persons_data(hit) for hit in hits] - return AuthorsListResponse(results=persons,meta=Meta(count=total_count,page=page_offset)) + return AuthorsListResponse( + results=persons, meta=Meta(count=total_count, page=page_offset) + ) + def _enrich_author_data(author_data) -> Optional[CustomAuthor]: if not author_data: return None if not isinstance(author_data, dict): - if hasattr(author_data, 'model_dump'): + if hasattr(author_data, "model_dump"): author_data = author_data.model_dump() - elif hasattr(author_data, 'to_dict'): + elif hasattr(author_data, "to_dict"): author_data = author_data.to_dict() else: return None author_id = author_data.get("id", "") or "" # Not implemented yet - h = int(hashlib.md5(author_id.encode('utf-8')).hexdigest(), 16) - + h = int(hashlib.md5(author_id.encode("utf-8")).hexdigest(), 16) # Experimental suitability rating suitability_score = h % 100 @@ -581,6 +613,7 @@ def _enrich_author_data(author_data) -> Optional[CustomAuthor]: ) return author + def advanced_search_persons( query: Optional[str] = None, institution_name: Optional[str] = None, @@ -605,9 +638,9 @@ def advanced_search_persons( page_size=page_size, include=include, strict=strict, - track_total_hits = True, + track_total_hits=True, filter_mode=filter_mode, - filter_year=filter_year + filter_year=filter_year, ) response_dict = elasticsearch.search( index=INDEX_NAME, @@ -617,12 +650,7 @@ def advanced_search_persons( if e.response.status_code == 404: logger.warning(f"Elasticsearch index '{INDEX_NAME}' not found.") return CustomAuthorsListResponse( - results=[], - meta=Meta( - count=0, - page=page, - per_page=page_size - ) + results=[], meta=Meta(count=0, page=page, per_page=page_size) ) elif e.response.status_code == 400: logger.error(f"Elasticsearch request error: {str(e)}") @@ -644,7 +672,7 @@ def advanced_search_persons( raise HTTPException( status_code=500, detail=f"Elasticsearch search failed: {str(e)}" ) - total_count = response_dict.get("hits",{}).get("total",{}).get("value",0) + total_count = response_dict.get("hits", {}).get("total", {}).get("value", 0) hits = response_dict.get("hits", {}).get("hits", []) total_count = response_dict.get("hits", {}).get("total", {}).get("value", 0) @@ -656,10 +684,5 @@ def advanced_search_persons( results.append(custom_author) return CustomAuthorsListResponse( - results=results, - meta=Meta( - count=total_count, - page=page, - per_page=page_size - ) + results=results, meta=Meta(count=total_count, page=page, per_page=page_size) ) diff --git a/service/src/main/inse/projects/model.py b/service/src/main/inse/projects/model.py index 2739cc50..03a3caa3 100644 --- a/service/src/main/inse/projects/model.py +++ b/service/src/main/inse/projects/model.py @@ -1,4 +1,4 @@ -from typing import List +from typing import List, Optional from pydantic import BaseModel, Field @@ -6,13 +6,16 @@ from inse.models.bund_project import BundProject from inse.models.eu_project import EuProject -class BundProjectPage(BaseModel): +class Page(BaseModel): + page: int = Field(default=0, description="The current page number.") + size: int = Field(default=20, description="The requested page size.") + total: int = Field(default=0, description="The total number of items.") + + +class BundProjectPage(Page): elements: List[BundProject] = Field( default_factory=list, description="The bund projects on this page." ) - page: int = Field(default=0, description="The current page number.") - size: int = Field(default=20, description="The requested page size.") - total: int = Field(default=0, description="The total number of bund projects.") class BundProjectList(BaseModel): @@ -22,10 +25,51 @@ class BundProjectList(BaseModel): total: int = Field(default=0, description="The total number of bund projects.") -class EuProjectPage(BaseModel): +class EuProjectPage(Page): elements: List[EuProject] = Field( default_factory=list, description="The EU projects on this page." ) - page: int = Field(default=0, description="The current page number.") - size: int = Field(default=20, description="The requested page size.") - total: int = Field(default=0, description="The total number of EU projects.") + + +class DfgProjectSummary(BaseModel): + id: str = Field(description="The unique identifier of the DFG project.") + link: Optional[str] = Field( + default=None, description="The link to the DFG project details." + ) + title: Optional[str] = Field( + default=None, description="The title of the DFG project." + ) + professional_classification: Optional[str] = Field( + default=None, description="The professional classification of the DFG project." + ) + funding_start: Optional[str] = Field( + default=None, description="The funding start date of the DFG project." + ) + funding_end: Optional[str] = Field( + default=None, description="The funding end date of the DFG project." + ) + names: List[str] = Field( + default_factory=list, + description="The names of the researchers involved in the DFG project.", + ) + + @classmethod + def from_hit(cls, hit: dict) -> "DfgProjectSummary": + source = hit.get("_source", {}) + fields = hit.get("fields", {}) + + return cls( + id=hit.get("_id", ""), + link=source.get("link"), + title=source.get("title"), + professional_classification=source.get("Fachliche Zuordnung"), + funding_start=source.get("funding_start"), + funding_end=source.get("funding_end"), + names=fields.get("all_found_names", []), + ) + + +class DfgProjectPage(Page): + elements: List[DfgProjectSummary] = Field( + default_factory=list, description="The DFG projects on this page." + ) diff --git a/service/src/main/inse/projects/projects_search_client.py b/service/src/main/inse/projects/projects_search_client.py index 2bf9f1f0..c448c704 100644 --- a/service/src/main/inse/projects/projects_search_client.py +++ b/service/src/main/inse/projects/projects_search_client.py @@ -6,7 +6,12 @@ import httpx from inse.config import get_settings from inse.models.bund_project import BundProject -from inse.projects.model import BundProjectPage, EuProjectPage +from inse.projects.model import ( + BundProjectPage, + DfgProjectPage, + DfgProjectSummary, + EuProjectPage, +) from inse.models.eu_project import EuProject @@ -16,6 +21,66 @@ logger = logging.getLogger(__name__) logger.setLevel(settings.logging_level) +DFG_PERSON_FIELDS: List[str] = [ + "Antragsteller", + "Antragstellerin", + "Antragstellerinnen", + "Antragstellerinnen / Antragsteller", + "Beteiligte Person", + "Beteiligte Personen", + "Co-Sprecher", + "Co-Sprecherinnen / Co-Sprecher", + "Ehemalige Antragsteller", + "Ehemalige Antragstellerin", + "Ehemalige Antragstellerinnen", + "Ehemalige Antragstellerinnen / Ehemalige Antragsteller", + "Ehemaliger Antragsteller", + "Gastgeber", + "Gastgeberin", + "Gastgeberinnen", + "Gastgeberinnen / Gastgeber", + "Kooperationspartner", + "Kooperationspartnerin", + "Kooperationspartnerinnen", + "Kooperationspartnerinnen / Kooperationspartner", + "Leiter", + "Leiterin", + "Leiterinnen", + "Leiterinnen / Leiter", + "Mitantragsteller", + "Mitantragstellerin", + "Mitantragstellerinnen", + "Mitantragstellerinnen / Mitantragsteller", + "Mitverantwortlich", + "Mitverantwortlich(e)", + "Mitverantwortliche", + "Sprecher", + "Sprecher (IGK-Partner)", + "Sprecherin", + "Sprecherin (IGK-Partner)", + "Sprecherinnen", + "Sprecherinnen (IGK-Partner) / Sprecher (IGK-Partner)", + "Sprecherinnen / Sprecher", + "Teilprojektleiter", + "Teilprojektleiterin", + "Teilprojektleiterinnen", + "Teilprojektleiterinnen / Teilprojektleiter", + "ausländ. Mitantragstellerin", + "ausländ. Mitantragstellerinnen", + "ausländ. Mitantragstellerinnen / ausländische Mitantragsteller", + "ausländische Mitantragsteller", + "ausländischer Mitantragsteller", + "beteiligte Wissenschaftler", + "beteiligte Wissenschaftlerin", + "beteiligte Wissenschaftlerinnen", + "beteiligte Wissenschaftlerinnen / beteiligte Wissenschaftler", + "beteiligter Wissenschaftler", + "person_creater_name", + "stellvertr. Sprecher", + "stellvertr. Sprecherin", + "stellvertr. Sprecherinnen / stellvertr. Sprecher", +] + class ProjectsSearchClient: def __init__( @@ -73,7 +138,7 @@ class BundProjectsSearchClient(ProjectsSearchClient): sort_by: str = "topic", sort_direction: str = "asc", ) -> dict: - from_ = (page - 1) * size + from_ = page * size query: Dict[str, Any] = {"size": size, "from": from_, "query": {}} must_clauses: List[Dict[str, Any]] = [] @@ -212,7 +277,7 @@ class EuProjectsSearchClient(ProjectsSearchClient): sort_by: str = "topic", sort_direction: str = "asc", ) -> dict: - from_ = (page - 1) * size + from_ = page * size query: Dict[str, Any] = {"size": size, "from": from_, "query": {}} must_clauses: List[Dict[str, Any]] = [] @@ -341,3 +406,220 @@ class EuProjectsSearchClient(ProjectsSearchClient): ) response = await self.make_search_request(query) return self.response_to_eu_project_page(response, page, size) + + +class DfgProjectsSearchClient(ProjectsSearchClient): + def __init__(self): + if not settings.elasticsearch_inse_url: + raise ValueError("Elasticsearch INSE URL is missing in settings.") + if not settings.elasticsearch_inse_api_key: + raise ValueError("Elasticsearch INSE API key is missing in settings.") + super().__init__( + base_url=settings.elasticsearch_inse_url, + index="projects_dfg_all", + api_key=settings.elasticsearch_inse_api_key, + ) + + def dfg_projects_query( + self, + page: int, + size: int, + names: Optional[List[str]] = None, + topic: Optional[str] = None, + sort_by: str = "id", + sort_direction: str = "asc", + ) -> dict: + + from_ = page * size + + painless_fields_string = ", ".join( + [f"'{f}.keyword'" for f in DFG_PERSON_FIELDS] + ) + + query: Dict[str, Any] = { + "size": size, + "from": from_, + "_source": [ + "id", + "link", + "title", + "funding_start", + "funding_end", + "Fachliche Zuordnung", + ], + "query": {}, + "script_fields": { + "all_found_names": { + "script": { + "lang": "painless", + "source": ( + f"def names = new HashSet(); " + f"def fields = [{painless_fields_string}]; " + f"for (field in fields) {{ " + f" if (doc.containsKey(field) && !doc[field].empty) {{ " + f" for (value in doc[field]) {{ " + f" if (value.contains(';')) {{ " + f" def splitNames = value.splitOnToken(';'); " + f" for (sn in splitNames) {{ names.add(sn.trim()); }} " + f" }} else {{ " + f" names.add(value.trim()); " + f" }} " + f" }} " + f" }} " + f"}} " + f"return new ArrayList(names);" + ), + } + } + }, + } + + must_clauses: List[Dict[str, Any]] = [] + filter_clauses: List[Dict[str, Any]] = [] + + if topic is not None and topic.strip() != "": + must_clauses.append( + { + "match_phrase_prefix": { + "title": { + "query": topic, + "max_expansions": 100, + } + } + } + ) + + if names: + name_should_clauses = [] + script_conditions = [] + + for full_name in names: + name_parts = full_name.strip().split() + if not name_parts: + continue + + match_musts = [] + for part in name_parts: + match_musts.append( + {"multi_match": {"query": part, "fields": DFG_PERSON_FIELDS}} + ) + + name_should_clauses.append({"bool": {"must": match_musts}}) + + script_parts = [ + f"singlePerson.contains('{part.lower()}')" for part in name_parts + ] + script_conditions.append(f"({' && '.join(script_parts)})") + + if name_should_clauses: + must_clauses.append( + {"bool": {"should": name_should_clauses, "minimum_should_match": 1}} + ) + + combined_script_condition = " || ".join(script_conditions) + painless_source = ( + f"def fields = [{painless_fields_string}]; " + f"for (field in fields) {{ " + f" if (doc.containsKey(field) && !doc[field].empty) {{ " + f" for (value in doc[field]) {{ " + f" if (value.contains(';')) {{ " + f" def splitValues = value.splitOnToken(';'); " + f" for (singlePersonRaw in splitValues) {{ " + f" def singlePerson = singlePersonRaw.toLowerCase(); " + f" if ({combined_script_condition}) {{ return true; }} " + f" }} " + f" }} else {{ " + f" def singlePerson = value.toLowerCase(); " + f" if ({combined_script_condition}) {{ return true; }} " + f" }} " + f" }} " + f" }} " + f"}} " + f"return false;" + ) + + filter_clauses.append( + { + "script": { + "script": {"lang": "painless", "source": painless_source} + } + } + ) + + if must_clauses or filter_clauses: + query["query"] = {"bool": {}} + if must_clauses: + query["query"]["bool"]["must"] = must_clauses + if filter_clauses: + query["query"]["bool"]["filter"] = filter_clauses + else: + query["query"] = {"match_all": {}} + + sort_by = sort_by.strip().lower() + sort_direction = sort_direction.strip().lower() + if sort_direction not in ["asc", "desc"]: + sort_direction = "asc" + logger.debug( + f"Sorting DFG projects by {sort_by} with direction {sort_direction}" + ) + + if sort_by in ["topic", "title"]: + logger.debug( + f"Sorting DFG projects by title with direction {sort_direction}" + ) + sort_config = {"title.keyword": {"order": sort_direction}} + elif sort_by == "funding_start": + logger.debug( + f"Sorting DFG projects by funding_start with direction {sort_direction}" + ) + sort_config = {"funding_start.keyword": {"order": sort_direction}} + elif sort_by == "funding_end": + logger.debug( + f"Sorting DFG projects by funding_end with direction {sort_direction}" + ) + sort_config = {"funding_end.keyword": {"order": sort_direction}} + elif sort_by == "professional_classification": + logger.debug( + f"Sorting DFG projects by Fachliche Zuordnung with direction {sort_direction}" + ) + sort_config = {"Fachliche Zuordnung.keyword": {"order": sort_direction}} + else: + logger.debug(f"Sorting DFG projects by id with direction {sort_direction}") + sort_config = {"id.keyword": {"order": sort_direction}} + + query["sort"] = [sort_config] + + query_str = json.dumps(query, indent=2) + logger.debug(f"Constructed DFG project query: {query_str}") + + return query + + def response_to_dfg_project_page( + self, response: dict, page: int, size: int + ) -> DfgProjectPage: + hits_block = response.get("hits", {}) + total_hits = hits_block.get("total", {}).get("value", 0) + elements = [ + DfgProjectSummary.from_hit(hit) for hit in hits_block.get("hits", []) + ] + return DfgProjectPage(elements=elements, total=total_hits, page=page, size=size) + + async def search_dfg_projects( + self, + page: int, + size: int, + names: Optional[List[str]] = None, + topic: Optional[str] = None, + sort_by: str = "id", + sort_direction: str = "asc", + ) -> DfgProjectPage: + query = self.dfg_projects_query( + page=page, + size=size, + names=names, + topic=topic, + sort_by=sort_by, + sort_direction=sort_direction, + ) + response = await self.make_search_request(query) + return self.response_to_dfg_project_page(response, page, size) diff --git a/service/src/main/inse/projects/router.py b/service/src/main/inse/projects/router.py index 6ad190e8..cf8e2a12 100644 --- a/service/src/main/inse/projects/router.py +++ b/service/src/main/inse/projects/router.py @@ -2,14 +2,14 @@ from functools import lru_cache import logging from typing import Annotated, Optional -from fastapi import APIRouter, Depends, Path, Query, status +from fastapi import APIRouter, Depends, Query, status -from inse.models.bund_project import BundProject -from inse.projects.model import BundProjectPage, EuProjectPage +from inse.projects.model import BundProjectPage, DfgProjectPage, EuProjectPage from inse.tags import Tags from inse.projects import service as projects_service from inse.projects.projects_search_client import ( BundProjectsSearchClient, + DfgProjectsSearchClient, EuProjectsSearchClient, ) from inse.institutions.institutions_search_client import ( @@ -32,8 +32,13 @@ def get_eu_search_client() -> EuProjectsSearchClient: return EuProjectsSearchClient() +@lru_cache +def get_dfg_search_client() -> DfgProjectsSearchClient: + return DfgProjectsSearchClient() + + @router.get( - "/bund/search", + "/institution/bund/search", summary="Get bund projects.", description="Returns a page of bund projects based on the provided pagination parameters and optional institution filter.", operation_id="getBundProjects", @@ -59,7 +64,7 @@ async def get_bund_projects( topic: Annotated[ Optional[str], Query(description="The topic to filter by.") ] = None, - page: Annotated[int, Query(description="The page number.", ge=1)] = 1, + page: Annotated[int, Query(description="The page number.", ge=0)] = 0, size: Annotated[int, Query(description="The page size.", ge=1)] = 20, sort_by: Annotated[str, Query(description="The field to sort by.")] = "topic", sort_direction: Annotated[ @@ -79,7 +84,7 @@ async def get_bund_projects( @router.get( - "/eu/search", + "/institution/eu/search", summary="Get EU projects.", description="Returns a page of EU projects based on the provided pagination parameters and optional institution filter.", operation_id="getEuProjects", @@ -103,7 +108,7 @@ async def get_eu_projects( topic: Annotated[ Optional[str], Query(description="The topic to filter by.") ] = None, - page: Annotated[int, Query(description="The page number.", ge=1)] = 1, + page: Annotated[int, Query(description="The page number.", ge=0)] = 0, size: Annotated[int, Query(description="The page size.", ge=1)] = 20, sort_by: Annotated[str, Query(description="The field to sort by.")] = "topic", sort_direction: Annotated[ @@ -123,21 +128,49 @@ async def get_eu_projects( @router.get( - "/bund/{bund_project_id}", - summary="Get a bund project by its project ID.", - description="Returns a bund project based on its project ID.", - operation_id="getBundProjectById", + "/person/dfg/search", + summary="Get DFG projects.", + description="Returns a page of DFG projects based on the provided pagination parameters and optional institution filter.", + operation_id="getDfgProjects", responses={ status.HTTP_200_OK: { "description": "Successful Response", - "model": BundProject, + "model": DfgProjectPage, }, - status.HTTP_404_NOT_FOUND: {"description": "Bund project not found"}, + status.HTTP_404_NOT_FOUND: {"description": "Institution not found"}, }, + response_model_by_alias=False, ) -async def get_bund_project_by_id( - bund_project_id: Annotated[ - str, Path(description="The ID of the bund project to retrieve.") +async def get_dfg_projects( + dfg_search_client: Annotated[ + DfgProjectsSearchClient, Depends(get_dfg_search_client) ], -): - return {"bund_project_id": bund_project_id} + author_id: Annotated[str, Query(description="The author ID to filter by.")], + topic: Annotated[ + Optional[str], Query(description="The topic to filter by.") + ] = None, + page: Annotated[int, Query(description="The page number.", ge=0)] = 0, + size: Annotated[int, Query(description="The page size.", ge=1)] = 20, + sort_by: Annotated[str, Query(description="The field to sort by.")] = "topic", + sort_direction: Annotated[ + str, Query(description="The sort direction (asc or desc).") + ] = "asc", +) -> DfgProjectPage: + logger.debug( + "Received request to get DFG projects for author_id=%s, topic=%s, page=%d, size=%d, sort_by=%s, sort_direction=%s", + author_id, + topic, + page, + size, + sort_by, + sort_direction, + ) + return await projects_service.get_dfg_projects_by_author_id( + dfg_search_client=dfg_search_client, + author_id=author_id, + topic=topic, + page=page, + size=size, + sort_by=sort_by, + sort_direction=sort_direction, + ) diff --git a/service/src/main/inse/projects/service.py b/service/src/main/inse/projects/service.py index 4fb9f858..f6693a57 100644 --- a/service/src/main/inse/projects/service.py +++ b/service/src/main/inse/projects/service.py @@ -3,12 +3,15 @@ from typing import List, Optional from inse.projects.projects_search_client import ( BundProjectsSearchClient, + DfgProjectsSearchClient, EuProjectsSearchClient, ) -from inse.projects.model import BundProjectPage, EuProjectPage +from inse.projects.model import BundProjectPage, DfgProjectPage, EuProjectPage from inse.institutions.institutions_search_client import ( InstitutionsSearchClient, ) +from inse.exceptions import NotFoundException +from inse.persons.logic import get_author_name_by_id logger = logging.getLogger(__name__) @@ -97,3 +100,34 @@ async def get_bund_projects_by_institution_name( logger.debug(f"get_bund_projects_by_institution_name response: {response}") return response + + +async def get_dfg_projects_by_author_id( + dfg_search_client: DfgProjectsSearchClient, + author_id: str, + topic: Optional[str], + page: int, + size: int, + sort_by: str = "topic", + sort_direction: str = "asc", +) -> DfgProjectPage: + logger.debug( + f"Fetching DFG projects for author_id={author_id}, topic={topic}, page={page}, size={size}, sort_by={sort_by}, sort_direction={sort_direction}" + ) + name = get_author_name_by_id(author_id) + if not name: + logger.debug(f"No author name found for author_id={author_id}") + raise NotFoundException( + f"Display name for author with id {author_id} not found" + ) + logger.debug(f"Found author name for author_id={author_id}: {name}") + + response = await dfg_search_client.search_dfg_projects( + page=page, + size=size, + names=[name], + topic=topic, + sort_by=sort_by, + sort_direction=sort_direction, + ) + return response diff --git a/service/src/main/inse/topics/logic.py b/service/src/main/inse/topics/logic.py index 30fa51d1..adc56a7a 100644 --- a/service/src/main/inse/topics/logic.py +++ b/service/src/main/inse/topics/logic.py @@ -255,3 +255,131 @@ def _datetime_str_or_none(value: Any) -> str | None: if len(text) == 10: return f"{text}T00:00:00Z" return text + +async def vector_search_topics( + *, + query: str, + limit: int = 25, +) -> TopicsListResponse: + """ + Perform a semantic similarity search on the topicvectors index. + """ + try: + from inse.integrations import elasticsearch + from inse.util import get_model + + except Exception as exc: + logger.exception("Failed to load elasticsearch integration.") + raise HTTPException( + status_code=HTTP_502_BAD_GATEWAY, + detail=f"Failed to load elasticsearch integration: {exc}" + ) + + # 1. Vectorize query + try: + model = get_model() + query_vector = model.encode(query).tolist() + except Exception as exc: + logger.exception("Failed to encode query text.") + raise HTTPException( + status_code=HTTP_502_BAD_GATEWAY, + detail=f"Failed to encode query text: {exc}" + ) + + # 2. Query Elasticsearch using standard Bool Should hybrid search + + body = { + "query": { + "bool": { + "should": [ + { + "multi_match": { + "query": query, + "fields": [ + "display_name^3", + "keywords^2", + "description^1" + ], + "boost": 1.0 + } + }, + { + "knn": { + "field": "display_name_vector", + "query_vector": query_vector, + "k": limit, + "num_candidates": 100, + "similarity": 0.62, + "boost": 2.0 + } + }, + { + "nested": { + "path": "description_vectors", + "query": { + "knn": { + "field": "description_vectors.vector", + "query_vector": query_vector, + "k": limit, + "num_candidates": 100, + "similarity": 0.62 + } + }, + "score_mode": "max", + "boost": 1.0 + } + } + ] + } + }, + "_source": { + "excludes": ["display_name_vector", "description_vectors", "description", "siblings"] # remove unrequired fields (description, sibling currently not needed) + }, + "size": limit + } + + try: + raw_results = elasticsearch.search( + index="topicvectors", + body=body, + cluster="nes" + ) + except Exception as exc: + logger.exception("Elasticsearch vector search failed.") + raise HTTPException( + status_code=HTTP_502_BAD_GATEWAY, + detail=f"Elasticsearch vector search failed: {exc}" + ) + + # 3. Format result + hits = raw_results.get("hits", {}).get("hits", []) + + # Log scores to JSON for threshold analysis TODO: Remove after finetune + try: + from .score_logger import log_scores_to_json + log_scores_to_json(hits, query) + except Exception as exc: + logger.warning(f"Could not log search scores: {exc}") + + total = len(hits) + results = [hit.get("_source", {}) for hit in hits] + + data = { + "meta": { + "count": total, + "page": 1, + "per_page": limit + }, + "results": results + } + + try: + normalized_data = _normalize_topics_response(data) + return TopicsListResponse.from_dict(normalized_data) or TopicsListResponse() + except ValidationError as exc: + logger.exception("Vector search response could not be parsed.") + raise HTTPException( + status_code=HTTP_502_BAD_GATEWAY, + detail="Vector search response could not be parsed.", + ) from exc + diff --git a/service/src/main/inse/topics/score_logger.py b/service/src/main/inse/topics/score_logger.py new file mode 100644 index 00000000..0493d9ad --- /dev/null +++ b/service/src/main/inse/topics/score_logger.py @@ -0,0 +1,36 @@ +import json +from pathlib import Path +from typing import Any, Dict, List + +def log_scores_to_json(hits: List[Dict[str, Any]], query: str) -> None: + """ + Utility function to log the names and scores of all vector search hits to a JSON file. + This helps in debugging and manually tweaking the similarity score thresholds. + """ + scores_data = [] + for hit in hits: + source = hit.get("_source", {}) + topic_name = source.get("display_name") or source.get("name") or "Unknown" + score = hit.get("_score", 0.0) + scores_data.append({ + "topic_name": topic_name, + "score": score + }) + + + data_dir = Path("/data") + + output_file = data_dir / "search_scores.json" + + log_payload = { + "query": query, + "max_score": hits[0].get("_score", 0.0) if hits else 0.0, + "results": scores_data + } + + try: + with open(output_file, "w", encoding="utf-8") as f: + json.dump(log_payload, f, indent=2, ensure_ascii=False) + print(f"DEBUG: Saved search scores for query '{query}' to {output_file}") + except Exception as exc: + print(f"DEBUG: Failed to save search scores: {exc}") diff --git a/service/src/main/inse/topics/service.py b/service/src/main/inse/topics/service.py index 1551b6d9..bf6346fc 100644 --- a/service/src/main/inse/topics/service.py +++ b/service/src/main/inse/topics/service.py @@ -111,3 +111,27 @@ async def list_topics( sample=sample, select=select, ) + + +@router.get( + "/vector-search", + operation_id="vectorSearchTopics", + response_model=TopicsListResponse, + response_model_exclude_none=True, + summary="Semantic / vector search for topics using a keyword/sentence.", +) +async def vector_search_topics( + query: Annotated[ + str, + Query(description="Word or sentence to search by similarity.", min_length=1), + ], + limit: Annotated[ + int, + Query(description="Maximum number of topics to return.", ge=1, le=100), + ] = 25, +): + return await logic.vector_search_topics( + query=query, + limit=limit, + ) + diff --git a/service/src/main/inse/util.py b/service/src/main/inse/util.py index 38ed5e41..1acf6d2e 100644 --- a/service/src/main/inse/util.py +++ b/service/src/main/inse/util.py @@ -35,4 +35,25 @@ def get_persons_data(hit:dict): source_copy["ids"] = ids_copy author = Author.from_dict(source_copy) - return author \ No newline at end of file + return author + +from sentence_transformers import SentenceTransformer +# Sentence Transformer Model +_model: SentenceTransformer | None = None + +def get_model(): + global _model + if _model is None: + import os + # If SENTENCE_TRANSFORMERS_HOME is not set, check if container-baked /models folder is available + if "SENTENCE_TRANSFORMERS_HOME" not in os.environ: + if os.path.exists("/models"): + os.environ["SENTENCE_TRANSFORMERS_HOME"] = "/models" + os.environ["HF_HUB_OFFLINE"] = "1" + else: + # If it is set to /models, enforce offline mode as it is baked into the image + if os.environ.get("SENTENCE_TRANSFORMERS_HOME") == "/models": + os.environ["HF_HUB_OFFLINE"] = "1" + + _model = SentenceTransformer("paraphrase-multilingual-mpnet-base-v2") + return _model \ No newline at end of file diff --git a/service/uv.lock b/service/uv.lock index 8564595c..d4016c83 100644 --- a/service/uv.lock +++ b/service/uv.lock @@ -1,6 +1,19 @@ version = 1 revision = 3 requires-python = ">=3.12" +resolution-markers = [ + "sys_platform != 'darwin'", + "sys_platform == 'darwin'", +] + +[[package]] +name = "annotated-doc" +version = "0.0.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/57/ba/046ceea27344560984e26a590f90bc7f4a75b06701f653222458922b558c/annotated_doc-0.0.4.tar.gz", hash = "sha256:fbcda96e87e9c92ad167c2e53839e57503ecfda18804ea28102353485033faa4", size = 7288, upload-time = "2025-11-10T22:07:42.062Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/1e/d3/26bf1008eb3d2daa8ef4cacc7f3bfdc11818d111f7e2d0201bc6e3b49d45/annotated_doc-0.0.4-py3-none-any.whl", hash = "sha256:571ac1dc6991c450b25a9c2d84a3705e2ae7a53467b5d111c24fa8baabbed320", size = 5303, upload-time = "2025-11-10T22:07:40.673Z" }, +] [[package]] name = "annotated-types" @@ -209,6 +222,24 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/53/50/b1222562c6d270fea83e9c9075b8e8600b8479150a18e4516a6138b980d1/fastapi-0.115.14-py3-none-any.whl", hash = "sha256:6c0c8bf9420bd58f565e585036d971872472b4f7d3f6c73b698e10cffdefb3ca", size = 95514, upload-time = "2025-06-26T15:29:06.49Z" }, ] +[[package]] +name = "filelock" +version = "3.29.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/91/f5/3557bf28e0f1943e4849154c821533706e6dea010f96fb6aa0b6949037d1/filelock-3.29.3.tar.gz", hash = "sha256:7fc1b3f39cf172fd8203812043c57b8a65aef9969f38b6704f628b881f761a84", size = 61956, upload-time = "2026-06-10T17:37:11.832Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/81/8f/b61d427c4f49a8bdadc93f4e7e74df8a6df6f77ee6e26bf0df53d3925363/filelock-3.29.3-py3-none-any.whl", hash = "sha256:e58333029cc9b925f39aad59b1d8f0a1ad836af4e60d7217f4a4dba87461261d", size = 42324, upload-time = "2026-06-10T17:37:10.37Z" }, +] + +[[package]] +name = "fsspec" +version = "2026.4.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d5/8d/1c51c094345df128ca4a990d633fe1a0ff28726c9e6b3c41ba65087bba1d/fsspec-2026.4.0.tar.gz", hash = "sha256:301d8ac70ae90ef3ad05dcf94d6c3754a097f9b5fe4667d2787aa359ec7df7e4", size = 312760, upload-time = "2026-04-29T20:42:38.635Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d5/0c/043d5e551459da400957a1395e0febbf771446ff34291afcbe3d8be2a279/fsspec-2026.4.0-py3-none-any.whl", hash = "sha256:11ef7bb35dab8a394fde6e608221d5cf3e8499401c249bebaeaad760a1a8dec2", size = 203402, upload-time = "2026-04-29T20:42:36.842Z" }, +] + [[package]] name = "greenlet" version = "3.5.1" @@ -273,6 +304,38 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" }, ] +[[package]] +name = "hf-xet" +version = "1.5.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/4b/2d/57fd21d84d93efb4bd0b962383790e19dd1bc053501b4264c97903b4e83e/hf_xet-1.5.1.tar.gz", hash = "sha256:51ef4500dab3764b41135ee1381a4b62ce56fc54d4c92b719b59e597d6df5bf6", size = 876636, upload-time = "2026-06-08T23:02:53.897Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/64/ee/dd9ba7beae1005e54131b7d45263cc74c8a066d47d354e6d58ae9445a388/hf_xet-1.5.1-cp313-cp313t-macosx_10_12_x86_64.whl", hash = "sha256:dbf48c0d02cf0b2e568944330c60d9120c272dabe013bd892d48e25bc6797577", size = 4069485, upload-time = "2026-06-08T23:02:13.193Z" }, + { url = "https://files.pythonhosted.org/packages/b6/bc/9cae6cfeb4e03070874e73e5c97c66eb90369d3206b6a2b1ef5f96520888/hf_xet-1.5.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:e78e4e5192ad2b674c2e1160b651cb9134db974f8ae1835bdfbfb0166b894a43", size = 3838493, upload-time = "2026-06-08T23:02:15.282Z" }, + { url = "https://files.pythonhosted.org/packages/ba/b4/d5c01e0eb6d9f2ca2dacd84d0d1b71e6cfbb2ef3208c968528e010e9b3d7/hf_xet-1.5.1-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:6f7a04a8ad962422e225bc49fbbac99dc1806764b1f3e54dbd154bffa7593947", size = 4505658, upload-time = "2026-06-08T23:02:17.196Z" }, + { url = "https://files.pythonhosted.org/packages/76/c5/29a7598c0c6383c523dc22186d577f4e04267a626cd95ae60f67c00bfe66/hf_xet-1.5.1-cp313-cp313t-manylinux_2_28_aarch64.whl", hash = "sha256:d48199c2bf4f8df0adc55d31d1368b6ec0e4d4f45bc86b08038089c23db0bed8", size = 4292822, upload-time = "2026-06-08T23:02:18.608Z" }, + { url = "https://files.pythonhosted.org/packages/04/9a/dceaf6ca69390126b86ea825fb354b93d01163199070b7bd849225de9468/hf_xet-1.5.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:97f212a88d14bbf573619a74b7fecb238de77d08fc702e54dec6f78276ca3283", size = 4491255, upload-time = "2026-06-08T23:02:20.124Z" }, + { url = "https://files.pythonhosted.org/packages/48/a7/e5a7afaacf6c1791fdbeeac42951fb81c3d2bc482992b115dedcc86d963e/hf_xet-1.5.1-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:f61e3665892a6c8c5e765395838b8ddf36185da835253d4bc4509a81e49fb342", size = 4711062, upload-time = "2026-06-08T23:02:21.863Z" }, + { url = "https://files.pythonhosted.org/packages/53/49/2802f8433c9742ce281bddc1e65c02c32268ca3098d66828b05e12e45ee2/hf_xet-1.5.1-cp313-cp313t-win_amd64.whl", hash = "sha256:f4ad3ebd4c32dd2b27099d69dc7b2df821e30767e46fb6ee6a0713778243b8ff", size = 4017205, upload-time = "2026-06-08T23:02:23.495Z" }, + { url = "https://files.pythonhosted.org/packages/9e/5a/50c71195b9fb883659f596e7252faf4c18c58e753a9013bdbf9bac5d2250/hf_xet-1.5.1-cp313-cp313t-win_arm64.whl", hash = "sha256:8298485c1e36e7e67cbd01eeb1376619b7af43d4f1ec245caae306f890a8a32d", size = 3845426, upload-time = "2026-06-08T23:02:25.124Z" }, + { url = "https://files.pythonhosted.org/packages/05/24/5e0c28f80371c17d49fed004597d9d132cb75c1f6f53db2cb95f459d2312/hf_xet-1.5.1-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:3474760d10e3bb6f92ff3f024fcb00c0b3e4001e9b035c7483e49a5dd17aa70f", size = 4069676, upload-time = "2026-06-08T23:02:26.759Z" }, + { url = "https://files.pythonhosted.org/packages/d2/17/261ba565b6a4d960fb478f61fdf919c0be5824645aaf1c319eca660c1611/hf_xet-1.5.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:6762d89b9e3267dfd502b29b2a327b4525f33b17e7b509a78d94e2151a30ce30", size = 3838509, upload-time = "2026-06-08T23:02:28.573Z" }, + { url = "https://files.pythonhosted.org/packages/4e/44/7ffdc2e184b0d41fc0f683ba3936ef669ab63cf242cf36ef50e57d683668/hf_xet-1.5.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:bf67e6ed10260cef62e852789dc91ebb03f382d5bdc4b1dbeb64763ea275e7d6", size = 4505881, upload-time = "2026-06-08T23:02:30.257Z" }, + { url = "https://files.pythonhosted.org/packages/63/b6/788060d5aa4d5e671f1a31bf69624c314eb2d8babab3aa562f9e5d53444e/hf_xet-1.5.1-cp314-cp314t-manylinux_2_28_aarch64.whl", hash = "sha256:c6b6cd08ca095058780b50b8ce4d6cbf6787bcf27841705d58a9d32246e3e47a", size = 4292995, upload-time = "2026-06-08T23:02:31.993Z" }, + { url = "https://files.pythonhosted.org/packages/22/93/c5540cbd6b55529b7dc42f6734e88cebee21aefbea34128b66229df56c57/hf_xet-1.5.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:e1af0de8ca6f190d4294a28b88023db64a1e2d1d719cab044baf75bec569e7a9", size = 4491570, upload-time = "2026-06-08T23:02:33.86Z" }, + { url = "https://files.pythonhosted.org/packages/03/f3/9d8ceab30f44f36c1679b1b8683054c71a0dadc787dbf07421891742d3ca/hf_xet-1.5.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:4f561cbbb92f80960772059864b7fb07eae879adde1b2e781ec6f86f6ac26c59", size = 4711565, upload-time = "2026-06-08T23:02:35.454Z" }, + { url = "https://files.pythonhosted.org/packages/cd/54/27ed9a5e2cc583b4df82f75a03a4df8dbf55f5a9fa1f47f1fadfb20dbeac/hf_xet-1.5.1-cp314-cp314t-win_amd64.whl", hash = "sha256:e7dbb40617410f432182d918e37c12303fe6700fd6aa6c5964e30a535a4461d6", size = 4017343, upload-time = "2026-06-08T23:02:37.14Z" }, + { url = "https://files.pythonhosted.org/packages/ae/12/ecb2fc8d45e767580e3a37faa97cb895608b614965567efb4f18cff67e27/hf_xet-1.5.1-cp314-cp314t-win_arm64.whl", hash = "sha256:6071d5ccb4d8d2cbd5fea5cc798da4f0ba3f44e25369591c4e89a4987050e61d", size = 3845716, upload-time = "2026-06-08T23:02:39.073Z" }, + { url = "https://files.pythonhosted.org/packages/7a/d8/5e54cf37434759d1f4f2ba9b66077ff9d4c4e1f37b6bd7975da5c40d94ab/hf_xet-1.5.1-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:6abd35c3221eff63836618ddfb954dcf84798603f71d8e33e3ed7b04acfdbe6e", size = 4077794, upload-time = "2026-06-08T23:02:40.656Z" }, + { url = "https://files.pythonhosted.org/packages/35/94/4b2ecfbad8f8b04701a23aefb62f540b9137d058b7e1dbef16a32676f0e9/hf_xet-1.5.1-cp37-abi3-macosx_11_0_arm64.whl", hash = "sha256:94e761bbd266bf4c03cee73753916062665ce8365aa40ed321f45afcb934b41e", size = 3845354, upload-time = "2026-06-08T23:02:42.702Z" }, + { url = "https://files.pythonhosted.org/packages/de/cc/f99f4bc7295023d7bd9ebbfd51f75cc530ca262c1227666268b8208f4b77/hf_xet-1.5.1-cp37-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:892e3a3a3aecc12aded8b93cf4f9cd059282c7de0732f7d55026f3abdf474350", size = 4514864, upload-time = "2026-06-08T23:02:44.497Z" }, + { url = "https://files.pythonhosted.org/packages/cd/6e/21f7e5a2381278bd3b7b7a5a4d90038518bb6308a0c1daf5d9f8268bb178/hf_xet-1.5.1-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:a93df2039190502835b1db8cd7e178b0b7b889fe9ab51299d5ced26e0dd879a4", size = 4303784, upload-time = "2026-06-08T23:02:46.203Z" }, + { url = "https://files.pythonhosted.org/packages/35/0e/f992bb6927ac1cb30ef74e62268f551f338bc32b2191f7c96a44c6f7283e/hf_xet-1.5.1-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:0c97106032ef70467b4f6bc2d0ccc266d7613ee076afc56516c502f87ce1c4a6", size = 4500703, upload-time = "2026-06-08T23:02:47.628Z" }, + { url = "https://files.pythonhosted.org/packages/fb/d1/90a498d05447980b977b1669246eeeeae4cfb0ea3e7a286eaba627f91bf9/hf_xet-1.5.1-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:6208adb15d192b90e4c2ad2a27ed864359b2cb0f2494eb6d7c7f3699ac02e2bf", size = 4719498, upload-time = "2026-06-08T23:02:49.268Z" }, + { url = "https://files.pythonhosted.org/packages/6d/b6/20f99cfe97cc663a711f7b33cc21d4793e51968e9a26125b4afcd77315ba/hf_xet-1.5.1-cp37-abi3-win_amd64.whl", hash = "sha256:f7b3002f95d1c13e24bcb4537baa8f0eb3838957067c91bb4959bc004a6435f5", size = 4026419, upload-time = "2026-06-08T23:02:50.829Z" }, + { url = "https://files.pythonhosted.org/packages/f9/fa/77453694888f03e5a8c8852d1514a0894d8e81c622d39edbaf308ea0dcf4/hf_xet-1.5.1-cp37-abi3-win_arm64.whl", hash = "sha256:93d090b57b211133f6c0dab0205ef5cb6d89162979ba75a74845045cc3063b8e", size = 3855178, upload-time = "2026-06-08T23:02:52.452Z" }, +] + [[package]] name = "httpcore" version = "1.0.9" @@ -302,6 +365,27 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/56/95/9377bcb415797e44274b51d46e3249eba641711cf3348050f76ee7b15ffc/httpx-0.27.2-py3-none-any.whl", hash = "sha256:7bb2708e112d8fdd7829cd4243970f0c223274051cb35ee80c03301ee29a3df0", size = 76395, upload-time = "2024-08-27T12:53:59.653Z" }, ] +[[package]] +name = "huggingface-hub" +version = "1.19.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "click" }, + { name = "filelock" }, + { name = "fsspec" }, + { name = "hf-xet", marker = "platform_machine == 'AMD64' or platform_machine == 'aarch64' or platform_machine == 'amd64' or platform_machine == 'arm64' or platform_machine == 'x86_64'" }, + { name = "httpx" }, + { name = "packaging" }, + { name = "pyyaml" }, + { name = "tqdm" }, + { name = "typer" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/88/27/629cfe58c582f92ded066c4a07d1a057ff617118ab7973200f770bd853cb/huggingface_hub-1.19.0.tar.gz", hash = "sha256:fd771622182d40977272a923953ee3b1b13538f9f8a7f5d78398f10af0f1c0bd", size = 824721, upload-time = "2026-06-11T12:33:18.665Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b2/a5/558da89f66464d8d0229ff497e8b8666977de2d8cf48c28a2862ecf1250f/huggingface_hub-1.19.0-py3-none-any.whl", hash = "sha256:1dc72e1f6b4d6df6b30eb72e57d00514ef453d660f04af2b87f0e67267f31ee0", size = 693398, upload-time = "2026-06-11T12:33:16.695Z" }, +] + [[package]] name = "idna" version = "3.16" @@ -320,6 +404,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" }, ] +[[package]] +name = "jinja2" +version = "3.1.6" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "markupsafe" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d", size = 245115, upload-time = "2025-03-05T20:05:02.478Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload-time = "2025-03-05T20:05:00.369Z" }, +] + [[package]] name = "jiter" version = "0.15.0" @@ -392,6 +488,187 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/c8/8d/302cb2057b7513327b4d575cff6b1d066ee6431a5357fc3f8867cd684406/jiter-0.15.0-graalpy312-graalpy250_312_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:54d5d6090cdc1b7c9e780dfb04949a990adb1e301a2fc0bbcee7de4638d33f9a", size = 344469, upload-time = "2026-05-19T10:09:46.864Z" }, ] +[[package]] +name = "joblib" +version = "1.5.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/41/f2/d34e8b3a08a9cc79a50b2208a93dce981fe615b64d5a4d4abee421d898df/joblib-1.5.3.tar.gz", hash = "sha256:8561a3269e6801106863fd0d6d84bb737be9e7631e33aaed3fb9ce5953688da3", size = 331603, upload-time = "2025-12-15T08:41:46.427Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7b/91/984aca2ec129e2757d1e4e3c81c3fcda9d0f85b74670a094cc443d9ee949/joblib-1.5.3-py3-none-any.whl", hash = "sha256:5fc3c5039fc5ca8c0276333a188bbd59d6b7ab37fe6632daa76bc7f9ec18e713", size = 309071, upload-time = "2025-12-15T08:41:44.973Z" }, +] + +[[package]] +name = "markdown-it-py" +version = "4.2.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "mdurl" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/06/ff/7841249c247aa650a76b9ee4bbaeae59370dc8bfd2f6c01f3630c35eb134/markdown_it_py-4.2.0.tar.gz", hash = "sha256:04a21681d6fbb623de53f6f364d352309d4094dd4194040a10fd51833e418d49", size = 82454, upload-time = "2026-05-07T12:08:28.36Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b3/81/4da04ced5a082363ecfa159c010d200ecbd959ae410c10c0264a38cac0f5/markdown_it_py-4.2.0-py3-none-any.whl", hash = "sha256:9f7ebbcd14fe59494226453aed97c1070d83f8d24b6fc3a3bcf9a38092641c4a", size = 91687, upload-time = "2026-05-07T12:08:27.182Z" }, +] + +[[package]] +name = "markupsafe" +version = "3.0.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/7e/99/7690b6d4034fffd95959cbe0c02de8deb3098cc577c67bb6a24fe5d7caa7/markupsafe-3.0.3.tar.gz", hash = "sha256:722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698", size = 80313, upload-time = "2025-09-27T18:37:40.426Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5a/72/147da192e38635ada20e0a2e1a51cf8823d2119ce8883f7053879c2199b5/markupsafe-3.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d53197da72cc091b024dd97249dfc7794d6a56530370992a5e1a08983ad9230e", size = 11615, upload-time = "2025-09-27T18:36:30.854Z" }, + { url = "https://files.pythonhosted.org/packages/9a/81/7e4e08678a1f98521201c3079f77db69fb552acd56067661f8c2f534a718/markupsafe-3.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1872df69a4de6aead3491198eaf13810b565bdbeec3ae2dc8780f14458ec73ce", size = 12020, upload-time = "2025-09-27T18:36:31.971Z" }, + { url = "https://files.pythonhosted.org/packages/1e/2c/799f4742efc39633a1b54a92eec4082e4f815314869865d876824c257c1e/markupsafe-3.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3a7e8ae81ae39e62a41ec302f972ba6ae23a5c5396c8e60113e9066ef893da0d", size = 24332, upload-time = "2025-09-27T18:36:32.813Z" }, + { url = "https://files.pythonhosted.org/packages/3c/2e/8d0c2ab90a8c1d9a24f0399058ab8519a3279d1bd4289511d74e909f060e/markupsafe-3.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d6dd0be5b5b189d31db7cda48b91d7e0a9795f31430b7f271219ab30f1d3ac9d", size = 22947, upload-time = "2025-09-27T18:36:33.86Z" }, + { url = "https://files.pythonhosted.org/packages/2c/54/887f3092a85238093a0b2154bd629c89444f395618842e8b0c41783898ea/markupsafe-3.0.3-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:94c6f0bb423f739146aec64595853541634bde58b2135f27f61c1ffd1cd4d16a", size = 21962, upload-time = "2025-09-27T18:36:35.099Z" }, + { url = "https://files.pythonhosted.org/packages/c9/2f/336b8c7b6f4a4d95e91119dc8521402461b74a485558d8f238a68312f11c/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:be8813b57049a7dc738189df53d69395eba14fb99345e0a5994914a3864c8a4b", size = 23760, upload-time = "2025-09-27T18:36:36.001Z" }, + { url = "https://files.pythonhosted.org/packages/32/43/67935f2b7e4982ffb50a4d169b724d74b62a3964bc1a9a527f5ac4f1ee2b/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:83891d0e9fb81a825d9a6d61e3f07550ca70a076484292a70fde82c4b807286f", size = 21529, upload-time = "2025-09-27T18:36:36.906Z" }, + { url = "https://files.pythonhosted.org/packages/89/e0/4486f11e51bbba8b0c041098859e869e304d1c261e59244baa3d295d47b7/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:77f0643abe7495da77fb436f50f8dab76dbc6e5fd25d39589a0f1fe6548bfa2b", size = 23015, upload-time = "2025-09-27T18:36:37.868Z" }, + { url = "https://files.pythonhosted.org/packages/2f/e1/78ee7a023dac597a5825441ebd17170785a9dab23de95d2c7508ade94e0e/markupsafe-3.0.3-cp312-cp312-win32.whl", hash = "sha256:d88b440e37a16e651bda4c7c2b930eb586fd15ca7406cb39e211fcff3bf3017d", size = 14540, upload-time = "2025-09-27T18:36:38.761Z" }, + { url = "https://files.pythonhosted.org/packages/aa/5b/bec5aa9bbbb2c946ca2733ef9c4ca91c91b6a24580193e891b5f7dbe8e1e/markupsafe-3.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:26a5784ded40c9e318cfc2bdb30fe164bdb8665ded9cd64d500a34fb42067b1c", size = 15105, upload-time = "2025-09-27T18:36:39.701Z" }, + { url = "https://files.pythonhosted.org/packages/e5/f1/216fc1bbfd74011693a4fd837e7026152e89c4bcf3e77b6692fba9923123/markupsafe-3.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:35add3b638a5d900e807944a078b51922212fb3dedb01633a8defc4b01a3c85f", size = 13906, upload-time = "2025-09-27T18:36:40.689Z" }, + { url = "https://files.pythonhosted.org/packages/38/2f/907b9c7bbba283e68f20259574b13d005c121a0fa4c175f9bed27c4597ff/markupsafe-3.0.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e1cf1972137e83c5d4c136c43ced9ac51d0e124706ee1c8aa8532c1287fa8795", size = 11622, upload-time = "2025-09-27T18:36:41.777Z" }, + { url = "https://files.pythonhosted.org/packages/9c/d9/5f7756922cdd676869eca1c4e3c0cd0df60ed30199ffd775e319089cb3ed/markupsafe-3.0.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:116bb52f642a37c115f517494ea5feb03889e04df47eeff5b130b1808ce7c219", size = 12029, upload-time = "2025-09-27T18:36:43.257Z" }, + { url = "https://files.pythonhosted.org/packages/00/07/575a68c754943058c78f30db02ee03a64b3c638586fba6a6dd56830b30a3/markupsafe-3.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:133a43e73a802c5562be9bbcd03d090aa5a1fe899db609c29e8c8d815c5f6de6", size = 24374, upload-time = "2025-09-27T18:36:44.508Z" }, + { url = "https://files.pythonhosted.org/packages/a9/21/9b05698b46f218fc0e118e1f8168395c65c8a2c750ae2bab54fc4bd4e0e8/markupsafe-3.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ccfcd093f13f0f0b7fdd0f198b90053bf7b2f02a3927a30e63f3ccc9df56b676", size = 22980, upload-time = "2025-09-27T18:36:45.385Z" }, + { url = "https://files.pythonhosted.org/packages/7f/71/544260864f893f18b6827315b988c146b559391e6e7e8f7252839b1b846a/markupsafe-3.0.3-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:509fa21c6deb7a7a273d629cf5ec029bc209d1a51178615ddf718f5918992ab9", size = 21990, upload-time = "2025-09-27T18:36:46.916Z" }, + { url = "https://files.pythonhosted.org/packages/c2/28/b50fc2f74d1ad761af2f5dcce7492648b983d00a65b8c0e0cb457c82ebbe/markupsafe-3.0.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a4afe79fb3de0b7097d81da19090f4df4f8d3a2b3adaa8764138aac2e44f3af1", size = 23784, upload-time = "2025-09-27T18:36:47.884Z" }, + { url = "https://files.pythonhosted.org/packages/ed/76/104b2aa106a208da8b17a2fb72e033a5a9d7073c68f7e508b94916ed47a9/markupsafe-3.0.3-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:795e7751525cae078558e679d646ae45574b47ed6e7771863fcc079a6171a0fc", size = 21588, upload-time = "2025-09-27T18:36:48.82Z" }, + { url = "https://files.pythonhosted.org/packages/b5/99/16a5eb2d140087ebd97180d95249b00a03aa87e29cc224056274f2e45fd6/markupsafe-3.0.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:8485f406a96febb5140bfeca44a73e3ce5116b2501ac54fe953e488fb1d03b12", size = 23041, upload-time = "2025-09-27T18:36:49.797Z" }, + { url = "https://files.pythonhosted.org/packages/19/bc/e7140ed90c5d61d77cea142eed9f9c303f4c4806f60a1044c13e3f1471d0/markupsafe-3.0.3-cp313-cp313-win32.whl", hash = "sha256:bdd37121970bfd8be76c5fb069c7751683bdf373db1ed6c010162b2a130248ed", size = 14543, upload-time = "2025-09-27T18:36:51.584Z" }, + { url = "https://files.pythonhosted.org/packages/05/73/c4abe620b841b6b791f2edc248f556900667a5a1cf023a6646967ae98335/markupsafe-3.0.3-cp313-cp313-win_amd64.whl", hash = "sha256:9a1abfdc021a164803f4d485104931fb8f8c1efd55bc6b748d2f5774e78b62c5", size = 15113, upload-time = "2025-09-27T18:36:52.537Z" }, + { url = "https://files.pythonhosted.org/packages/f0/3a/fa34a0f7cfef23cf9500d68cb7c32dd64ffd58a12b09225fb03dd37d5b80/markupsafe-3.0.3-cp313-cp313-win_arm64.whl", hash = "sha256:7e68f88e5b8799aa49c85cd116c932a1ac15caaa3f5db09087854d218359e485", size = 13911, upload-time = "2025-09-27T18:36:53.513Z" }, + { url = "https://files.pythonhosted.org/packages/e4/d7/e05cd7efe43a88a17a37b3ae96e79a19e846f3f456fe79c57ca61356ef01/markupsafe-3.0.3-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:218551f6df4868a8d527e3062d0fb968682fe92054e89978594c28e642c43a73", size = 11658, upload-time = "2025-09-27T18:36:54.819Z" }, + { url = "https://files.pythonhosted.org/packages/99/9e/e412117548182ce2148bdeacdda3bb494260c0b0184360fe0d56389b523b/markupsafe-3.0.3-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:3524b778fe5cfb3452a09d31e7b5adefeea8c5be1d43c4f810ba09f2ceb29d37", size = 12066, upload-time = "2025-09-27T18:36:55.714Z" }, + { url = "https://files.pythonhosted.org/packages/bc/e6/fa0ffcda717ef64a5108eaa7b4f5ed28d56122c9a6d70ab8b72f9f715c80/markupsafe-3.0.3-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4e885a3d1efa2eadc93c894a21770e4bc67899e3543680313b09f139e149ab19", size = 25639, upload-time = "2025-09-27T18:36:56.908Z" }, + { url = "https://files.pythonhosted.org/packages/96/ec/2102e881fe9d25fc16cb4b25d5f5cde50970967ffa5dddafdb771237062d/markupsafe-3.0.3-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8709b08f4a89aa7586de0aadc8da56180242ee0ada3999749b183aa23df95025", size = 23569, upload-time = "2025-09-27T18:36:57.913Z" }, + { url = "https://files.pythonhosted.org/packages/4b/30/6f2fce1f1f205fc9323255b216ca8a235b15860c34b6798f810f05828e32/markupsafe-3.0.3-cp313-cp313t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:b8512a91625c9b3da6f127803b166b629725e68af71f8184ae7e7d54686a56d6", size = 23284, upload-time = "2025-09-27T18:36:58.833Z" }, + { url = "https://files.pythonhosted.org/packages/58/47/4a0ccea4ab9f5dcb6f79c0236d954acb382202721e704223a8aafa38b5c8/markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:9b79b7a16f7fedff2495d684f2b59b0457c3b493778c9eed31111be64d58279f", size = 24801, upload-time = "2025-09-27T18:36:59.739Z" }, + { url = "https://files.pythonhosted.org/packages/6a/70/3780e9b72180b6fecb83a4814d84c3bf4b4ae4bf0b19c27196104149734c/markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_riscv64.whl", hash = "sha256:12c63dfb4a98206f045aa9563db46507995f7ef6d83b2f68eda65c307c6829eb", size = 22769, upload-time = "2025-09-27T18:37:00.719Z" }, + { url = "https://files.pythonhosted.org/packages/98/c5/c03c7f4125180fc215220c035beac6b9cb684bc7a067c84fc69414d315f5/markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:8f71bc33915be5186016f675cd83a1e08523649b0e33efdb898db577ef5bb009", size = 23642, upload-time = "2025-09-27T18:37:01.673Z" }, + { url = "https://files.pythonhosted.org/packages/80/d6/2d1b89f6ca4bff1036499b1e29a1d02d282259f3681540e16563f27ebc23/markupsafe-3.0.3-cp313-cp313t-win32.whl", hash = "sha256:69c0b73548bc525c8cb9a251cddf1931d1db4d2258e9599c28c07ef3580ef354", size = 14612, upload-time = "2025-09-27T18:37:02.639Z" }, + { url = "https://files.pythonhosted.org/packages/2b/98/e48a4bfba0a0ffcf9925fe2d69240bfaa19c6f7507b8cd09c70684a53c1e/markupsafe-3.0.3-cp313-cp313t-win_amd64.whl", hash = "sha256:1b4b79e8ebf6b55351f0d91fe80f893b4743f104bff22e90697db1590e47a218", size = 15200, upload-time = "2025-09-27T18:37:03.582Z" }, + { url = "https://files.pythonhosted.org/packages/0e/72/e3cc540f351f316e9ed0f092757459afbc595824ca724cbc5a5d4263713f/markupsafe-3.0.3-cp313-cp313t-win_arm64.whl", hash = "sha256:ad2cf8aa28b8c020ab2fc8287b0f823d0a7d8630784c31e9ee5edea20f406287", size = 13973, upload-time = "2025-09-27T18:37:04.929Z" }, + { url = "https://files.pythonhosted.org/packages/33/8a/8e42d4838cd89b7dde187011e97fe6c3af66d8c044997d2183fbd6d31352/markupsafe-3.0.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:eaa9599de571d72e2daf60164784109f19978b327a3910d3e9de8c97b5b70cfe", size = 11619, upload-time = "2025-09-27T18:37:06.342Z" }, + { url = "https://files.pythonhosted.org/packages/b5/64/7660f8a4a8e53c924d0fa05dc3a55c9cee10bbd82b11c5afb27d44b096ce/markupsafe-3.0.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:c47a551199eb8eb2121d4f0f15ae0f923d31350ab9280078d1e5f12b249e0026", size = 12029, upload-time = "2025-09-27T18:37:07.213Z" }, + { url = "https://files.pythonhosted.org/packages/da/ef/e648bfd021127bef5fa12e1720ffed0c6cbb8310c8d9bea7266337ff06de/markupsafe-3.0.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f34c41761022dd093b4b6896d4810782ffbabe30f2d443ff5f083e0cbbb8c737", size = 24408, upload-time = "2025-09-27T18:37:09.572Z" }, + { url = "https://files.pythonhosted.org/packages/41/3c/a36c2450754618e62008bf7435ccb0f88053e07592e6028a34776213d877/markupsafe-3.0.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:457a69a9577064c05a97c41f4e65148652db078a3a509039e64d3467b9e7ef97", size = 23005, upload-time = "2025-09-27T18:37:10.58Z" }, + { url = "https://files.pythonhosted.org/packages/bc/20/b7fdf89a8456b099837cd1dc21974632a02a999ec9bf7ca3e490aacd98e7/markupsafe-3.0.3-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:e8afc3f2ccfa24215f8cb28dcf43f0113ac3c37c2f0f0806d8c70e4228c5cf4d", size = 22048, upload-time = "2025-09-27T18:37:11.547Z" }, + { url = "https://files.pythonhosted.org/packages/9a/a7/591f592afdc734f47db08a75793a55d7fbcc6902a723ae4cfbab61010cc5/markupsafe-3.0.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:ec15a59cf5af7be74194f7ab02d0f59a62bdcf1a537677ce67a2537c9b87fcda", size = 23821, upload-time = "2025-09-27T18:37:12.48Z" }, + { url = "https://files.pythonhosted.org/packages/7d/33/45b24e4f44195b26521bc6f1a82197118f74df348556594bd2262bda1038/markupsafe-3.0.3-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:0eb9ff8191e8498cca014656ae6b8d61f39da5f95b488805da4bb029cccbfbaf", size = 21606, upload-time = "2025-09-27T18:37:13.485Z" }, + { url = "https://files.pythonhosted.org/packages/ff/0e/53dfaca23a69fbfbbf17a4b64072090e70717344c52eaaaa9c5ddff1e5f0/markupsafe-3.0.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:2713baf880df847f2bece4230d4d094280f4e67b1e813eec43b4c0e144a34ffe", size = 23043, upload-time = "2025-09-27T18:37:14.408Z" }, + { url = "https://files.pythonhosted.org/packages/46/11/f333a06fc16236d5238bfe74daccbca41459dcd8d1fa952e8fbd5dccfb70/markupsafe-3.0.3-cp314-cp314-win32.whl", hash = "sha256:729586769a26dbceff69f7a7dbbf59ab6572b99d94576a5592625d5b411576b9", size = 14747, upload-time = "2025-09-27T18:37:15.36Z" }, + { url = "https://files.pythonhosted.org/packages/28/52/182836104b33b444e400b14f797212f720cbc9ed6ba34c800639d154e821/markupsafe-3.0.3-cp314-cp314-win_amd64.whl", hash = "sha256:bdc919ead48f234740ad807933cdf545180bfbe9342c2bb451556db2ed958581", size = 15341, upload-time = "2025-09-27T18:37:16.496Z" }, + { url = "https://files.pythonhosted.org/packages/6f/18/acf23e91bd94fd7b3031558b1f013adfa21a8e407a3fdb32745538730382/markupsafe-3.0.3-cp314-cp314-win_arm64.whl", hash = "sha256:5a7d5dc5140555cf21a6fefbdbf8723f06fcd2f63ef108f2854de715e4422cb4", size = 14073, upload-time = "2025-09-27T18:37:17.476Z" }, + { url = "https://files.pythonhosted.org/packages/3c/f0/57689aa4076e1b43b15fdfa646b04653969d50cf30c32a102762be2485da/markupsafe-3.0.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:1353ef0c1b138e1907ae78e2f6c63ff67501122006b0f9abad68fda5f4ffc6ab", size = 11661, upload-time = "2025-09-27T18:37:18.453Z" }, + { url = "https://files.pythonhosted.org/packages/89/c3/2e67a7ca217c6912985ec766c6393b636fb0c2344443ff9d91404dc4c79f/markupsafe-3.0.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:1085e7fbddd3be5f89cc898938f42c0b3c711fdcb37d75221de2666af647c175", size = 12069, upload-time = "2025-09-27T18:37:19.332Z" }, + { url = "https://files.pythonhosted.org/packages/f0/00/be561dce4e6ca66b15276e184ce4b8aec61fe83662cce2f7d72bd3249d28/markupsafe-3.0.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1b52b4fb9df4eb9ae465f8d0c228a00624de2334f216f178a995ccdcf82c4634", size = 25670, upload-time = "2025-09-27T18:37:20.245Z" }, + { url = "https://files.pythonhosted.org/packages/50/09/c419f6f5a92e5fadde27efd190eca90f05e1261b10dbd8cbcb39cd8ea1dc/markupsafe-3.0.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:fed51ac40f757d41b7c48425901843666a6677e3e8eb0abcff09e4ba6e664f50", size = 23598, upload-time = "2025-09-27T18:37:21.177Z" }, + { url = "https://files.pythonhosted.org/packages/22/44/a0681611106e0b2921b3033fc19bc53323e0b50bc70cffdd19f7d679bb66/markupsafe-3.0.3-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:f190daf01f13c72eac4efd5c430a8de82489d9cff23c364c3ea822545032993e", size = 23261, upload-time = "2025-09-27T18:37:22.167Z" }, + { url = "https://files.pythonhosted.org/packages/5f/57/1b0b3f100259dc9fffe780cfb60d4be71375510e435efec3d116b6436d43/markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:e56b7d45a839a697b5eb268c82a71bd8c7f6c94d6fd50c3d577fa39a9f1409f5", size = 24835, upload-time = "2025-09-27T18:37:23.296Z" }, + { url = "https://files.pythonhosted.org/packages/26/6a/4bf6d0c97c4920f1597cc14dd720705eca0bf7c787aebc6bb4d1bead5388/markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:f3e98bb3798ead92273dc0e5fd0f31ade220f59a266ffd8a4f6065e0a3ce0523", size = 22733, upload-time = "2025-09-27T18:37:24.237Z" }, + { url = "https://files.pythonhosted.org/packages/14/c7/ca723101509b518797fedc2fdf79ba57f886b4aca8a7d31857ba3ee8281f/markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:5678211cb9333a6468fb8d8be0305520aa073f50d17f089b5b4b477ea6e67fdc", size = 23672, upload-time = "2025-09-27T18:37:25.271Z" }, + { url = "https://files.pythonhosted.org/packages/fb/df/5bd7a48c256faecd1d36edc13133e51397e41b73bb77e1a69deab746ebac/markupsafe-3.0.3-cp314-cp314t-win32.whl", hash = "sha256:915c04ba3851909ce68ccc2b8e2cd691618c4dc4c4232fb7982bca3f41fd8c3d", size = 14819, upload-time = "2025-09-27T18:37:26.285Z" }, + { url = "https://files.pythonhosted.org/packages/1a/8a/0402ba61a2f16038b48b39bccca271134be00c5c9f0f623208399333c448/markupsafe-3.0.3-cp314-cp314t-win_amd64.whl", hash = "sha256:4faffd047e07c38848ce017e8725090413cd80cbc23d86e55c587bf979e579c9", size = 15426, upload-time = "2025-09-27T18:37:27.316Z" }, + { url = "https://files.pythonhosted.org/packages/70/bc/6f1c2f612465f5fa89b95bead1f44dcb607670fd42891d8fdcd5d039f4f4/markupsafe-3.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:32001d6a8fc98c8cb5c947787c5d08b0a50663d139f1305bac5885d98d9b40fa", size = 14146, upload-time = "2025-09-27T18:37:28.327Z" }, +] + +[[package]] +name = "mdurl" +version = "0.1.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba", size = 8729, upload-time = "2022-08-14T12:40:10.846Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", size = 9979, upload-time = "2022-08-14T12:40:09.779Z" }, +] + +[[package]] +name = "mpmath" +version = "1.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e0/47/dd32fa426cc72114383ac549964eecb20ecfd886d1e5ccf5340b55b02f57/mpmath-1.3.0.tar.gz", hash = "sha256:7a28eb2a9774d00c7bc92411c19a89209d5da7c4c9a9e227be8330a23a25b91f", size = 508106, upload-time = "2023-03-07T16:47:11.061Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/43/e3/7d92a15f894aa0c9c4b49b8ee9ac9850d6e63b03c9c32c0367a13ae62209/mpmath-1.3.0-py3-none-any.whl", hash = "sha256:a0b2b9fe80bbcd81a6647ff13108738cfb482d481d826cc0e02f5b35e5c88d2c", size = 536198, upload-time = "2023-03-07T16:47:09.197Z" }, +] + +[[package]] +name = "narwhals" +version = "2.22.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/62/3c/c4ef2164a71c1a63d7f1ae411c4082c5fa872405106db60a4b7114989ad7/narwhals-2.22.1.tar.gz", hash = "sha256:d62920805a0a43b7ff8b54b0c0d3142d796f8a9301836ada37e573d6a33cbcd9", size = 647493, upload-time = "2026-06-05T12:34:34.051Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/48/ca/36339329c4604adbcc99c899b7eb1ce1a555c499b6a6860757dc9bfed36d/narwhals-2.22.1-py3-none-any.whl", hash = "sha256:60567d774edf77db53906f89d9fbd164e66e56d66d388e1e6990f17ac33cfb53", size = 454815, upload-time = "2026-06-05T12:34:32.289Z" }, +] + +[[package]] +name = "networkx" +version = "3.6.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/6a/51/63fe664f3908c97be9d2e4f1158eb633317598cfa6e1fc14af5383f17512/networkx-3.6.1.tar.gz", hash = "sha256:26b7c357accc0c8cde558ad486283728b65b6a95d85ee1cd66bafab4c8168509", size = 2517025, upload-time = "2025-12-08T17:02:39.908Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/9e/c9/b2622292ea83fbb4ec318f5b9ab867d0a28ab43c5717bb85b0a5f6b3b0a4/networkx-3.6.1-py3-none-any.whl", hash = "sha256:d47fbf302e7d9cbbb9e2555a0d267983d2aa476bac30e90dfbe5669bd57f3762", size = 2068504, upload-time = "2025-12-08T17:02:38.159Z" }, +] + +[[package]] +name = "numpy" +version = "2.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d0/ad/fed0499ce6a338d2a03ebae59cd15093910c8875328855781952abf6c2fe/numpy-2.4.6.tar.gz", hash = "sha256:f3a3570c4a2a16746ac2c31a7c7c7b0c186b95ce902e33db6f28094ed7387dda", size = 20735807, upload-time = "2026-05-18T23:37:14.07Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/95/2a/3d7b5ac8aac24feaf9ad7ed58f45b0bbc06d37e4338ae84c9f2298b570f9/numpy-2.4.6-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:001fbb8e08d942dd57599e781f2472269ee7f2755fae407b4f67b2f0b17da3f1", size = 16689119, upload-time = "2026-05-18T23:33:54.065Z" }, + { url = "https://files.pythonhosted.org/packages/ea/12/92c4c131527599e8288d6918e888d88726f84d805d784b771f32408aeaef/numpy-2.4.6-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ebfb099f8dcf083deef3ac1ca4c1503f387cf76296fcb3816b66f5ecb5f54fdb", size = 14699246, upload-time = "2026-05-18T23:33:57.621Z" }, + { url = "https://files.pythonhosted.org/packages/ad/fe/c0a6b7b2ca128a8fb228575147073b660656734b8ebe4d76c8fd748dcc79/numpy-2.4.6-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:3213d622a0283a39a93d188f3cf72b26862df52fbb4ca3697f51705016523d41", size = 5204410, upload-time = "2026-05-18T23:34:00.302Z" }, + { url = "https://files.pythonhosted.org/packages/f3/d4/9770d14ba719432bb90a421bfd443872ed0f70f7264b64bec12ea363d5fd/numpy-2.4.6-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:357cc07a6d7b0b182ff02249616a03742827ebb1277546b5c7cd7f7620a45698", size = 6551240, upload-time = "2026-05-18T23:34:02.852Z" }, + { url = "https://files.pythonhosted.org/packages/c9/c6/50a46a6205feba2343f1d6d17438107c5dc491ed1c736e6ea68689fd906b/numpy-2.4.6-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5f9fb9157b4ce2971008323afe46053787b526ef624fea915b261468a8421a0f", size = 15671012, upload-time = "2026-05-18T23:34:05.485Z" }, + { url = "https://files.pythonhosted.org/packages/99/60/14115e6364fa676c5397c2ad3004e527e9aa487abf5d0706ec81bbd08529/numpy-2.4.6-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:90f9849678c75fe7afa2d348ac842c168b0a4d3d61919687216dfc547976d853", size = 16645538, upload-time = "2026-05-18T23:34:09.265Z" }, + { url = "https://files.pythonhosted.org/packages/ae/c5/693cbe59e57db94d2231fa519ca3978dc9e19da5a8f088588f5c6e947ff2/numpy-2.4.6-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:c1a2af6c6ef86344a6b0db6b97834208bf598db514f2b155042439b62605601a", size = 17020706, upload-time = "2026-05-18T23:34:13.053Z" }, + { url = "https://files.pythonhosted.org/packages/ef/fc/85b7c4eff9b4966ade25c2273cf7e7012e92366c032058653934b37de044/numpy-2.4.6-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e5805d5a22fd19c8ccff10a9561f9df94436b0545619ea579db2d3c35294bce2", size = 18368541, upload-time = "2026-05-18T23:34:17.024Z" }, + { url = "https://files.pythonhosted.org/packages/f6/81/e1b27545deedce7f4a0b348618c6b62d74e36a4dc9ccd42f3eb2f85eee32/numpy-2.4.6-cp312-cp312-win32.whl", hash = "sha256:e3eeb0aabd6bd5ce64faae67e9935203a6991b4bc2a485a767fbafb2c5125f45", size = 5962825, upload-time = "2026-05-18T23:34:20.3Z" }, + { url = "https://files.pythonhosted.org/packages/ab/ca/feab00bd44aa5fe1ad2c18f08b4d3bb92e26484b0b1d1443897809ed528c/numpy-2.4.6-cp312-cp312-win_amd64.whl", hash = "sha256:d8e8286dd7cea7895157318d1b91cdacac64c479f3cbc8dce548331728484751", size = 12321687, upload-time = "2026-05-18T23:34:23.095Z" }, + { url = "https://files.pythonhosted.org/packages/63/cf/5a6d34850a39d1093558564f77ee8e8e0bee5061151b8f05a55711001ec7/numpy-2.4.6-cp312-cp312-win_arm64.whl", hash = "sha256:4081eb135ac24158bd51cdfbef16f1c64df7063b1143f24731387137c092bec8", size = 10221482, upload-time = "2026-05-18T23:34:25.876Z" }, + { url = "https://files.pythonhosted.org/packages/fb/82/bdab26d7438c6791ca31b7c024ca37c1eab8b726ba236129005cd4a06e45/numpy-2.4.6-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:511dbaf848decaaaf4b4ca48032619fb3138710c4bf7da7617765edad1ef96b0", size = 16684648, upload-time = "2026-05-18T23:34:29.41Z" }, + { url = "https://files.pythonhosted.org/packages/1b/30/a80189bcc7f5e4258b3fbc3968d909d1756f54d023299ecc39ad6fdb9ef8/numpy-2.4.6-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:bf162abab1c1a736333192707cef898e735a5ca00f38f27eeedf44b39d9e85eb", size = 14693902, upload-time = "2026-05-18T23:34:33.013Z" }, + { url = "https://files.pythonhosted.org/packages/97/12/70b5d0d7c15e1ebb8a6a84a8caa1d19e181d84fb58bb6d70aca29099dec1/numpy-2.4.6-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:043191bfa8eab18c776647b62723ac9dddece59743b13f49b2016094129c2b3f", size = 5198992, upload-time = "2026-05-18T23:34:36.132Z" }, + { url = "https://files.pythonhosted.org/packages/ba/8c/ebd2a8f8a83541f8d38cc5667e8c2b69cecfd30da6e45693e8158857d44b/numpy-2.4.6-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:6180d8b35af935aed8ece3a85e0a43f87393ae0ac87c8d2c8bd2c993f7270ef3", size = 6546944, upload-time = "2026-05-18T23:34:38.484Z" }, + { url = "https://files.pythonhosted.org/packages/bb/c5/7b863a97a91671a0338f4253bd3b5a3d3852f0692dae91711c9f4a10e787/numpy-2.4.6-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:72fbe16c6fac95aedf5937fa873445cec2110be35d8a4e9433d7501fd98dae6b", size = 15669392, upload-time = "2026-05-18T23:34:41.257Z" }, + { url = "https://files.pythonhosted.org/packages/a5/9d/3584b9984ca4c047aea75214ce1a4c4c73d849bd71b604264b7f5653f8a8/numpy-2.4.6-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a7830bab239b79cda9c08c2da014761cafb48da6150e1da17ac06283f43b6089", size = 16633220, upload-time = "2026-05-18T23:34:45.075Z" }, + { url = "https://files.pythonhosted.org/packages/05/ae/7c67fba23bd98caec7c99261f3a16072ade14813486b0282cb29846de832/numpy-2.4.6-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ef4aea96ce4d3b074422cb4f2f64e216bf9e213004bb58ecfdf50ea02ea8eb9a", size = 17020800, upload-time = "2026-05-18T23:34:49.065Z" }, + { url = "https://files.pythonhosted.org/packages/d9/5d/3b6725cb31d983c5e66916f5d36f6d7e5521129e4c4404d64f918292a5b6/numpy-2.4.6-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:dfa20cc6ca228e6b155b11da03825975ce66aea520985dbbddf0f2a5a495c605", size = 18357600, upload-time = "2026-05-18T23:34:52.709Z" }, + { url = "https://files.pythonhosted.org/packages/f7/da/2ccc6c2fe8898dee01d90c75c5f5f914a23daf99e3e0f59516a08760c8b5/numpy-2.4.6-cp313-cp313-win32.whl", hash = "sha256:56b39e5e0622a09a25bf5baf62f4bcf0cb8a41ae6e2819cf49bbc5a74c083f91", size = 5961134, upload-time = "2026-05-18T23:34:55.618Z" }, + { url = "https://files.pythonhosted.org/packages/b5/cd/9cc4dc876fb065d5c220aae4d5e14826b2715331bb7618ce1fb07a679d99/numpy-2.4.6-cp313-cp313-win_amd64.whl", hash = "sha256:c4fc99836233ea196540b17ab0983aff60ed07941751930f5f4d05bc3b3b7359", size = 12318598, upload-time = "2026-05-18T23:34:58.928Z" }, + { url = "https://files.pythonhosted.org/packages/39/1e/c0bcba1f8694116485fe28fd1be698c278fcda4141c5b0e53a2aed8b12a8/numpy-2.4.6-cp313-cp313-win_arm64.whl", hash = "sha256:a7c711e21628b52034bb5ab8d1bce291f752fcc5e92accc615778acee1ff4778", size = 10222272, upload-time = "2026-05-18T23:35:02.167Z" }, + { url = "https://files.pythonhosted.org/packages/63/6d/cc5619247c8f4204e507f5883528372e4ac4bb189e579fb859a12e480b1f/numpy-2.4.6-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:112b06a867b235ef466ed3508ddf0238050df9c727cafb5301ac385b899189a1", size = 14821197, upload-time = "2026-05-18T23:35:05.468Z" }, + { url = "https://files.pythonhosted.org/packages/00/58/f1c39161c87d9e9bed660f1ed4bafc0e403d5ec9650b6dd77aead07d489b/numpy-2.4.6-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:eaf7fa2de5c0be8ae6ff8e9bea2ccd725e980541244521d8d4b5f3354a27babe", size = 5326287, upload-time = "2026-05-18T23:35:08.693Z" }, + { url = "https://files.pythonhosted.org/packages/af/57/3917ab0fd97f271a8694513581b8a36c655f111c446852c302f04ccdb6fc/numpy-2.4.6-cp313-cp313t-macosx_14_0_x86_64.whl", hash = "sha256:7265a2f3d436e54ef9f2b52b5c937e6be778781bd97a590319d7348f1c1ca997", size = 6646763, upload-time = "2026-05-18T23:35:11.459Z" }, + { url = "https://files.pythonhosted.org/packages/eb/0f/037e64c494b67581ae18193d770adef354c41f3f2c8ebf865602d949bf8f/numpy-2.4.6-cp313-cp313t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f74a575920ab21fe304421a3fc28793d82e299cae9eccb37084e9fc7f3617c20", size = 15728070, upload-time = "2026-05-18T23:35:14.79Z" }, + { url = "https://files.pythonhosted.org/packages/21/a6/5d2bae9c9542eb4df16dc9c46dc79c186e9bad53805dfa5399a6023c6db0/numpy-2.4.6-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ede83e07a75dd06bc501566c1eca2afc0d61677c1472ac9ad93fdee6e638a48d", size = 16681752, upload-time = "2026-05-18T23:35:18.836Z" }, + { url = "https://files.pythonhosted.org/packages/92/14/23d1dfb410ae362cd59ce53e936b1513d545eb40db3949ced632e19a459e/numpy-2.4.6-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:68bb27509ac1b9a3443094260f6326150663b06abe40b73a2f81160623da5b67", size = 17086024, upload-time = "2026-05-18T23:35:22.52Z" }, + { url = "https://files.pythonhosted.org/packages/4b/6e/23595a2c642cdf3bc567877064bdd7f91c8b0038a4453cf2daf7248eafe9/numpy-2.4.6-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:a0df0043bdb289bde1f62da130d20df23d58b45429f752bc7a8fc5325a225ecd", size = 18403398, upload-time = "2026-05-18T23:35:26.398Z" }, + { url = "https://files.pythonhosted.org/packages/8a/90/0ac3bc947217e66dec77e7cbc6a1979d1af70b6461b82f620d3bccd5e4c8/numpy-2.4.6-cp313-cp313t-win32.whl", hash = "sha256:29a287e0cf63ff528da061de6b9f64a4618da591ca1046aafc54062e40ca7eab", size = 6084971, upload-time = "2026-05-18T23:35:29.387Z" }, + { url = "https://files.pythonhosted.org/packages/77/71/5673e351671a1d2bd6063b91b44f70c0affea7d1516fa7a6572941ba4aa1/numpy-2.4.6-cp313-cp313t-win_amd64.whl", hash = "sha256:25c692919ac5a01f170a3bfcd62d745b24fd095c353d50812637d6fcab442e75", size = 12458532, upload-time = "2026-05-18T23:35:32.175Z" }, + { url = "https://files.pythonhosted.org/packages/3f/88/19d3503c5046e688f049274b27a3ef3d771152fa80d3ba3d01a3dff61abe/numpy-2.4.6-cp313-cp313t-win_arm64.whl", hash = "sha256:1e978ec1e8bd0e0e4de6bb75de9d30cbb74db6b6a2bb727618613703ca0167dd", size = 10291881, upload-time = "2026-05-18T23:35:35.465Z" }, + { url = "https://files.pythonhosted.org/packages/f8/91/3ab2044d05fd16d343c5ac2e69b127f1b2854040dd20b193257c78028bd3/numpy-2.4.6-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:06ca2f61ec4385a07a6977c55ba998a4466c123642b4a32694d3128fce18c079", size = 16683458, upload-time = "2026-05-18T23:35:38.353Z" }, + { url = "https://files.pythonhosted.org/packages/8e/62/764ce66fa4147ae6d73071a3abf804ffe606f174618697c571acdf26a7c9/numpy-2.4.6-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:38efbc8de75c7a0fc1ac190162d892787f3f47b57cc291231aafee36b80982b7", size = 14704559, upload-time = "2026-05-18T23:35:42.14Z" }, + { url = "https://files.pythonhosted.org/packages/60/61/23f27c172f022e04025b7dc2367f4d63c1a398120607ec896228649a6f48/numpy-2.4.6-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:d581b735e177fdcdce6fed8e7e8880a3fb6ee4e3653a3ac6af01c6f4c03effc5", size = 5209716, upload-time = "2026-05-18T23:35:45.377Z" }, + { url = "https://files.pythonhosted.org/packages/03/71/21cf70dc6ea3e3acb95fc53a265b2fc248b981f0194ceb5b475271b8809d/numpy-2.4.6-cp314-cp314-macosx_14_0_x86_64.whl", hash = "sha256:0a041d3d761dc3c35cc56ce0351506a02bcbc25f7b169f652435141a17db9096", size = 6543947, upload-time = "2026-05-18T23:35:47.926Z" }, + { url = "https://files.pythonhosted.org/packages/d5/91/64288395ee1799bd2e0b04a305dce9666da90c961e1f3fe982a05ee1c036/numpy-2.4.6-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:40fdc1ae7125e518ea98e53e69a4ebc27e1fd50510c47b7ea130cf21e5e1d42b", size = 15685197, upload-time = "2026-05-18T23:35:50.863Z" }, + { url = "https://files.pythonhosted.org/packages/f3/eb/ebffaa97dc55502df69584a8f0dcf07f69a3e0b3e2323670a2722db9aa39/numpy-2.4.6-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a2c306dea656c12c68f51f4cea133cbe78ca7435eb28c735eac1d3ebe73be6e8", size = 16638245, upload-time = "2026-05-18T23:35:54.752Z" }, + { url = "https://files.pythonhosted.org/packages/b8/0b/54f9da33128d7e350fab89c7455902eeae70349ee52bddb448dc4a576f45/numpy-2.4.6-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:33111801a01c12a8a1e3721f0a9232f8cfc8ae2c6b7098167e6f623c6073f402", size = 17036587, upload-time = "2026-05-18T23:35:58.355Z" }, + { url = "https://files.pythonhosted.org/packages/b6/f0/fdebc1052db1cc37c64beb22072d67cd6d1c71adca1299f53dec2b5e20d3/numpy-2.4.6-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:ae506e6902902557576a26ff33eda8695e7ecb3cb36c3b573a0765dee114ebdb", size = 18363226, upload-time = "2026-05-18T23:36:02.845Z" }, + { url = "https://files.pythonhosted.org/packages/aa/b4/298628d98c72b57e57f7165ae6a481a1deaf6f3c28262a6e4c739c275930/numpy-2.4.6-cp314-cp314-win32.whl", hash = "sha256:aaf159caa35993cb1f56fb9b8e4610d35758e7ca005412eb1daa856a78c9c4b1", size = 6010196, upload-time = "2026-05-18T23:36:05.92Z" }, + { url = "https://files.pythonhosted.org/packages/df/ac/46de6dda46478f7942f839e094970be2d4a861e005c4b3bf07c92e291a09/numpy-2.4.6-cp314-cp314-win_amd64.whl", hash = "sha256:b507f5c4c1d508876d1819b6bf9a49d365b96320b5d4993426b33a23ca4b8261", size = 12450334, upload-time = "2026-05-18T23:36:09.107Z" }, + { url = "https://files.pythonhosted.org/packages/78/92/b8b798ac784102c0da830d2257d59358e3d3d90d1e2b3f2575dad976c5cf/numpy-2.4.6-cp314-cp314-win_arm64.whl", hash = "sha256:6f41ae150c4e32db4f3310cdaf64b1593a03dbabe29eec77fc9b50fe64061df6", size = 10495678, upload-time = "2026-05-18T23:36:12.766Z" }, + { url = "https://files.pythonhosted.org/packages/30/34/ec28d1aa8115971537c01469ab2011ee96827930f0a124de1000cc2a7ed7/numpy-2.4.6-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:ece3d2cfe132e7d51f44a832b303895e6f2d499c5e74dfbdb06ee246147a304a", size = 14823672, upload-time = "2026-05-18T23:36:16.473Z" }, + { url = "https://files.pythonhosted.org/packages/16/bd/f6d1fede4e54e8042a7ff97bb495510f3c220f94bcd9e8b228e87c92cc0d/numpy-2.4.6-cp314-cp314t-macosx_14_0_arm64.whl", hash = "sha256:e3e5193ef5a3dc73bceee50f7fdc2c90dbb76c42df8d8fae3d1067a583df579e", size = 5328731, upload-time = "2026-05-18T23:36:19.767Z" }, + { url = "https://files.pythonhosted.org/packages/f4/f0/e105b9e2fd728a9910103884decd6951d9dd73896b914a98d9a231de02ee/numpy-2.4.6-cp314-cp314t-macosx_14_0_x86_64.whl", hash = "sha256:17f9ade344e7d9b464a084d69bcf18fc691cb1db67c62ed80820bf4926d78f0e", size = 6649805, upload-time = "2026-05-18T23:36:22.266Z" }, + { url = "https://files.pythonhosted.org/packages/82/dd/1206a7ca6ab15e3f02069707ca96222e202af681bb73756da7527f3cb837/numpy-2.4.6-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9cd5ffd25db4e7ba6a375693b3fc0fc1791ec636c17db3720da19bde7180ec43", size = 15730496, upload-time = "2026-05-18T23:36:25.713Z" }, + { url = "https://files.pythonhosted.org/packages/51/e7/38d3ea825dcab85a591734decb2f6c67caa7c8367d374df1a1c3842f9b07/numpy-2.4.6-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7d92c3819208a60205a12a245c91ad70cb0a85336659b19b834205573ac8456e", size = 16679616, upload-time = "2026-05-18T23:36:29.652Z" }, + { url = "https://files.pythonhosted.org/packages/93/b7/caabfdf53edf663e0b4eb74d7d405d83baef09eb5e83bcd32d601d72b93e/numpy-2.4.6-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:e85b752a1e912b70eaad4fafbd4d1238007ab221de2009b9a2f5ae7461239895", size = 17085145, upload-time = "2026-05-18T23:36:33.449Z" }, + { url = "https://files.pythonhosted.org/packages/f9/45/68d7c33a6bcf3e5aa3bdbd57a367e6f615286dfd6482f97e8ffeb734306e/numpy-2.4.6-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:29cb7f67d10b479ff07c17d33e39f78c07f71c40ef30d63c153d340e96cd3fb4", size = 18403813, upload-time = "2026-05-18T23:36:37.369Z" }, + { url = "https://files.pythonhosted.org/packages/9c/50/0753655aa844c99cd9e018aacf76f130f1bd81d881bb74bc0aef5d73a8ba/numpy-2.4.6-cp314-cp314t-win32.whl", hash = "sha256:260a5d70215b61ab4fadf5c7baacd64821842975eea312125ed3c39a6391b063", size = 6156982, upload-time = "2026-05-18T23:36:40.817Z" }, + { url = "https://files.pythonhosted.org/packages/b2/d4/7c67becf668f973cb490cec3e98dfd799d866f9c989a54d355672cfa0db6/numpy-2.4.6-cp314-cp314t-win_amd64.whl", hash = "sha256:81a1cca95ed5bb92aa8b10dd2cdc9a0d3853a50fad926c28b5d7e8ea54389627", size = 12638908, upload-time = "2026-05-18T23:36:43.996Z" }, + { url = "https://files.pythonhosted.org/packages/43/bb/e1c71a4295b1b1d1393d50dbb4f2a36283c6859d9d3892e84f00ec5a91d5/numpy-2.4.6-cp314-cp314t-win_arm64.whl", hash = "sha256:0c9136e14ed34a9e343a31c533d78a9813a69a3148332bce5e9821cb2f996e66", size = 10565867, upload-time = "2026-05-18T23:36:47.114Z" }, +] + [[package]] name = "openai" version = "2.41.0" @@ -489,6 +766,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/99/ee/24ec87e3a91426497c5a2b9880662d19cfd640342d477334ebc60fc2c276/pydantic_settings-2.2.1-py3-none-any.whl", hash = "sha256:0235391d26db4d2190cb9b31051c4b46882d28a51533f97440867f012d4da091", size = 13150, upload-time = "2024-02-19T19:50:19.747Z" }, ] +[[package]] +name = "pygments" +version = "2.20.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/c3/b2/bc9c9196916376152d655522fdcebac55e66de6603a76a02bca1b6414f6c/pygments-2.20.0.tar.gz", hash = "sha256:6757cd03768053ff99f3039c1a36d6c0aa0b263438fcab17520b30a303a82b5f", size = 4955991, upload-time = "2026-03-29T13:29:33.898Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f4/7e/a72dd26f3b0f4f2bf1dd8923c85f7ceb43172af56d63c7383eb62b332364/pygments-2.20.0-py3-none-any.whl", hash = "sha256:81a9e26dd42fd28a23a2d169d86d7ac03b46e2f8b59ed4698fb4785f946d0176", size = 1231151, upload-time = "2026-03-29T13:29:30.038Z" }, +] + [[package]] name = "pyjwt" version = "2.8.0" @@ -589,6 +875,251 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/f1/12/de94a39c2ef588c7e6455cfbe7343d3b2dc9d6b6b2f40c4c6565744c873d/pyyaml-6.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:ebc55a14a21cb14062aa4162f906cd962b28e2e9ea38f9b4391244cd8de4ae0b", size = 149341, upload-time = "2025-09-25T21:32:56.828Z" }, ] +[[package]] +name = "regex" +version = "2026.5.9" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/dc/0e/49aee608ad09480e7fd276898c99ec6192985fa331abe4eb3a986094490b/regex-2026.5.9.tar.gz", hash = "sha256:a8234aa23ec39894bfe4a3f1b85616a7032481964a13ac6fc9f10de4f6fca270", size = 416074, upload-time = "2026-05-09T23:15:19.37Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/50/9b/6550044bc44e17c84d312c031c2ec42fbdb6a4ec4e29093be3a172d08772/regex-2026.5.9-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:57eeeb05db7979413dec5438f2db21d7ecbba787cde7a711df1a6f6df672aa06", size = 490451, upload-time = "2026-05-09T23:12:34.72Z" }, + { url = "https://files.pythonhosted.org/packages/1e/95/fc7ba4303b5a0f92446a12ee6778ef2c6c799233f5060042a31bf390cfe9/regex-2026.5.9-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:398c521292f4c7fb807001dcd54694d3a1fcafc179a36ad9cc56f98df85930b6", size = 292112, upload-time = "2026-05-09T23:12:36.285Z" }, + { url = "https://files.pythonhosted.org/packages/54/4b/ee27938d1b2c443e89a9a10e00d2d19aa5ee300cd3d61140644e93bb083e/regex-2026.5.9-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f7a7c26137296beba7784de6eba69c6a93a63ccebc385e4962fe67e267a91225", size = 289599, upload-time = "2026-05-09T23:12:38.089Z" }, + { url = "https://files.pythonhosted.org/packages/d8/dd/ba103dc19614e25f3880800ca67ce093d6e21b325d72b8383c7bf906e9fa/regex-2026.5.9-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6441cc660d76107934a09c22167200839a0e89604a6297f78a974e66e931d2c0", size = 796732, upload-time = "2026-05-09T23:12:40.062Z" }, + { url = "https://files.pythonhosted.org/packages/cf/e7/f035b4fd858b050b0080bf302968dc0f59ba34e391872d54936758e6844e/regex-2026.5.9-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:91328f1c23d47595ca3ef0a7557fa129c5a23404b775c770697d2f35b33e0107", size = 865440, upload-time = "2026-05-09T23:12:42.059Z" }, + { url = "https://files.pythonhosted.org/packages/0a/51/8cd301ecc899aea28124357f729f4272f44de7806fc7ca02490bfbe253e8/regex-2026.5.9-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:93a7860539414dddaefba2b40f8771765ae17949d4c7182b876ce429e11a8309", size = 912329, upload-time = "2026-05-09T23:12:44.373Z" }, + { url = "https://files.pythonhosted.org/packages/cc/1e/3fbe2fa1e8cebd62f3bb7d3321cff1640aca2e240b51d9bd624aad949260/regex-2026.5.9-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:dd2810d22146b6d838acc5ec15602cb6b47920aa4e33015df3868eedfd20bab8", size = 801239, upload-time = "2026-05-09T23:12:46.268Z" }, + { url = "https://files.pythonhosted.org/packages/17/2f/6f6008682bf2cf98040a0d3153a8e557b6ab728d7713d045cee4ce544ab8/regex-2026.5.9-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:daff2bdbaf1d23e52fdff7c0b7bc2048b68f978df6a4d107ac981f94caef2e66", size = 777054, upload-time = "2026-05-09T23:12:48.051Z" }, + { url = "https://files.pythonhosted.org/packages/19/2b/eee0d20a6842ba04df4b8847a920b57ef56853f14ef85405473e586b605a/regex-2026.5.9-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:4eeb011098fcb77af513dcef521a3dbecbf8849b1e38940759d293b7a93f5026", size = 785098, upload-time = "2026-05-09T23:12:49.851Z" }, + { url = "https://files.pythonhosted.org/packages/4a/98/6fc1e6410feefb92159edaed5041992bfe390e8d26c721865434acbca558/regex-2026.5.9-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:ea9c8ecfa1b73c73b626534d6626e5340d429630943672b8480724f44e84b962", size = 860095, upload-time = "2026-05-09T23:12:51.666Z" }, + { url = "https://files.pythonhosted.org/packages/18/a3/bd855e0f2cb1a978ecf6fa6bb69632dd9c3f6ea3b81cde62fde14c9daec7/regex-2026.5.9-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:cd2846168eb9ee3c513902bc8225409cb1caab31d04728b145171fa1625d9621", size = 765762, upload-time = "2026-05-09T23:12:53.413Z" }, + { url = "https://files.pythonhosted.org/packages/dc/66/0ae8c092e60b14c79d24f8e0b7f0aea5bfbffdcab00b5483d13404d3c3a5/regex-2026.5.9-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:39617fb0cde9c0e6306dc70e3bfc096f3da793219879f7ae7aa341a69fbdcf6d", size = 852100, upload-time = "2026-05-09T23:12:55.256Z" }, + { url = "https://files.pythonhosted.org/packages/21/de/8dfde60fc1b21c946a893ba273403b72617edb261370cb1087099a83f088/regex-2026.5.9-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:fd03c4f0e33280d15cae17159b899245d6b7c53d21def19b263b39655061f5ce", size = 789479, upload-time = "2026-05-09T23:12:57.573Z" }, + { url = "https://files.pythonhosted.org/packages/c3/1c/bdcc98f9a4af4fdd166c74941174619ccff4726d3ce32faa8e9a2ecd38dd/regex-2026.5.9-cp312-cp312-win32.whl", hash = "sha256:164eba9b755ea6f244b0d881196fbc1fac09714e9782c9e2732b813142033c8e", size = 266699, upload-time = "2026-05-09T23:12:59.14Z" }, + { url = "https://files.pythonhosted.org/packages/78/87/240d36864f9e48ace85f72e79ced97ceb7f27ce87739a947dcb834b4e6bc/regex-2026.5.9-cp312-cp312-win_amd64.whl", hash = "sha256:86f40a5d6444db30a125c9c9177e6b25dad981cbc37451fd838f145e6edac92e", size = 277783, upload-time = "2026-05-09T23:13:00.789Z" }, + { url = "https://files.pythonhosted.org/packages/4f/b5/7b30f312b0669dff5beebe5b0989dc2d1a312b1a44fab852199c387a5b96/regex-2026.5.9-cp312-cp312-win_arm64.whl", hash = "sha256:96f5f58b54a063d7ea9dca08e1cf57bfe10499c4d579ee672da284f57f5f0070", size = 270513, upload-time = "2026-05-09T23:13:02.426Z" }, + { url = "https://files.pythonhosted.org/packages/aa/da/797e91ecec6f84135da778ddce78c20e0af5d2a15c26f87a81bc3eadb6db/regex-2026.5.9-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:d626b84406444b165fc0ba981604edea39f0588ff1f92baa23fe50799ea9afdb", size = 490303, upload-time = "2026-05-09T23:13:04.382Z" }, + { url = "https://files.pythonhosted.org/packages/44/da/bf30abaaa737b58f4a4b8c4a03659e02fd92092c822e0197ed9e0daab917/regex-2026.5.9-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:d7bdc0ab8f3dd7e1b4f9ab88634e13374669db86bb3c72e8292f07ae313f539f", size = 292019, upload-time = "2026-05-09T23:13:06.022Z" }, + { url = "https://files.pythonhosted.org/packages/2d/e7/d0eaf5713828417b9e5648cf81fa9bacd4961f6ab98c380c2034f8716e35/regex-2026.5.9-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:a8820737949116ffff55fe18f9fc644530063ba6ebfcb8314239416e78f1347c", size = 289468, upload-time = "2026-05-09T23:13:08.214Z" }, + { url = "https://files.pythonhosted.org/packages/d3/9b/b3fdd62b003baa1a9b593cd8c8699c9651c2e80cc21a5c715707983c42d7/regex-2026.5.9-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:aa0fbdbac82cb3e4450d0ccde7d7a35607f4cb2dd9fba4b8b69bfaf8c9fa6aed", size = 796749, upload-time = "2026-05-09T23:13:10.573Z" }, + { url = "https://files.pythonhosted.org/packages/d4/30/66ab84588765f5b4b271a9ca09ef7ce2b87caa95176ec3d2ad65d7bc4902/regex-2026.5.9-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:57e8915c7986aa33d25e4d3629cef711cd2863f2961b10409f0c04cb8b7d9020", size = 865445, upload-time = "2026-05-09T23:13:12.523Z" }, + { url = "https://files.pythonhosted.org/packages/1a/89/f05169e8588aac365f35ffc7f3bc3184f095ef4cfded7cfaa3c7fd5dbd89/regex-2026.5.9-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:508f56a89ba9cb26e4168cbc37dbd60a28d82430a9e18ad1d25fe0883c314ca2", size = 912322, upload-time = "2026-05-09T23:13:14.281Z" }, + { url = "https://files.pythonhosted.org/packages/30/e1/c93444052cf41581f3c884ab3fb5823daf0992f11cd4388d4275ca610558/regex-2026.5.9-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b6d189041f15691cfa2b6c4290448ec221244d225b3f5fe9e7771b34ffcdf6e2", size = 801269, upload-time = "2026-05-09T23:13:16.569Z" }, + { url = "https://files.pythonhosted.org/packages/50/fe/0cf96b882f540e62e8b9956599798203d599c44cf4c77917ca27400ff69b/regex-2026.5.9-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:e82db382b44d0111b22601c509c89f64434816c9e0eef9d1989cda8cc6ff1c04", size = 777085, upload-time = "2026-05-09T23:13:18.675Z" }, + { url = "https://files.pythonhosted.org/packages/23/5c/d78d4924e7fc875557b9e9b768423925fdfaac5549d06da7810019a9bd26/regex-2026.5.9-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:2acfb48634f64996b57f90f39afa692ff362162722581921fe92239a59960f3c", size = 785153, upload-time = "2026-05-09T23:13:20.525Z" }, + { url = "https://files.pythonhosted.org/packages/bf/e0/5214774090e7b4524dcea3e3c4aa74141d43043f8beb49c1599db1c8b53a/regex-2026.5.9-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:d29eebfc9525db68cad3c97eedd7f754fa265aa5cd0cf4f863b2421e1b48fc9f", size = 860164, upload-time = "2026-05-09T23:13:22.263Z" }, + { url = "https://files.pythonhosted.org/packages/6e/e1/4a57a83350319b1271f0d7a249b8672513ed928b237a741631270de6caea/regex-2026.5.9-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:debb893095e944091c16e641a6e33c1b0f4cb61ab945ec5afbf53ce7068834d8", size = 765731, upload-time = "2026-05-09T23:13:24.277Z" }, + { url = "https://files.pythonhosted.org/packages/12/f4/499e74a20c156fc75836ee04a72a38d1a063978f600937f9760467beb1b0/regex-2026.5.9-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:d659eee77986549c9ea45b861c7567e44d6287c3dc9a4565478853f7b9fe2ff6", size = 852062, upload-time = "2026-05-09T23:13:26.125Z" }, + { url = "https://files.pythonhosted.org/packages/5b/92/7eebc0d0a01e78629695f342ba17e0deaff8fb45e79cc0d7b98287da6e3e/regex-2026.5.9-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:2efa205e6d98b24d1f3ab395c11aa15cdf10935bca283d0285e0499c284fba21", size = 789577, upload-time = "2026-05-09T23:13:27.814Z" }, + { url = "https://files.pythonhosted.org/packages/05/a4/018e71f7d2ad48c1ebe6d3ae0026f9b7cb4802fd15c7cc02fdf724355102/regex-2026.5.9-cp313-cp313-win32.whl", hash = "sha256:f3844f134e834076677dd369976e9f5068679fcb8e50102fdf6b7ac96a3ec127", size = 266691, upload-time = "2026-05-09T23:13:29.549Z" }, + { url = "https://files.pythonhosted.org/packages/e6/1d/861a93719fb9ee7dbfc3761b3797b7a3e112a5d42c6129459d2d741be9b5/regex-2026.5.9-cp313-cp313-win_amd64.whl", hash = "sha256:3527bb4942d2c14552155406cdedd906567456821848aed1cb4933a391bf5eca", size = 277747, upload-time = "2026-05-09T23:13:31.859Z" }, + { url = "https://files.pythonhosted.org/packages/d9/c6/0a2436ae4da1ba76e51cb98943c6838a9a721faa40ebe2dce07694ae34e3/regex-2026.5.9-cp313-cp313-win_arm64.whl", hash = "sha256:56a33f191f17d8c417f99945ebdc1e691d3af9605d86ec68c7e54a57e3e17af6", size = 270500, upload-time = "2026-05-09T23:13:33.525Z" }, + { url = "https://files.pythonhosted.org/packages/e8/e9/d21346f7b60ed58789371358ed66b09d00f832e1bd7c06e55d9da5679882/regex-2026.5.9-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:01f28d868834624c934b8d2e0aa1c8341337e37831f4a012f18a5afcba4cbaf3", size = 494172, upload-time = "2026-05-09T23:13:35.935Z" }, + { url = "https://files.pythonhosted.org/packages/c4/43/fd1177a2032037c681baecdb3422ee4e1424aec4e4f470ef47793d325274/regex-2026.5.9-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:48036f6374aaa79eb3b754ec29c61d1c6b1606749d705a13f8854fa2539671f6", size = 293952, upload-time = "2026-05-09T23:13:38.307Z" }, + { url = "https://files.pythonhosted.org/packages/f2/7d/9fbf919768368d3f8a4f6c692cf2aa61e482b2b81ec6a298ace4cbf02480/regex-2026.5.9-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:b96350aa424e79d4fd6b567b344dcbe2b2d6bfc48dfe7717587e1fa6d43da6ff", size = 292314, upload-time = "2026-05-09T23:13:40.353Z" }, + { url = "https://files.pythonhosted.org/packages/e2/6c/e41bfeecb589716843e7c4df09ba46ff2a42961457afece19059d85caeef/regex-2026.5.9-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8f3af7a4903c5c04a11a196a5aa75cdd7dd3f8508132f9fb3259d9f5908e3b88", size = 811681, upload-time = "2026-05-09T23:13:42.543Z" }, + { url = "https://files.pythonhosted.org/packages/87/83/a5c1c525fba0aa656e88ad0face0b1829788ef4c2fb6b26df58aa1151b84/regex-2026.5.9-cp313-cp313t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:7e87577720152d2caae19fe2baaf1f8d5ca12091e9e229f03915c37d1e4b9178", size = 871135, upload-time = "2026-05-09T23:13:44.326Z" }, + { url = "https://files.pythonhosted.org/packages/18/d4/80882e799e440dd878b0979cbebf8fa4d54624a332c83037c7a701649e3f/regex-2026.5.9-cp313-cp313t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:c8b9b9d294cfea3cd19c718ade7cc93492b2c4991abd9a68d0b3477ae6d8e100", size = 917265, upload-time = "2026-05-09T23:13:47.295Z" }, + { url = "https://files.pythonhosted.org/packages/ae/ff/8db60211e2286e396aad7dc7725356c502bff0901ea05bd6cdc2e1a042b9/regex-2026.5.9-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:728d8bfd28a8845c8b6bc5dc7ce010453d206396786c0765c2740cb65f37791e", size = 816311, upload-time = "2026-05-09T23:13:49.885Z" }, + { url = "https://files.pythonhosted.org/packages/4c/47/742ef579c61730f8d268e5cf1f9ce0e37e2ea041ad0f5644724f2378e463/regex-2026.5.9-cp313-cp313t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:7e30b874d341fac767d7df5a0870540541c2c054b80cfaac116e8d367a8a7ff2", size = 785498, upload-time = "2026-05-09T23:13:52.25Z" }, + { url = "https://files.pythonhosted.org/packages/7f/ab/cb0999802dcb0fb95b1ab005e8d4163d8afdd67efc2cb6b6630ac13f8cb1/regex-2026.5.9-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:fd190e88a895a8901325fad284a3f74ea52b1da8525b76cc811fa9b1edf0ce2b", size = 801348, upload-time = "2026-05-09T23:13:54.127Z" }, + { url = "https://files.pythonhosted.org/packages/7d/62/8ca59a24c55bc34d166eefaf3717bd77772f329fdbf984d86581e0a3571c/regex-2026.5.9-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:8e76e8161ad00694cfce6767d5dea860c6391ac5b83e5c3a39661e696f11fc7e", size = 866493, upload-time = "2026-05-09T23:13:56.067Z" }, + { url = "https://files.pythonhosted.org/packages/8d/3d/30f2ae62cef3278bb5bb821f467277a55fb73f01032cf85997e15e8289a8/regex-2026.5.9-cp313-cp313t-musllinux_1_2_riscv64.whl", hash = "sha256:ddda5340e6c01a293027dd46232fa79eaff1b48058ce7a98f572b6445b088041", size = 772811, upload-time = "2026-05-09T23:13:57.867Z" }, + { url = "https://files.pythonhosted.org/packages/d8/ae/7d2089bcd78ad0c0161bc684339df50032acb438a7bd3305e7ddb1193cec/regex-2026.5.9-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:205109e96b3cf5adf8f4cd62bedde9487feb282b9497a3535451e5a24cd706a0", size = 856584, upload-time = "2026-05-09T23:13:59.679Z" }, + { url = "https://files.pythonhosted.org/packages/a9/29/92ff47f75990131ea4f24ba17819e5a9d141e10819807e09addd73409af6/regex-2026.5.9-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:dfbe4579b9f08036aa7d101d1835437a20783574ac66327e6b29b4018a138081", size = 803453, upload-time = "2026-05-09T23:14:01.978Z" }, + { url = "https://files.pythonhosted.org/packages/04/99/eff29f1037dcab36702c9ee5d6858cf1ce2336ea8ea2987f64245b99ea5e/regex-2026.5.9-cp313-cp313t-win32.whl", hash = "sha256:ed2c9e8068b614c574d8d30e543d617cf5379b0535d46f97ef00e904745a08b5", size = 269951, upload-time = "2026-05-09T23:14:03.661Z" }, + { url = "https://files.pythonhosted.org/packages/0e/9d/8870b8981d27b22cda77bb26a5ac7ebfa9c7d9e0dea195a834a82380e748/regex-2026.5.9-cp313-cp313t-win_amd64.whl", hash = "sha256:b46b0f094dc1d3b90356c85a0bd2c9bafc4a6a190b9d6f8ddd5a033b6e088ed4", size = 281240, upload-time = "2026-05-09T23:14:05.56Z" }, + { url = "https://files.pythonhosted.org/packages/72/b1/3379415e8f135c13ac551353397cc4fe97b4978f3cac73c5fcbcded548b8/regex-2026.5.9-cp313-cp313t-win_arm64.whl", hash = "sha256:872acc074bd29ffc9913ecdfedf6ea77502312ca44a4aa0d3779089c6069d8de", size = 272383, upload-time = "2026-05-09T23:14:07.843Z" }, + { url = "https://files.pythonhosted.org/packages/13/3e/9c3cd292d8808b3645a2ce517e200179b6d0e903f176300bd8b542e14de5/regex-2026.5.9-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:1bd7587a2948b4085195d5a3374eaf4a425dc3e55784c038175355ecf3bbbf8a", size = 490376, upload-time = "2026-05-09T23:14:09.64Z" }, + { url = "https://files.pythonhosted.org/packages/60/70/d43ee8a2ca0a8b68d167f21658b85520ac0574617c7f320367c5047f7556/regex-2026.5.9-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:dea2e88e1cce4522496cce630e11e67b98b7076620bc4336c3f674bc21a375f4", size = 291964, upload-time = "2026-05-09T23:14:11.424Z" }, + { url = "https://files.pythonhosted.org/packages/21/91/9d50b433828d8e74196904e168a43abf1e6e88b2a15d47ed742456720c37/regex-2026.5.9-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:2099f7e7ff7b6aa3192312650a56e91cc091e49d50b04e4f6f8b6e28b3b27f1c", size = 289682, upload-time = "2026-05-09T23:14:13.123Z" }, + { url = "https://files.pythonhosted.org/packages/3e/d2/b835e3cafbb9d977736912436259ff551d60919f7d7b3d37d46659c63564/regex-2026.5.9-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ecd353045824e4477562a2ac718c25799cdaaa41f7aa925a806a8a3e6848a5b9", size = 796996, upload-time = "2026-05-09T23:14:14.923Z" }, + { url = "https://files.pythonhosted.org/packages/2c/a6/9f992d00019166b9de01c546dd4549bc679f2a68df11b877740b0760b7c2/regex-2026.5.9-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:65c8c8c37377794bd5b2f3ebe51919042bf17aec802e23c833d89782ed0c78af", size = 866089, upload-time = "2026-05-09T23:14:17.757Z" }, + { url = "https://files.pythonhosted.org/packages/e0/08/4d32af657e049b19cb62b02e46e38fe1518797bfb2203ee93a510b21b0dc/regex-2026.5.9-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5b73ab8afcf66c622db143d1c6fda4e58e4d537ee4f125229ad47b1ab80f34c0", size = 911530, upload-time = "2026-05-09T23:14:20.353Z" }, + { url = "https://files.pythonhosted.org/packages/d9/27/2af43dd1dc201d1fecefda64a45f4ad0995855b92724f795a777b402ee69/regex-2026.5.9-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0de5cf193997384ed2ca6f1cd4f78055b255d93d82d5a8cd6ba0d11c10b167e4", size = 800643, upload-time = "2026-05-09T23:14:22.265Z" }, + { url = "https://files.pythonhosted.org/packages/a4/dd/23a249047013b5321d4a60c4d2437462086f601b061776a525e5fba2a59f/regex-2026.5.9-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:d641a8c9a61618047796d572a39a79b26167b0411d2c3031937b2fe2d081e2cf", size = 777223, upload-time = "2026-05-09T23:14:24.179Z" }, + { url = "https://files.pythonhosted.org/packages/94/6a/e85ed9538cd19586d0465076a4578a12e093ce776d15f3f8ce92733a8dd6/regex-2026.5.9-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:24b2355ef5cc9aa5b8f07d17704face1c166fdcc2290fa7bd6e6c925655a8346", size = 785760, upload-time = "2026-05-09T23:14:26.065Z" }, + { url = "https://files.pythonhosted.org/packages/2a/c4/f25473209438638e947c55f9156fd8f236f74169229028cc99116380868e/regex-2026.5.9-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:a24852d3c29ad9e47593593d8a247c44ccc3d0548ef12c822d6ed0810affe676", size = 860891, upload-time = "2026-05-09T23:14:28.17Z" }, + { url = "https://files.pythonhosted.org/packages/f9/f7/f4f86e3c74419c37370e91f150ae0c2ef7d34b2e0e4cdd5da046a02e4022/regex-2026.5.9-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:916714069da19329ef7de197dcbc77bb3104145c7c2c864dbfbe318f46b88b14", size = 765891, upload-time = "2026-05-09T23:14:30.06Z" }, + { url = "https://files.pythonhosted.org/packages/26/70/704d8e13765939146b1cd0ef4e2feb71d7929727d2290f026eed10095955/regex-2026.5.9-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:fa411799ca8da32a8d38d020a88faa5b6f91657d284761352940ecf9f7c3bbdd", size = 851380, upload-time = "2026-05-09T23:14:32.123Z" }, + { url = "https://files.pythonhosted.org/packages/26/29/1a13582a8460038edc38e49f64ceb0dd7c60f5caba77571f4bf6601965d9/regex-2026.5.9-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:1e6da47d679b7010ef27556b6e0f99771b744936db1792a10ceac6547ae1503e", size = 789350, upload-time = "2026-05-09T23:14:34.799Z" }, + { url = "https://files.pythonhosted.org/packages/73/56/3dcafe34fc72e271d62ad9a291801e88a1457bb251c132f15fcc2e5aad1a/regex-2026.5.9-cp314-cp314-win32.whl", hash = "sha256:98bd73080e8756255137e1bd3f3f00295bbc5aa383c0e0f973920e9134d7c4ad", size = 272130, upload-time = "2026-05-09T23:14:36.729Z" }, + { url = "https://files.pythonhosted.org/packages/d0/9c/02eebf0be95efe416c664db7fb8b6b05b7a0b06a7544f2884f2558b0526f/regex-2026.5.9-cp314-cp314-win_amd64.whl", hash = "sha256:ff8d372ac2acdc048d1c19916f27ee61bc5722728458ba6ca5052f2c72d51763", size = 280999, upload-time = "2026-05-09T23:14:39.126Z" }, + { url = "https://files.pythonhosted.org/packages/70/5a/1dd1abee76cb7a846a0bcf42fdc87e5720c3c33c24f3e37814310a513d9f/regex-2026.5.9-cp314-cp314-win_arm64.whl", hash = "sha256:e1d93bf647916292e8edcec150c07ddf3dc50179ccaf770c04a7f9e452155372", size = 273500, upload-time = "2026-05-09T23:14:41.059Z" }, + { url = "https://files.pythonhosted.org/packages/86/c1/c5f619b0057a7965cb78ec559c1d7a45ce8c99a35bea95483d64959a93d9/regex-2026.5.9-cp314-cp314t-macosx_10_13_universal2.whl", hash = "sha256:83d0ee4a57d1c87cb549e195ec300b8f0ec3a82eba66d835e4e2ed8634fe4499", size = 494269, upload-time = "2026-05-09T23:14:42.869Z" }, + { url = "https://files.pythonhosted.org/packages/05/2c/5d01f1aee33de4bbe60c8452945bfc8477ca7c5ae4450f6bfe711036cb36/regex-2026.5.9-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:d3d7eb5c9a7f6df82ed3cfac9beb93882a5cbcb5b8b157b56cb2b3b276574ac1", size = 293954, upload-time = "2026-05-09T23:14:44.822Z" }, + { url = "https://files.pythonhosted.org/packages/7a/fe/e8988b2ae2108c6ef71bd4aa8d87fbe257976dd0810e826cd75f701c68b6/regex-2026.5.9-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:075160bf16658e16d35233300b8453aac25de4cbea808d22348b6979668e924d", size = 292405, upload-time = "2026-05-09T23:14:47.211Z" }, + { url = "https://files.pythonhosted.org/packages/79/34/d2b0937faa7859263f7f0a3c6b103a1296306be6952dc173d0154e9a2f49/regex-2026.5.9-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:45375819235558a4ff1c4971dc32881f022613abdb180128f5cb4768c1765a1c", size = 811855, upload-time = "2026-05-09T23:14:49.21Z" }, + { url = "https://files.pythonhosted.org/packages/80/fe/daf53a47457a8486db66c66c01ceb9c2303eecee3f87197f1e77eb1a736d/regex-2026.5.9-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:ead4b163ac30a29574510cd4b3e2e985ac5290c05fc7095557d6a5f403fc31b5", size = 871189, upload-time = "2026-05-09T23:14:51.555Z" }, + { url = "https://files.pythonhosted.org/packages/1c/75/058fc4470cbfbf57d800aff1a0022b929a3f9fa553ee10a0cdf2070eb31f/regex-2026.5.9-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:8c6e4218fbdfbcd4f6c19efca40930d24a621bf4b48cb76bc6640543bd28ef20", size = 917485, upload-time = "2026-05-09T23:14:53.633Z" }, + { url = "https://files.pythonhosted.org/packages/88/e7/179cfda3a28bc843b5c6cfe7f79f23489c791ed95f151083803660878432/regex-2026.5.9-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6351571c8a42b505eb555c0dc47d740d0fb66977dc142919eea6f4325b7c56a0", size = 816369, upload-time = "2026-05-09T23:14:56.198Z" }, + { url = "https://files.pythonhosted.org/packages/41/90/6f0cc422071688266d344fca8462d787cba0a2c144acb25721f9a61ec265/regex-2026.5.9-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:002205cafd2a9e78c6290c7d1df277bf3277b3b7a30e0b4bb0dac2e2e3f7cb2d", size = 785869, upload-time = "2026-05-09T23:14:58.602Z" }, + { url = "https://files.pythonhosted.org/packages/02/67/a31f1760f09c27b251ef39e9beb541f462cf977381d067faa764c2c0e393/regex-2026.5.9-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:8abd33fef90b2a9efac5557d6033ca82d1195ed3a15fea5af15ba7b463c6a63b", size = 801427, upload-time = "2026-05-09T23:15:00.642Z" }, + { url = "https://files.pythonhosted.org/packages/e3/c4/1a80654597b6bc1e1ea0494824c31200e8a956abe290afae9b19a166a148/regex-2026.5.9-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:31037c82eccb44b7ea2e9e221d7c01429430e989a1f4b91ea5a855f6017b509a", size = 866482, upload-time = "2026-05-09T23:15:03.384Z" }, + { url = "https://files.pythonhosted.org/packages/d1/11/960724e06482c08466ff5611e242e86f80062949cdf6b4b9cc317b9dd93d/regex-2026.5.9-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:5604dfd046dc37eca90250fc3be938b076c8059fa772ac0ed6f499b0f0fb0415", size = 773022, upload-time = "2026-05-09T23:15:05.625Z" }, + { url = "https://files.pythonhosted.org/packages/50/a8/a9979c3e7918280e93159ebcab5ef1a65116dd4f3bd6091be0eae4a126e8/regex-2026.5.9-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:0e1b1b4e496afbb24f4a62aba855ee4f88f25578927697b340702e48c9ee6bc2", size = 856642, upload-time = "2026-05-09T23:15:07.966Z" }, + { url = "https://files.pythonhosted.org/packages/fe/d4/a9b732f2f0072c0ab12227483abb24fffcb9f73f8a2b203df0a6d0434735/regex-2026.5.9-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:be3372b9df6ddecff6486d37e19095a7b4973137caf5512407a89f4455361f41", size = 803552, upload-time = "2026-05-09T23:15:10.215Z" }, + { url = "https://files.pythonhosted.org/packages/d5/fe/1b3113817447a1d4155e4ac76d2e072f42c0bcba2f43fa8a0e756ea2cd91/regex-2026.5.9-cp314-cp314t-win32.whl", hash = "sha256:3ddd90103f9e5c471c49c7852ecc1fe27c7e45eb99e977aefe7caa4e779f4f58", size = 275746, upload-time = "2026-05-09T23:15:12.609Z" }, + { url = "https://files.pythonhosted.org/packages/92/73/93d42045302636c91f2e5ef588b65b84b01428f28ec77de256b1dfdfbe5c/regex-2026.5.9-cp314-cp314t-win_amd64.whl", hash = "sha256:ca518ed29c46eecba6010b15f1b9a479314d2de409536e71b6a13aa04e3b8a77", size = 285685, upload-time = "2026-05-09T23:15:15.086Z" }, + { url = "https://files.pythonhosted.org/packages/da/80/35b4c33c804a165a7f55289afda3ea9e3eb6d15800341a2d66455c0f1f30/regex-2026.5.9-cp314-cp314t-win_arm64.whl", hash = "sha256:5e41809d2683fcde7d5a8c87a6567ba1fb1ce0de9f31bff578de00a4b2d76daa", size = 275713, upload-time = "2026-05-09T23:15:16.98Z" }, +] + +[[package]] +name = "rich" +version = "15.0.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "markdown-it-py" }, + { name = "pygments" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/c0/8f/0722ca900cc807c13a6a0c696dacf35430f72e0ec571c4275d2371fca3e9/rich-15.0.0.tar.gz", hash = "sha256:edd07a4824c6b40189fb7ac9bc4c52536e9780fbbfbddf6f1e2502c31b068c36", size = 230680, upload-time = "2026-04-12T08:24:00.75Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/82/3b/64d4899d73f91ba49a8c18a8ff3f0ea8f1c1d75481760df8c68ef5235bf5/rich-15.0.0-py3-none-any.whl", hash = "sha256:33bd4ef74232fb73fe9279a257718407f169c09b78a87ad3d296f548e27de0bb", size = 310654, upload-time = "2026-04-12T08:24:02.83Z" }, +] + +[[package]] +name = "safetensors" +version = "0.8.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/45/06/f955dbbb1859e3bd23c8ac6141af5106e7ad5fedec4a3a6e3d60f94b7001/safetensors-0.8.0.tar.gz", hash = "sha256:fabaf3e0f18a6618d9b36560682562157f77c2b71fcffc7b432be2baed9d753d", size = 325846, upload-time = "2026-06-09T07:52:25.563Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/39/a0/f718cda65b05407d228f97602cf60dca269c979867aa5beb25410de26cd3/safetensors-0.8.0-cp310-abi3-macosx_10_12_x86_64.whl", hash = "sha256:c554f85858e05226d3c2828e32395e677434685d6d94594a41643361c5e837f0", size = 473568, upload-time = "2026-06-09T07:52:18.829Z" }, + { url = "https://files.pythonhosted.org/packages/f5/b1/fa7c600e7dceae12e9606c7578cbc9ff1e1ed55844883ee5c92205e86226/safetensors-0.8.0-cp310-abi3-macosx_11_0_arm64.whl", hash = "sha256:c80201d22cbf405b80647a60ada77bba06c8fba2da2743ba1e89cdcc39a81f25", size = 484562, upload-time = "2026-06-09T07:52:17.518Z" }, + { url = "https://files.pythonhosted.org/packages/09/7d/65a7de0af421317bb36a067241e4235fff194eed60b961ed6d3f59a3fc60/safetensors-0.8.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7a46e5ff292c356d6991e60942ba7f79817682d3a2cef0702136448cb9c4d235", size = 502844, upload-time = "2026-06-09T07:52:07.624Z" }, + { url = "https://files.pythonhosted.org/packages/91/4f/3175c9d75634e0e0dda0082794193521035edd7c70a6f212bf33ca06ddf4/safetensors-0.8.0-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:4124502b78f03534117c848f87a39b8f31e577b15eff423bf8bfb95f2a8c30d0", size = 511823, upload-time = "2026-06-09T07:52:09.565Z" }, + { url = "https://files.pythonhosted.org/packages/20/87/846c289e7aa2299eff406335717cf43ce8777194ece8aad75772e0411615/safetensors-0.8.0-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7bc0a787ba8a35be368ee3574edfa2b1ad389eebd0a72e482ae275490e3f6c98", size = 633461, upload-time = "2026-06-09T07:52:11.128Z" }, + { url = "https://files.pythonhosted.org/packages/76/22/8d64d9df2c45d5ded401df889d0ad90882804ca172d79ec4f0df8f727fe0/safetensors-0.8.0-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:040070828e36dc8e122178bbbd5830ff9e97920affb84cbe0f46442497bed358", size = 545148, upload-time = "2026-06-09T07:52:13.603Z" }, + { url = "https://files.pythonhosted.org/packages/28/50/f203ff3a3ddfe19308efc83c5a3a29ed02bf786732ec35e68bf9162f3365/safetensors-0.8.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fd6f3f93c9a0a7cc2788ee63fb763353d4bd2e89b0751bc78fcf7dda00bea774", size = 516040, upload-time = "2026-06-09T07:52:16.29Z" }, + { url = "https://files.pythonhosted.org/packages/46/fb/cdaed17ceb2948784fd9c36b6fd3e951b608547cea81a48e8ee6f8cfdfcb/safetensors-0.8.0-cp310-abi3-manylinux_2_31_riscv64.whl", hash = "sha256:fcdd41ec4628fee5799f807c73c353629130fbd942aa23d83c623dd6c9d52d78", size = 513832, upload-time = "2026-06-09T07:52:12.37Z" }, + { url = "https://files.pythonhosted.org/packages/0d/49/1e15de264dcc3b77943d2d0c56a95809956883b1c2d6d585c792523f180b/safetensors-0.8.0-cp310-abi3-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8e9f537aa183a38ace122d27303dcd986b26bd2a7591f9181d7f0c396f4677ca", size = 559930, upload-time = "2026-06-09T07:52:14.743Z" }, + { url = "https://files.pythonhosted.org/packages/2a/43/bf38443278eab4b1be1fce2931e2b012ad9cb7df52ada751d0aab8f7659a/safetensors-0.8.0-cp310-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:87eec7ffed2b809f05a398a8becb7d013f19f7837cd15d9748580d6cf30dbaf4", size = 678670, upload-time = "2026-06-09T07:52:20.032Z" }, + { url = "https://files.pythonhosted.org/packages/72/e3/68cd3fa5b48488e84add63e04cb12f3bc28ae4638c06d4508c6e88823d0e/safetensors-0.8.0-cp310-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:4a95ae2b05d7726d751da4ebf626a2ca782b706e101bd894c95bc2450b1cffcc", size = 786679, upload-time = "2026-06-09T07:52:21.322Z" }, + { url = "https://files.pythonhosted.org/packages/29/4b/1c19c509d56e01f4fbb3d0a2e597450f6cc04d1d56cf52defb0a62dfd715/safetensors-0.8.0-cp310-abi3-musllinux_1_2_i686.whl", hash = "sha256:3ae091f16662658bdc019a4ff6cb4c085bb7d725eb5978b183ffd265863b6d2d", size = 765683, upload-time = "2026-06-09T07:52:22.594Z" }, + { url = "https://files.pythonhosted.org/packages/27/43/41c1621732edd934d868a00d1b891584c892a7b62a9aab82ea5a0a5623ee/safetensors-0.8.0-cp310-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:8e080062fcde23be189565e1c3305d16751a218ecf9412c8601e64204eb6f846", size = 722361, upload-time = "2026-06-09T07:52:23.924Z" }, + { url = "https://files.pythonhosted.org/packages/8e/3f/73ccf82579412b4a71c4ca673f10b5f1f888d7cf5af7fe24f27d30307be4/safetensors-0.8.0-cp310-abi3-win32.whl", hash = "sha256:2ddf52eac562eda224f99acfa7889d02968c1fd59a5b011ae7d8137c37e9c02d", size = 342401, upload-time = "2026-06-09T07:52:28.895Z" }, + { url = "https://files.pythonhosted.org/packages/1b/6d/3fba214c1e5e0f69991677ec3bc17023f0421776975e1de0c682dca475e2/safetensors-0.8.0-cp310-abi3-win_amd64.whl", hash = "sha256:096ec1a98435df7beb08853bb5aa9081a84f23d0adc67ed1a0a10550f608373f", size = 355540, upload-time = "2026-06-09T07:52:27.832Z" }, + { url = "https://files.pythonhosted.org/packages/8d/fc/7eedc3510d97878876e32774eebbeb61c43f148a96e915c84229a3e967aa/safetensors-0.8.0-cp310-abi3-win_arm64.whl", hash = "sha256:f7838e5135a406ad3e02efdcb8cf2e5397d368b0154537c4fec682dbc544d452", size = 340500, upload-time = "2026-06-09T07:52:26.745Z" }, +] + +[[package]] +name = "scikit-learn" +version = "1.9.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "joblib" }, + { name = "narwhals" }, + { name = "numpy" }, + { name = "scipy" }, + { name = "threadpoolctl" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/fa/6f/37092bdb25f712817231799fc5674d8e704066a8a70c1d2d40517e18b4ab/scikit_learn-1.9.0.tar.gz", hash = "sha256:8833266989d3a5110178a9fae30783675460724d0e1efb13b14901d2c660c557", size = 7750767, upload-time = "2026-06-02T11:54:32.706Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ac/20/75f915ff375d6249e6550ac740fdbbd66159a068fd3af1400ff62036b07a/scikit_learn-1.9.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:2bd41b0d201bc81575531b96b713d3eb5e5f50fb0b82101ff0f92294fdc236ac", size = 8741122, upload-time = "2026-06-02T11:53:24.08Z" }, + { url = "https://files.pythonhosted.org/packages/cc/d5/2b5148f2279196775e1db2aeb85d14b70ac80e7e32b3b28e7ebeafb0901d/scikit_learn-1.9.0-cp312-cp312-macosx_12_0_arm64.whl", hash = "sha256:5be45aa4a42a68a533913a6ed736cf309de2226411c79ef8d609a5456f1939b1", size = 8261512, upload-time = "2026-06-02T11:53:27.183Z" }, + { url = "https://files.pythonhosted.org/packages/a0/ee/5adbc77656b71f9456a2f5a7a9fdb4bcf9207a6b962889f1c2f9323afa4e/scikit_learn-1.9.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5e50ed4da51974e86e940690e9a3d82e729b62b5a49f7c9bac534d515d39d86f", size = 8837603, upload-time = "2026-06-02T11:53:30.328Z" }, + { url = "https://files.pythonhosted.org/packages/6c/c2/63fdda36c56437eeb44aaf9493c8bcd62ce230ab1598924fc626ffbfa943/scikit_learn-1.9.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:056c92bb67ad4c28463c2f2653d9701449201e7e7a9e94e321be0f71c4fef2b8", size = 9132097, upload-time = "2026-06-02T11:53:33.456Z" }, + { url = "https://files.pythonhosted.org/packages/83/a4/c8e67227c680e2259c8864ae72ff48b06e16a6f51253a22167aa02a8aa4e/scikit_learn-1.9.0-cp312-cp312-win_amd64.whl", hash = "sha256:4306775fad04cc4b472a1b15af1ae9cede1540fbfcc17fbce3767cd8dc7ae283", size = 8211173, upload-time = "2026-06-02T11:53:36.602Z" }, + { url = "https://files.pythonhosted.org/packages/cf/fd/3c0863792e98e67e9184aa4029288a175935eb65443afcd30d4f143450cf/scikit_learn-1.9.0-cp312-cp312-win_arm64.whl", hash = "sha256:26e22435f63bcdcf396b574273f29f13dd531f5ea035801f5be10ba1540a4e60", size = 7867451, upload-time = "2026-06-02T11:53:39.075Z" }, + { url = "https://files.pythonhosted.org/packages/3c/01/cf3310626b6d48d3e9be69a1223f9180360b5e6edb045f50fade723ce494/scikit_learn-1.9.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:80746d63bd4b6eaca54d36fe5feaf4d28bb38dc6f9470f81c7cad7c40155f119", size = 8705188, upload-time = "2026-06-02T11:53:41.964Z" }, + { url = "https://files.pythonhosted.org/packages/3e/04/5acd7ae280c5f93b6ac5ef6cdec14eef4c8d1cd91d85b3292989c94d96b1/scikit_learn-1.9.0-cp313-cp313-macosx_12_0_arm64.whl", hash = "sha256:5b934c45c252844a91d69fda3a34cff5e7307e1db10d77cb10a3980312c74713", size = 8228299, upload-time = "2026-06-02T11:53:44.817Z" }, + { url = "https://files.pythonhosted.org/packages/0c/39/ffe829a5b8ecb40a518724a997794657fdc354ada5e8fe8e64d998c0bac9/scikit_learn-1.9.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:38c3dcb9a1ffb85505ec53d54c7b4aea0cff70050425a7760c2af661ac85df05", size = 8789690, upload-time = "2026-06-02T11:53:47.461Z" }, + { url = "https://files.pythonhosted.org/packages/1f/88/8dab5de10c638c083772a6be83a3d8106ced492f74a928c8693638e5bb50/scikit_learn-1.9.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:da76d09304a4706db7cc1e3ebaa3b6b98a67365cc11d2996c4f1e58ba47df714", size = 9087723, upload-time = "2026-06-02T11:53:50.702Z" }, + { url = "https://files.pythonhosted.org/packages/20/3f/7917ca72464038f6240ec70c29f94862d08a34a74291ae4d4ec5eb8186a0/scikit_learn-1.9.0-cp313-cp313-win_amd64.whl", hash = "sha256:5808d98f15c6bf6d9d96d2348c1997392a5888ce7097e664105f930c4bca1277", size = 8184330, upload-time = "2026-06-02T11:53:53.396Z" }, + { url = "https://files.pythonhosted.org/packages/78/c7/15739eb2f61fda3c54639e9942414e5a19ad8a8d1f5a3266afad7cb7df80/scikit_learn-1.9.0-cp313-cp313-win_arm64.whl", hash = "sha256:d77f54c017633791bc0225a43e2f8d03745fdcfe4880268fcc4df15f505dec2e", size = 7840653, upload-time = "2026-06-02T11:53:56.035Z" }, + { url = "https://files.pythonhosted.org/packages/f4/7d/c9a35cf59b20a86fec24d306f1547b78dec194b08d367ce2a3e4854169d9/scikit_learn-1.9.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:9656acd4e93f74e0b66c8a36c88830a99252dfa900044d36bc2212ae89a47162", size = 8713289, upload-time = "2026-06-02T11:53:58.788Z" }, + { url = "https://files.pythonhosted.org/packages/3c/a7/552a7821597c632b907f7bfe8f36f9f572777af8ef8a48353041cf8e091a/scikit_learn-1.9.0-cp314-cp314-macosx_12_0_arm64.whl", hash = "sha256:24360002ae845e7866522b0a5bbf690802e7bc388cac8663502e78aa98598aa2", size = 8245141, upload-time = "2026-06-02T11:54:01.694Z" }, + { url = "https://files.pythonhosted.org/packages/7d/79/f4a0c4fe9711154cddabf913471153af79056382ddc612cfe5ee0ff4b72e/scikit_learn-1.9.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5162ad10a418c8a282dde04c9aa06965de3e9a65f33c1440c0ae69bb1a09d913", size = 8847671, upload-time = "2026-06-02T11:54:04.448Z" }, + { url = "https://files.pythonhosted.org/packages/f0/af/4d72d9e475ac83719160c662619e4bf7b95c19507cd582e7d0167a3c3dae/scikit_learn-1.9.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1fea2cc5677ab49d6f5bade978c866da44957b712d92e9635e8b4f723013c3cb", size = 9118104, upload-time = "2026-06-02T11:54:07.205Z" }, + { url = "https://files.pythonhosted.org/packages/a2/d5/6a58eea2cb9abbb9b3f2bb8b2cfb3243d1152d69f442d256c7af71304769/scikit_learn-1.9.0-cp314-cp314-win_amd64.whl", hash = "sha256:64fa347efc1c839c487433e40c5144d38c336e8a2b59c81aa8660373945c2673", size = 8290674, upload-time = "2026-06-02T11:54:10.087Z" }, + { url = "https://files.pythonhosted.org/packages/65/5b/d4c879cf358f1187141cf90ced473f087183489090244f50c124a2ee478b/scikit_learn-1.9.0-cp314-cp314-win_arm64.whl", hash = "sha256:1b944b6db288f6b926e3650026ddafb988929de95d11fc2cc5fa117773c9ba42", size = 7978807, upload-time = "2026-06-02T11:54:12.769Z" }, + { url = "https://files.pythonhosted.org/packages/8a/43/bfae3121ec67ae09150d453c442c7c1cc166e9aefe056e6ab3b7728a5cfc/scikit_learn-1.9.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:4ccacf04ca5f4b492158a5f28afe0ace43f81b2571e4b9a66d34848b46128949", size = 9031941, upload-time = "2026-06-02T11:54:15.436Z" }, + { url = "https://files.pythonhosted.org/packages/75/b0/20a4546eb17f3b25d3c66df15810411c14ed5065bcfab50b53c96fb627b2/scikit_learn-1.9.0-cp314-cp314t-macosx_12_0_arm64.whl", hash = "sha256:ee1a8db2c18c08e34c7412d4b10be1cac214cd4ea7dc9715a6a327eb49a37c96", size = 8613528, upload-time = "2026-06-02T11:54:18.842Z" }, + { url = "https://files.pythonhosted.org/packages/18/3c/e440e039bb82cd19004edaaad00acbde0fb9b461083c3ecf37941c557312/scikit_learn-1.9.0-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:147e9329ef0e39f75d4cffa02b2aa48d827832684926cd5210d9a2cb5c57246b", size = 8855050, upload-time = "2026-06-02T11:54:21.699Z" }, + { url = "https://files.pythonhosted.org/packages/43/26/b341b8dab5998da6270a3a42c2152c578501354d36f944b5856757035ef8/scikit_learn-1.9.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5bad8f8b9950321b54c965fdcbac6c6c55e79e16646b49977bcf3668d3870a1a", size = 9097190, upload-time = "2026-06-02T11:54:24.454Z" }, + { url = "https://files.pythonhosted.org/packages/fb/de/b650b4d69b84468cfa2e28a3ff7b8103743029e6446ce1a97fe060ef688c/scikit_learn-1.9.0-cp314-cp314t-win_amd64.whl", hash = "sha256:78fc56eafd4edb9575d2d8950d1dd152061abb573341a1cb7e099fc40f6c6666", size = 8963204, upload-time = "2026-06-02T11:54:27.428Z" }, + { url = "https://files.pythonhosted.org/packages/ee/f3/ff83d76d7418112e5a61326443cdda87be3545dd8d6599c95b2481a4419e/scikit_learn-1.9.0-cp314-cp314t-win_arm64.whl", hash = "sha256:051075bda8b7aab87b1906ab3d4740a1e1224a19d7b3781a576736edc94e76aa", size = 8222661, upload-time = "2026-06-02T11:54:30.192Z" }, +] + +[[package]] +name = "scipy" +version = "1.17.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "numpy" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/7a/97/5a3609c4f8d58b039179648e62dd220f89864f56f7357f5d4f45c29eb2cc/scipy-1.17.1.tar.gz", hash = "sha256:95d8e012d8cb8816c226aef832200b1d45109ed4464303e997c5b13122b297c0", size = 30573822, upload-time = "2026-02-23T00:26:24.851Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/35/48/b992b488d6f299dbe3f11a20b24d3dda3d46f1a635ede1c46b5b17a7b163/scipy-1.17.1-cp312-cp312-macosx_10_14_x86_64.whl", hash = "sha256:35c3a56d2ef83efc372eaec584314bd0ef2e2f0d2adb21c55e6ad5b344c0dcb8", size = 31610954, upload-time = "2026-02-23T00:17:49.855Z" }, + { url = "https://files.pythonhosted.org/packages/b2/02/cf107b01494c19dc100f1d0b7ac3cc08666e96ba2d64db7626066cee895e/scipy-1.17.1-cp312-cp312-macosx_12_0_arm64.whl", hash = "sha256:fcb310ddb270a06114bb64bbe53c94926b943f5b7f0842194d585c65eb4edd76", size = 28172662, upload-time = "2026-02-23T00:18:01.64Z" }, + { url = "https://files.pythonhosted.org/packages/cf/a9/599c28631bad314d219cf9ffd40e985b24d603fc8a2f4ccc5ae8419a535b/scipy-1.17.1-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:cc90d2e9c7e5c7f1a482c9875007c095c3194b1cfedca3c2f3291cdc2bc7c086", size = 20344366, upload-time = "2026-02-23T00:18:12.015Z" }, + { url = "https://files.pythonhosted.org/packages/35/f5/906eda513271c8deb5af284e5ef0206d17a96239af79f9fa0aebfe0e36b4/scipy-1.17.1-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:c80be5ede8f3f8eded4eff73cc99a25c388ce98e555b17d31da05287015ffa5b", size = 22704017, upload-time = "2026-02-23T00:18:21.502Z" }, + { url = "https://files.pythonhosted.org/packages/da/34/16f10e3042d2f1d6b66e0428308ab52224b6a23049cb2f5c1756f713815f/scipy-1.17.1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e19ebea31758fac5893a2ac360fedd00116cbb7628e650842a6691ba7ca28a21", size = 32927842, upload-time = "2026-02-23T00:18:35.367Z" }, + { url = "https://files.pythonhosted.org/packages/01/8e/1e35281b8ab6d5d72ebe9911edcdffa3f36b04ed9d51dec6dd140396e220/scipy-1.17.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:02ae3b274fde71c5e92ac4d54bc06c42d80e399fec704383dcd99b301df37458", size = 35235890, upload-time = "2026-02-23T00:18:49.188Z" }, + { url = "https://files.pythonhosted.org/packages/c5/5c/9d7f4c88bea6e0d5a4f1bc0506a53a00e9fcb198de372bfe4d3652cef482/scipy-1.17.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8a604bae87c6195d8b1045eddece0514d041604b14f2727bbc2b3020172045eb", size = 35003557, upload-time = "2026-02-23T00:18:54.74Z" }, + { url = "https://files.pythonhosted.org/packages/65/94/7698add8f276dbab7a9de9fb6b0e02fc13ee61d51c7c3f85ac28b65e1239/scipy-1.17.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:f590cd684941912d10becc07325a3eeb77886fe981415660d9265c4c418d0bea", size = 37625856, upload-time = "2026-02-23T00:19:00.307Z" }, + { url = "https://files.pythonhosted.org/packages/a2/84/dc08d77fbf3d87d3ee27f6a0c6dcce1de5829a64f2eae85a0ecc1f0daa73/scipy-1.17.1-cp312-cp312-win_amd64.whl", hash = "sha256:41b71f4a3a4cab9d366cd9065b288efc4d4f3c0b37a91a8e0947fb5bd7f31d87", size = 36549682, upload-time = "2026-02-23T00:19:07.67Z" }, + { url = "https://files.pythonhosted.org/packages/bc/98/fe9ae9ffb3b54b62559f52dedaebe204b408db8109a8c66fdd04869e6424/scipy-1.17.1-cp312-cp312-win_arm64.whl", hash = "sha256:f4115102802df98b2b0db3cce5cb9b92572633a1197c77b7553e5203f284a5b3", size = 24547340, upload-time = "2026-02-23T00:19:12.024Z" }, + { url = "https://files.pythonhosted.org/packages/76/27/07ee1b57b65e92645f219b37148a7e7928b82e2b5dbeccecb4dff7c64f0b/scipy-1.17.1-cp313-cp313-macosx_10_14_x86_64.whl", hash = "sha256:5e3c5c011904115f88a39308379c17f91546f77c1667cea98739fe0fccea804c", size = 31590199, upload-time = "2026-02-23T00:19:17.192Z" }, + { url = "https://files.pythonhosted.org/packages/ec/ae/db19f8ab842e9b724bf5dbb7db29302a91f1e55bc4d04b1025d6d605a2c5/scipy-1.17.1-cp313-cp313-macosx_12_0_arm64.whl", hash = "sha256:6fac755ca3d2c3edcb22f479fceaa241704111414831ddd3bc6056e18516892f", size = 28154001, upload-time = "2026-02-23T00:19:22.241Z" }, + { url = "https://files.pythonhosted.org/packages/5b/58/3ce96251560107b381cbd6e8413c483bbb1228a6b919fa8652b0d4090e7f/scipy-1.17.1-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:7ff200bf9d24f2e4d5dc6ee8c3ac64d739d3a89e2326ba68aaf6c4a2b838fd7d", size = 20325719, upload-time = "2026-02-23T00:19:26.329Z" }, + { url = "https://files.pythonhosted.org/packages/b2/83/15087d945e0e4d48ce2377498abf5ad171ae013232ae31d06f336e64c999/scipy-1.17.1-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:4b400bdc6f79fa02a4d86640310dde87a21fba0c979efff5248908c6f15fad1b", size = 22683595, upload-time = "2026-02-23T00:19:30.304Z" }, + { url = "https://files.pythonhosted.org/packages/b4/e0/e58fbde4a1a594c8be8114eb4aac1a55bcd6587047efc18a61eb1f5c0d30/scipy-1.17.1-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2b64ca7d4aee0102a97f3ba22124052b4bd2152522355073580bf4845e2550b6", size = 32896429, upload-time = "2026-02-23T00:19:35.536Z" }, + { url = "https://files.pythonhosted.org/packages/f5/5f/f17563f28ff03c7b6799c50d01d5d856a1d55f2676f537ca8d28c7f627cd/scipy-1.17.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:581b2264fc0aa555f3f435a5944da7504ea3a065d7029ad60e7c3d1ae09c5464", size = 35203952, upload-time = "2026-02-23T00:19:42.259Z" }, + { url = "https://files.pythonhosted.org/packages/8d/a5/9afd17de24f657fdfe4df9a3f1ea049b39aef7c06000c13db1530d81ccca/scipy-1.17.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:beeda3d4ae615106d7094f7e7cef6218392e4465cc95d25f900bebabfded0950", size = 34979063, upload-time = "2026-02-23T00:19:47.547Z" }, + { url = "https://files.pythonhosted.org/packages/8b/13/88b1d2384b424bf7c924f2038c1c409f8d88bb2a8d49d097861dd64a57b2/scipy-1.17.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:6609bc224e9568f65064cfa72edc0f24ee6655b47575954ec6339534b2798369", size = 37598449, upload-time = "2026-02-23T00:19:53.238Z" }, + { url = "https://files.pythonhosted.org/packages/35/e5/d6d0e51fc888f692a35134336866341c08655d92614f492c6860dc45bb2c/scipy-1.17.1-cp313-cp313-win_amd64.whl", hash = "sha256:37425bc9175607b0268f493d79a292c39f9d001a357bebb6b88fdfaff13f6448", size = 36510943, upload-time = "2026-02-23T00:20:50.89Z" }, + { url = "https://files.pythonhosted.org/packages/2a/fd/3be73c564e2a01e690e19cc618811540ba5354c67c8680dce3281123fb79/scipy-1.17.1-cp313-cp313-win_arm64.whl", hash = "sha256:5cf36e801231b6a2059bf354720274b7558746f3b1a4efb43fcf557ccd484a87", size = 24545621, upload-time = "2026-02-23T00:20:55.871Z" }, + { url = "https://files.pythonhosted.org/packages/6f/6b/17787db8b8114933a66f9dcc479a8272e4b4da75fe03b0c282f7b0ade8cd/scipy-1.17.1-cp313-cp313t-macosx_10_14_x86_64.whl", hash = "sha256:d59c30000a16d8edc7e64152e30220bfbd724c9bbb08368c054e24c651314f0a", size = 31936708, upload-time = "2026-02-23T00:19:58.694Z" }, + { url = "https://files.pythonhosted.org/packages/38/2e/524405c2b6392765ab1e2b722a41d5da33dc5c7b7278184a8ad29b6cb206/scipy-1.17.1-cp313-cp313t-macosx_12_0_arm64.whl", hash = "sha256:010f4333c96c9bb1a4516269e33cb5917b08ef2166d5556ca2fd9f082a9e6ea0", size = 28570135, upload-time = "2026-02-23T00:20:03.934Z" }, + { url = "https://files.pythonhosted.org/packages/fd/c3/5bd7199f4ea8556c0c8e39f04ccb014ac37d1468e6cfa6a95c6b3562b76e/scipy-1.17.1-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:2ceb2d3e01c5f1d83c4189737a42d9cb2fc38a6eeed225e7515eef71ad301dce", size = 20741977, upload-time = "2026-02-23T00:20:07.935Z" }, + { url = "https://files.pythonhosted.org/packages/d9/b8/8ccd9b766ad14c78386599708eb745f6b44f08400a5fd0ade7cf89b6fc93/scipy-1.17.1-cp313-cp313t-macosx_14_0_x86_64.whl", hash = "sha256:844e165636711ef41f80b4103ed234181646b98a53c8f05da12ca5ca289134f6", size = 23029601, upload-time = "2026-02-23T00:20:12.161Z" }, + { url = "https://files.pythonhosted.org/packages/6d/a0/3cb6f4d2fb3e17428ad2880333cac878909ad1a89f678527b5328b93c1d4/scipy-1.17.1-cp313-cp313t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:158dd96d2207e21c966063e1635b1063cd7787b627b6f07305315dd73d9c679e", size = 33019667, upload-time = "2026-02-23T00:20:17.208Z" }, + { url = "https://files.pythonhosted.org/packages/f3/c3/2d834a5ac7bf3a0c806ad1508efc02dda3c8c61472a56132d7894c312dea/scipy-1.17.1-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:74cbb80d93260fe2ffa334efa24cb8f2f0f622a9b9febf8b483c0b865bfb3475", size = 35264159, upload-time = "2026-02-23T00:20:23.087Z" }, + { url = "https://files.pythonhosted.org/packages/4d/77/d3ed4becfdbd217c52062fafe35a72388d1bd82c2d0ba5ca19d6fcc93e11/scipy-1.17.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:dbc12c9f3d185f5c737d801da555fb74b3dcfa1a50b66a1a93e09190f41fab50", size = 35102771, upload-time = "2026-02-23T00:20:28.636Z" }, + { url = "https://files.pythonhosted.org/packages/bd/12/d19da97efde68ca1ee5538bb261d5d2c062f0c055575128f11a2730e3ac1/scipy-1.17.1-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:94055a11dfebe37c656e70317e1996dc197e1a15bbcc351bcdd4610e128fe1ca", size = 37665910, upload-time = "2026-02-23T00:20:34.743Z" }, + { url = "https://files.pythonhosted.org/packages/06/1c/1172a88d507a4baaf72c5a09bb6c018fe2ae0ab622e5830b703a46cc9e44/scipy-1.17.1-cp313-cp313t-win_amd64.whl", hash = "sha256:e30bdeaa5deed6bc27b4cc490823cd0347d7dae09119b8803ae576ea0ce52e4c", size = 36562980, upload-time = "2026-02-23T00:20:40.575Z" }, + { url = "https://files.pythonhosted.org/packages/70/b0/eb757336e5a76dfa7911f63252e3b7d1de00935d7705cf772db5b45ec238/scipy-1.17.1-cp313-cp313t-win_arm64.whl", hash = "sha256:a720477885a9d2411f94a93d16f9d89bad0f28ca23c3f8daa521e2dcc3f44d49", size = 24856543, upload-time = "2026-02-23T00:20:45.313Z" }, + { url = "https://files.pythonhosted.org/packages/cf/83/333afb452af6f0fd70414dc04f898647ee1423979ce02efa75c3b0f2c28e/scipy-1.17.1-cp314-cp314-macosx_10_14_x86_64.whl", hash = "sha256:a48a72c77a310327f6a3a920092fa2b8fd03d7deaa60f093038f22d98e096717", size = 31584510, upload-time = "2026-02-23T00:21:01.015Z" }, + { url = "https://files.pythonhosted.org/packages/ed/a6/d05a85fd51daeb2e4ea71d102f15b34fedca8e931af02594193ae4fd25f7/scipy-1.17.1-cp314-cp314-macosx_12_0_arm64.whl", hash = "sha256:45abad819184f07240d8a696117a7aacd39787af9e0b719d00285549ed19a1e9", size = 28170131, upload-time = "2026-02-23T00:21:05.888Z" }, + { url = "https://files.pythonhosted.org/packages/db/7b/8624a203326675d7746a254083a187398090a179335b2e4a20e2ddc46e83/scipy-1.17.1-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:3fd1fcdab3ea951b610dc4cef356d416d5802991e7e32b5254828d342f7b7e0b", size = 20342032, upload-time = "2026-02-23T00:21:09.904Z" }, + { url = "https://files.pythonhosted.org/packages/c9/35/2c342897c00775d688d8ff3987aced3426858fd89d5a0e26e020b660b301/scipy-1.17.1-cp314-cp314-macosx_14_0_x86_64.whl", hash = "sha256:7bdf2da170b67fdf10bca777614b1c7d96ae3ca5794fd9587dce41eb2966e866", size = 22678766, upload-time = "2026-02-23T00:21:14.313Z" }, + { url = "https://files.pythonhosted.org/packages/ef/f2/7cdb8eb308a1a6ae1e19f945913c82c23c0c442a462a46480ce487fdc0ac/scipy-1.17.1-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:adb2642e060a6549c343603a3851ba76ef0b74cc8c079a9a58121c7ec9fe2350", size = 32957007, upload-time = "2026-02-23T00:21:19.663Z" }, + { url = "https://files.pythonhosted.org/packages/0b/2e/7eea398450457ecb54e18e9d10110993fa65561c4f3add5e8eccd2b9cd41/scipy-1.17.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:eee2cfda04c00a857206a4330f0c5e3e56535494e30ca445eb19ec624ae75118", size = 35221333, upload-time = "2026-02-23T00:21:25.278Z" }, + { url = "https://files.pythonhosted.org/packages/d9/77/5b8509d03b77f093a0d52e606d3c4f79e8b06d1d38c441dacb1e26cacf46/scipy-1.17.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:d2650c1fb97e184d12d8ba010493ee7b322864f7d3d00d3f9bb97d9c21de4068", size = 35042066, upload-time = "2026-02-23T00:21:31.358Z" }, + { url = "https://files.pythonhosted.org/packages/f9/df/18f80fb99df40b4070328d5ae5c596f2f00fffb50167e31439e932f29e7d/scipy-1.17.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:08b900519463543aa604a06bec02461558a6e1cef8fdbb8098f77a48a83c8118", size = 37612763, upload-time = "2026-02-23T00:21:37.247Z" }, + { url = "https://files.pythonhosted.org/packages/4b/39/f0e8ea762a764a9dc52aa7dabcfad51a354819de1f0d4652b6a1122424d6/scipy-1.17.1-cp314-cp314-win_amd64.whl", hash = "sha256:3877ac408e14da24a6196de0ddcace62092bfc12a83823e92e49e40747e52c19", size = 37290984, upload-time = "2026-02-23T00:22:35.023Z" }, + { url = "https://files.pythonhosted.org/packages/7c/56/fe201e3b0f93d1a8bcf75d3379affd228a63d7e2d80ab45467a74b494947/scipy-1.17.1-cp314-cp314-win_arm64.whl", hash = "sha256:f8885db0bc2bffa59d5c1b72fad7a6a92d3e80e7257f967dd81abb553a90d293", size = 25192877, upload-time = "2026-02-23T00:22:39.798Z" }, + { url = "https://files.pythonhosted.org/packages/96/ad/f8c414e121f82e02d76f310f16db9899c4fcde36710329502a6b2a3c0392/scipy-1.17.1-cp314-cp314t-macosx_10_14_x86_64.whl", hash = "sha256:1cc682cea2ae55524432f3cdff9e9a3be743d52a7443d0cba9017c23c87ae2f6", size = 31949750, upload-time = "2026-02-23T00:21:42.289Z" }, + { url = "https://files.pythonhosted.org/packages/7c/b0/c741e8865d61b67c81e255f4f0a832846c064e426636cd7de84e74d209be/scipy-1.17.1-cp314-cp314t-macosx_12_0_arm64.whl", hash = "sha256:2040ad4d1795a0ae89bfc7e8429677f365d45aa9fd5e4587cf1ea737f927b4a1", size = 28585858, upload-time = "2026-02-23T00:21:47.706Z" }, + { url = "https://files.pythonhosted.org/packages/ed/1b/3985219c6177866628fa7c2595bfd23f193ceebbe472c98a08824b9466ff/scipy-1.17.1-cp314-cp314t-macosx_14_0_arm64.whl", hash = "sha256:131f5aaea57602008f9822e2115029b55d4b5f7c070287699fe45c661d051e39", size = 20757723, upload-time = "2026-02-23T00:21:52.039Z" }, + { url = "https://files.pythonhosted.org/packages/c0/19/2a04aa25050d656d6f7b9e7b685cc83d6957fb101665bfd9369ca6534563/scipy-1.17.1-cp314-cp314t-macosx_14_0_x86_64.whl", hash = "sha256:9cdc1a2fcfd5c52cfb3045feb399f7b3ce822abdde3a193a6b9a60b3cb5854ca", size = 23043098, upload-time = "2026-02-23T00:21:56.185Z" }, + { url = "https://files.pythonhosted.org/packages/86/f1/3383beb9b5d0dbddd030335bf8a8b32d4317185efe495374f134d8be6cce/scipy-1.17.1-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6e3dcd57ab780c741fde8dc68619de988b966db759a3c3152e8e9142c26295ad", size = 33030397, upload-time = "2026-02-23T00:22:01.404Z" }, + { url = "https://files.pythonhosted.org/packages/41/68/8f21e8a65a5a03f25a79165ec9d2b28c00e66dc80546cf5eb803aeeff35b/scipy-1.17.1-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a9956e4d4f4a301ebf6cde39850333a6b6110799d470dbbb1e25326ac447f52a", size = 35281163, upload-time = "2026-02-23T00:22:07.024Z" }, + { url = "https://files.pythonhosted.org/packages/84/8d/c8a5e19479554007a5632ed7529e665c315ae7492b4f946b0deb39870e39/scipy-1.17.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:a4328d245944d09fd639771de275701ccadf5f781ba0ff092ad141e017eccda4", size = 35116291, upload-time = "2026-02-23T00:22:12.585Z" }, + { url = "https://files.pythonhosted.org/packages/52/52/e57eceff0e342a1f50e274264ed47497b59e6a4e3118808ee58ddda7b74a/scipy-1.17.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:a77cbd07b940d326d39a1d1b37817e2ee4d79cb30e7338f3d0cddffae70fcaa2", size = 37682317, upload-time = "2026-02-23T00:22:18.513Z" }, + { url = "https://files.pythonhosted.org/packages/11/2f/b29eafe4a3fbc3d6de9662b36e028d5f039e72d345e05c250e121a230dd4/scipy-1.17.1-cp314-cp314t-win_amd64.whl", hash = "sha256:eb092099205ef62cd1782b006658db09e2fed75bffcae7cc0d44052d8aa0f484", size = 37345327, upload-time = "2026-02-23T00:22:24.442Z" }, + { url = "https://files.pythonhosted.org/packages/07/39/338d9219c4e87f3e708f18857ecd24d22a0c3094752393319553096b98af/scipy-1.17.1-cp314-cp314t-win_arm64.whl", hash = "sha256:200e1050faffacc162be6a486a984a0497866ec54149a01270adc8a59b7c7d21", size = 25489165, upload-time = "2026-02-23T00:22:29.563Z" }, +] + +[[package]] +name = "sentence-transformers" +version = "5.5.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "huggingface-hub" }, + { name = "numpy" }, + { name = "scikit-learn" }, + { name = "scipy" }, + { name = "torch", version = "2.12.0", source = { registry = "https://download.pytorch.org/whl/cpu" }, marker = "sys_platform == 'darwin'" }, + { name = "torch", version = "2.12.0+cpu", source = { registry = "https://download.pytorch.org/whl/cpu" }, marker = "sys_platform != 'darwin'" }, + { name = "tqdm" }, + { name = "transformers" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/cf/d4/7ef93157485e978c016f49da05363c1e4e7237beb5343b64b5631101f0f1/sentence_transformers-5.5.1.tar.gz", hash = "sha256:02b7740dfc60bdbbcb6061625f5d97a5c1a4e2d3baac5f9391b912bb5eae2290", size = 445161, upload-time = "2026-05-20T07:37:44.465Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/bf/03/ee99a6b030e7a2e056547729f8a4709dd93e13d9c6f07590f74c395c4017/sentence_transformers-5.5.1-py3-none-any.whl", hash = "sha256:4fe11d433badc5282d32f7fc08bc714216b7a5aca426f9df77a45a554756deb7", size = 588887, upload-time = "2026-05-20T07:37:43.004Z" }, +] + [[package]] name = "service" version = "0.1.0" @@ -606,7 +1137,10 @@ dependencies = [ { name = "pytest" }, { name = "python-multipart" }, { name = "pyyaml" }, + { name = "sentence-transformers" }, { name = "sqlalchemy" }, + { name = "torch", version = "2.12.0", source = { registry = "https://download.pytorch.org/whl/cpu" }, marker = "sys_platform == 'darwin'" }, + { name = "torch", version = "2.12.0+cpu", source = { registry = "https://download.pytorch.org/whl/cpu" }, marker = "sys_platform != 'darwin'" }, { name = "uvicorn" }, ] @@ -617,17 +1151,37 @@ requires-dist = [ { name = "elasticsearch", specifier = "~=9.4.0" }, { name = "fastapi", specifier = "~=0.115.0" }, { name = "httpx", specifier = "~=0.27.0" }, - { name = "openai", specifier = ">=2.41.0" }, + { name = "openai", specifier = "~=2.41.0" }, { name = "pydantic", specifier = "~=2.7.1" }, { name = "pydantic-settings", specifier = "~=2.2.1" }, { name = "pyjwt", specifier = "~=2.8.0" }, { name = "pytest", specifier = "~=8.1.0" }, { name = "python-multipart", specifier = "~=0.0.19" }, { name = "pyyaml", specifier = "~=6.0.1" }, + { name = "sentence-transformers", specifier = "~=5.5.1" }, { name = "sqlalchemy", specifier = "~=2.0.0" }, + { name = "torch", index = "https://download.pytorch.org/whl/cpu" }, { name = "uvicorn", specifier = "~=0.29.0" }, ] +[[package]] +name = "setuptools" +version = "81.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/0d/1c/73e719955c59b8e424d015ab450f51c0af856ae46ea2da83eba51cc88de1/setuptools-81.0.0.tar.gz", hash = "sha256:487b53915f52501f0a79ccfd0c02c165ffe06631443a886740b91af4b7a5845a", size = 1198299, upload-time = "2026-02-06T21:10:39.601Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e1/e3/c164c88b2e5ce7b24d667b9bd83589cf4f3520d97cad01534cd3c4f55fdb/setuptools-81.0.0-py3-none-any.whl", hash = "sha256:fdd925d5c5d9f62e4b74b30d6dd7828ce236fd6ed998a08d81de62ce5a6310d6", size = 1062021, upload-time = "2026-02-06T21:10:37.175Z" }, +] + +[[package]] +name = "shellingham" +version = "1.5.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/58/15/8b3609fd3830ef7b27b655beb4b4e9c62313a4e8da8c676e142cc210d58e/shellingham-1.5.4.tar.gz", hash = "sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de", size = 10310, upload-time = "2023-10-24T04:13:40.426Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e0/f9/0595336914c5619e5f28a1fb793285925a8cd4b432c9da0a987836c7f822/shellingham-1.5.4-py2.py3-none-any.whl", hash = "sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686", size = 9755, upload-time = "2023-10-24T04:13:38.866Z" }, +] + [[package]] name = "six" version = "1.17.0" @@ -699,6 +1253,118 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/8b/0c/9d30a4ebeb6db2b25a841afbb80f6ef9a854fc3b41be131d249a977b4959/starlette-0.46.2-py3-none-any.whl", hash = "sha256:595633ce89f8ffa71a015caed34a5b2dc1c0cdb3f0f1fbd1e69339cf2abeec35", size = 72037, upload-time = "2025-04-13T13:56:16.21Z" }, ] +[[package]] +name = "sympy" +version = "1.14.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "mpmath" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/83/d3/803453b36afefb7c2bb238361cd4ae6125a569b4db67cd9e79846ba2d68c/sympy-1.14.0.tar.gz", hash = "sha256:d3d3fe8df1e5a0b42f0e7bdf50541697dbe7d23746e894990c030e2b05e72517", size = 7793921, upload-time = "2025-04-27T18:05:01.611Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a2/09/77d55d46fd61b4a135c444fc97158ef34a095e5681d0a6c10b75bf356191/sympy-1.14.0-py3-none-any.whl", hash = "sha256:e091cc3e99d2141a0ba2847328f5479b05d94a6635cb96148ccb3f34671bd8f5", size = 6299353, upload-time = "2025-04-27T18:04:59.103Z" }, +] + +[[package]] +name = "threadpoolctl" +version = "3.6.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/b7/4d/08c89e34946fce2aec4fbb45c9016efd5f4d7f24af8e5d93296e935631d8/threadpoolctl-3.6.0.tar.gz", hash = "sha256:8ab8b4aa3491d812b623328249fab5302a68d2d71745c8a4c719a2fcaba9f44e", size = 21274, upload-time = "2025-03-13T13:49:23.031Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/32/d5/f9a850d79b0851d1d4ef6456097579a9005b31fea68726a4ae5f2d82ddd9/threadpoolctl-3.6.0-py3-none-any.whl", hash = "sha256:43a0b8fd5a2928500110039e43a5eed8480b918967083ea48dc3ab9f13c4a7fb", size = 18638, upload-time = "2025-03-13T13:49:21.846Z" }, +] + +[[package]] +name = "tokenizers" +version = "0.22.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "huggingface-hub" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/73/6f/f80cfef4a312e1fb34baf7d85c72d4411afde10978d4657f8cdd811d3ccc/tokenizers-0.22.2.tar.gz", hash = "sha256:473b83b915e547aa366d1eee11806deaf419e17be16310ac0a14077f1e28f917", size = 372115, upload-time = "2026-01-05T10:45:15.988Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/92/97/5dbfabf04c7e348e655e907ed27913e03db0923abb5dfdd120d7b25630e1/tokenizers-0.22.2-cp39-abi3-macosx_10_12_x86_64.whl", hash = "sha256:544dd704ae7238755d790de45ba8da072e9af3eea688f698b137915ae959281c", size = 3100275, upload-time = "2026-01-05T10:41:02.158Z" }, + { url = "https://files.pythonhosted.org/packages/2e/47/174dca0502ef88b28f1c9e06b73ce33500eedfac7a7692108aec220464e7/tokenizers-0.22.2-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:1e418a55456beedca4621dbab65a318981467a2b188e982a23e117f115ce5001", size = 2981472, upload-time = "2026-01-05T10:41:00.276Z" }, + { url = "https://files.pythonhosted.org/packages/d6/84/7990e799f1309a8b87af6b948f31edaa12a3ed22d11b352eaf4f4b2e5753/tokenizers-0.22.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2249487018adec45d6e3554c71d46eb39fa8ea67156c640f7513eb26f318cec7", size = 3290736, upload-time = "2026-01-05T10:40:32.165Z" }, + { url = "https://files.pythonhosted.org/packages/78/59/09d0d9ba94dcd5f4f1368d4858d24546b4bdc0231c2354aa31d6199f0399/tokenizers-0.22.2-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:25b85325d0815e86e0bac263506dd114578953b7b53d7de09a6485e4a160a7dd", size = 3168835, upload-time = "2026-01-05T10:40:38.847Z" }, + { url = "https://files.pythonhosted.org/packages/47/50/b3ebb4243e7160bda8d34b731e54dd8ab8b133e50775872e7a434e524c28/tokenizers-0.22.2-cp39-abi3-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bfb88f22a209ff7b40a576d5324bf8286b519d7358663db21d6246fb17eea2d5", size = 3521673, upload-time = "2026-01-05T10:40:56.614Z" }, + { url = "https://files.pythonhosted.org/packages/e0/fa/89f4cb9e08df770b57adb96f8cbb7e22695a4cb6c2bd5f0c4f0ebcf33b66/tokenizers-0.22.2-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1c774b1276f71e1ef716e5486f21e76333464f47bece56bbd554485982a9e03e", size = 3724818, upload-time = "2026-01-05T10:40:44.507Z" }, + { url = "https://files.pythonhosted.org/packages/64/04/ca2363f0bfbe3b3d36e95bf67e56a4c88c8e3362b658e616d1ac185d47f2/tokenizers-0.22.2-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:df6c4265b289083bf710dff49bc51ef252f9d5be33a45ee2bed151114a56207b", size = 3379195, upload-time = "2026-01-05T10:40:51.139Z" }, + { url = "https://files.pythonhosted.org/packages/2e/76/932be4b50ef6ccedf9d3c6639b056a967a86258c6d9200643f01269211ca/tokenizers-0.22.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:369cc9fc8cc10cb24143873a0d95438bb8ee257bb80c71989e3ee290e8d72c67", size = 3274982, upload-time = "2026-01-05T10:40:58.331Z" }, + { url = "https://files.pythonhosted.org/packages/1d/28/5f9f5a4cc211b69e89420980e483831bcc29dade307955cc9dc858a40f01/tokenizers-0.22.2-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:29c30b83d8dcd061078b05ae0cb94d3c710555fbb44861139f9f83dcca3dc3e4", size = 9478245, upload-time = "2026-01-05T10:41:04.053Z" }, + { url = "https://files.pythonhosted.org/packages/6c/fb/66e2da4704d6aadebf8cb39f1d6d1957df667ab24cff2326b77cda0dcb85/tokenizers-0.22.2-cp39-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:37ae80a28c1d3265bb1f22464c856bd23c02a05bb211e56d0c5301a435be6c1a", size = 9560069, upload-time = "2026-01-05T10:45:10.673Z" }, + { url = "https://files.pythonhosted.org/packages/16/04/fed398b05caa87ce9b1a1bb5166645e38196081b225059a6edaff6440fac/tokenizers-0.22.2-cp39-abi3-musllinux_1_2_i686.whl", hash = "sha256:791135ee325f2336f498590eb2f11dc5c295232f288e75c99a36c5dbce63088a", size = 9899263, upload-time = "2026-01-05T10:45:12.559Z" }, + { url = "https://files.pythonhosted.org/packages/05/a1/d62dfe7376beaaf1394917e0f8e93ee5f67fea8fcf4107501db35996586b/tokenizers-0.22.2-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:38337540fbbddff8e999d59970f3c6f35a82de10053206a7562f1ea02d046fa5", size = 10033429, upload-time = "2026-01-05T10:45:14.333Z" }, + { url = "https://files.pythonhosted.org/packages/fd/18/a545c4ea42af3df6effd7d13d250ba77a0a86fb20393143bbb9a92e434d4/tokenizers-0.22.2-cp39-abi3-win32.whl", hash = "sha256:a6bf3f88c554a2b653af81f3204491c818ae2ac6fbc09e76ef4773351292bc92", size = 2502363, upload-time = "2026-01-05T10:45:20.593Z" }, + { url = "https://files.pythonhosted.org/packages/65/71/0670843133a43d43070abeb1949abfdef12a86d490bea9cd9e18e37c5ff7/tokenizers-0.22.2-cp39-abi3-win_amd64.whl", hash = "sha256:c9ea31edff2968b44a88f97d784c2f16dc0729b8b143ed004699ebca91f05c48", size = 2747786, upload-time = "2026-01-05T10:45:18.411Z" }, + { url = "https://files.pythonhosted.org/packages/72/f4/0de46cfa12cdcbcd464cc59fde36912af405696f687e53a091fb432f694c/tokenizers-0.22.2-cp39-abi3-win_arm64.whl", hash = "sha256:9ce725d22864a1e965217204946f830c37876eee3b2ba6fc6255e8e903d5fcbc", size = 2612133, upload-time = "2026-01-05T10:45:17.232Z" }, +] + +[[package]] +name = "torch" +version = "2.12.0" +source = { registry = "https://download.pytorch.org/whl/cpu" } +resolution-markers = [ + "sys_platform == 'darwin'", +] +dependencies = [ + { name = "filelock", marker = "sys_platform == 'darwin'" }, + { name = "fsspec", marker = "sys_platform == 'darwin'" }, + { name = "jinja2", marker = "sys_platform == 'darwin'" }, + { name = "networkx", marker = "sys_platform == 'darwin'" }, + { name = "setuptools", marker = "sys_platform == 'darwin'" }, + { name = "sympy", marker = "sys_platform == 'darwin'" }, + { name = "typing-extensions", marker = "sys_platform == 'darwin'" }, +] +wheels = [ + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:b41339df93d491435e790ff8bcbae1c0ce777175889bfd1281d119862793e6a2", upload-time = "2026-05-12T16:20:12Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:90dd587a5f61bfe1307148b581e2084fc5bc4a06e2b90a20e9a36b81087ff16b", upload-time = "2026-05-12T16:20:17Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:10ee1448a9f304d3b987eb4656f664ba6e4d7b410ca7a5a7c642199777a2cf88", upload-time = "2026-05-12T16:20:21Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:f7dfae4a519197dfa050e98d8e36378a0fb5899625a875c2b54445005a2e404e", upload-time = "2026-05-12T16:20:26Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0-cp314-cp314t-macosx_14_0_arm64.whl", hash = "sha256:b4556715c8572758625d62b6e0ae3b1f76c440221913a6fb5e100f321fb4fb02", upload-time = "2026-05-12T16:20:31Z" }, +] + +[[package]] +name = "torch" +version = "2.12.0+cpu" +source = { registry = "https://download.pytorch.org/whl/cpu" } +resolution-markers = [ + "sys_platform != 'darwin'", +] +dependencies = [ + { name = "filelock", marker = "sys_platform != 'darwin'" }, + { name = "fsspec", marker = "sys_platform != 'darwin'" }, + { name = "jinja2", marker = "sys_platform != 'darwin'" }, + { name = "networkx", marker = "sys_platform != 'darwin'" }, + { name = "setuptools", marker = "sys_platform != 'darwin'" }, + { name = "sympy", marker = "sys_platform != 'darwin'" }, + { name = "typing-extensions", marker = "sys_platform != 'darwin'" }, +] +wheels = [ + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp312-cp312-linux_s390x.whl", hash = "sha256:b9d0e8eed0af9321ffb12b75f4aca371b071254f12cf75875d5a8e7cc8f52b51", upload-time = "2026-05-12T23:16:33Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:ce2ddb880b0813fcc91a737f08fdd973a8115a74c64ccb34e9c09a7964b4d448", upload-time = "2026-05-12T23:16:40Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:5e3dc83725581fa38b7b2e45c58692e30b2a3cde19191af54b675ffcac3840a6", upload-time = "2026-05-12T23:16:48Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp312-cp312-win_amd64.whl", hash = "sha256:70ead47f538417323a230c0e743e5cbb6d91f11bd8339abf8c05c9d02f8409bc", upload-time = "2026-05-12T23:16:56Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp312-cp312-win_arm64.whl", hash = "sha256:5a3b24f429d126a08acafd5cfe8b719409618ad57c49bf4f20df4f8cd32cd682", upload-time = "2026-05-12T23:17:00Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp313-cp313-linux_s390x.whl", hash = "sha256:5e0da19e1c3bfdc9b92638c552579eac678354485d61fc8921b0461fd6c40449", upload-time = "2026-05-12T23:17:05Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp313-cp313-manylinux_2_28_aarch64.whl", hash = "sha256:68b7ddd4db4603a03e106e74c7098c8d8c8943d33c1e5ada009ca4cd885759c3", upload-time = "2026-05-12T23:17:12Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp313-cp313-manylinux_2_28_x86_64.whl", hash = "sha256:ada78018bdfa30d1c766596cd32d910dbf5b03424cd859231b6d2a00533de922", upload-time = "2026-05-12T23:17:20Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp313-cp313-win_amd64.whl", hash = "sha256:59bc266826e683899d49ee0af9829f3eafd0a16e15b5db9dc591c8d955003b66", upload-time = "2026-05-12T23:17:27Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp313-cp313-win_arm64.whl", hash = "sha256:97a5160abf3ca9d59a2cd7b4b4de89d9dfe290d36a1ac720262a55fbcee10b6c", upload-time = "2026-05-12T23:17:31Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp313-cp313t-linux_s390x.whl", hash = "sha256:32b9b7a0974cd6149cb98def0a28a49d92d7c14a384273d5539da9624239e950", upload-time = "2026-05-12T23:17:36Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp313-cp313t-manylinux_2_28_aarch64.whl", hash = "sha256:93ed8dc52c113580daf6124982b3232629045dccc5cd83a8f5ed478f7bac7340", upload-time = "2026-05-12T23:17:43Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp313-cp313t-manylinux_2_28_x86_64.whl", hash = "sha256:6a1c86abd4ed15a0736cf2663ad69642ae5d1288c99e30346070e6241018a0a9", upload-time = "2026-05-12T23:17:54Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp313-cp313t-win_amd64.whl", hash = "sha256:768dce4b7b3353795f667d1cb0dd7dfba06f570cd39539576097335e05bb71fe", upload-time = "2026-05-12T23:18:02Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp314-cp314-linux_s390x.whl", hash = "sha256:ee1f329acfd0c2a1ccaa3393bcaf9857ea58759549bb2d67e271a6eab42382b3", upload-time = "2026-05-12T23:18:08Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp314-cp314-manylinux_2_28_aarch64.whl", hash = "sha256:797c066367792c92eb97cafba7fd0caa8d7455e6078a4ee880630077378dc372", upload-time = "2026-05-12T23:18:15Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp314-cp314-manylinux_2_28_x86_64.whl", hash = "sha256:a8f419ce3f25388d36e67153ec63b3a1b17059c49f5a7759a7e91ac4843660d3", upload-time = "2026-05-12T23:18:22Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp314-cp314-win_amd64.whl", hash = "sha256:1dd196c43e74e7b3b526ff434e7efbdef3f3792a2efbecfc983d7dce501840d2", upload-time = "2026-05-12T23:18:30Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp314-cp314t-linux_s390x.whl", hash = "sha256:d0d2080cb13c94ebc0c884d237e404490743d0f40192c8a180abf3b6b6f334cf", upload-time = "2026-05-12T23:18:35Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp314-cp314t-manylinux_2_28_aarch64.whl", hash = "sha256:f7bc15972acad257723775237cdd120024cca844b8bc64701822fa596bcb7e14", upload-time = "2026-05-12T23:18:42Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp314-cp314t-manylinux_2_28_x86_64.whl", hash = "sha256:4d79f961250d1763487ecbc90af019a80009f9e87cadc5366b3ec4ba5671fea6", upload-time = "2026-05-12T23:18:50Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp314-cp314t-win_amd64.whl", hash = "sha256:46b8f4c41ac36bb5d5b47f5437b3de5541b313275e59c1d2aefd3bef32b0f531", upload-time = "2026-05-12T23:18:58Z" }, +] + [[package]] name = "tqdm" version = "4.67.3" @@ -711,6 +1377,41 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/16/e1/3079a9ff9b8e11b846c6ac5c8b5bfb7ff225eee721825310c91b3b50304f/tqdm-4.67.3-py3-none-any.whl", hash = "sha256:ee1e4c0e59148062281c49d80b25b67771a127c85fc9676d3be5f243206826bf", size = 78374, upload-time = "2026-02-03T17:35:50.982Z" }, ] +[[package]] +name = "transformers" +version = "5.11.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "huggingface-hub" }, + { name = "numpy" }, + { name = "packaging" }, + { name = "pyyaml" }, + { name = "regex" }, + { name = "safetensors" }, + { name = "tokenizers" }, + { name = "tqdm" }, + { name = "typer" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/7d/4a/2ee05f9a06bb2dd34cac951548553738a826762fb7adfa7ce256daeaeac8/transformers-5.11.0.tar.gz", hash = "sha256:1dbecade5b8a09bdf3e9e8fdfc9d312cb9eccf5a201080dc894b373f0f3eb5f4", size = 8874363, upload-time = "2026-06-10T16:31:52.441Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/9b/40/30fdefda9b8aff8d36054dbb37d8e1464cc1130c29623403c3c2147bdee1/transformers-5.11.0-py3-none-any.whl", hash = "sha256:06d0a34eab529955f8e704b530663c7d6bd6f9c7a9e47a05cddb4a44e7b6566b", size = 11094597, upload-time = "2026-06-10T16:31:49.08Z" }, +] + +[[package]] +name = "typer" +version = "0.25.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "annotated-doc" }, + { name = "click" }, + { name = "rich" }, + { name = "shellingham" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/e4/51/9aed62104cea109b820bbd6c14245af756112017d309da813ef107d42e7e/typer-0.25.1.tar.gz", hash = "sha256:9616eb8853a09ffeabab1698952f33c6f29ffdbceb4eaeecf571880e8d7664cc", size = 122276, upload-time = "2026-04-30T19:32:16.964Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/3f/f9/2b3ff4e56e5fa7debfaf9eb135d0da96f3e9a1d5b27222223c7296336e5f/typer-0.25.1-py3-none-any.whl", hash = "sha256:75caa44ed46a03fb2dab8808753ffacdbfea88495e74c85a28c5eefcf5f39c89", size = 58409, upload-time = "2026-04-30T19:32:18.271Z" }, +] + [[package]] name = "typing-extensions" version = "4.15.0" diff --git a/ude_person.http b/ude_person.http index 1b2999ce..e41036ba 100644 --- a/ude_person.http +++ b/ude_person.http @@ -22,6 +22,326 @@ GET https://inse.nes.uni-due.de/elastic/projects_dfg_all/_search Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== Content-Type: application/json +{ + "size": 10, + "from": 0, + "_source": [ + "id", + "link", + "title", + "funding_start", + "funding_end", + "Fachliche Zuordnung" + ], + "query": { + "bool": { + "must": [ + { + "bool": { + "should": [ + { + "bool": { + "must": [ + { + "multi_match": { + "query": "Kurt", + "fields": [ + "Antragsteller", + "Antragstellerin", + "Antragstellerinnen", + "Antragstellerinnen / Antragsteller", + "Beteiligte Person", + "Beteiligte Personen", + "Co-Sprecher", + "Co-Sprecherinnen / Co-Sprecher", + "Ehemalige Antragsteller", + "Ehemalige Antragstellerin", + "Ehemalige Antragstellerinnen", + "Ehemalige Antragstellerinnen / Ehemalige Antragsteller", + "Ehemaliger Antragsteller", + "Gastgeber", + "Gastgeberin", + "Gastgeberinnen", + "Gastgeberinnen / Gastgeber", + "Kooperationspartner", + "Kooperationspartnerin", + "Kooperationspartnerinnen", + "Kooperationspartnerinnen / Kooperationspartner", + "Leiter", + "Leiterin", + "Leiterinnen", + "Leiterinnen / Leiter", + "Mitantragsteller", + "Mitantragstellerin", + "Mitantragstellerinnen", + "Mitantragstellerinnen / Mitantragsteller", + "Mitverantwortlich", + "Mitverantwortlich(e)", + "Mitverantwortliche", + "Sprecher", + "Sprecher (IGK-Partner)", + "Sprecherin", + "Sprecherin (IGK-Partner)", + "Sprecherinnen", + "Sprecherinnen (IGK-Partner) / Sprecher (IGK-Partner)", + "Sprecherinnen / Sprecher", + "Teilprojektleiter", + "Teilprojektleiterin", + "Teilprojektleiterinnen", + "Teilprojektleiterinnen / Teilprojektleiter", + "ausländ. Mitantragstellerin", + "ausländ. Mitantragstellerinnen", + "ausländ. Mitantragstellerinnen / ausländische Mitantragsteller", + "ausländische Mitantragsteller", + "ausländischer Mitantragsteller", + "beteiligte Wissenschaftler", + "beteiligte Wissenschaftlerin", + "beteiligte Wissenschaftlerinnen", + "beteiligte Wissenschaftlerinnen / beteiligte Wissenschaftler", + "beteiligter Wissenschaftler", + "person_creater_name", + "stellvertr. Sprecher", + "stellvertr. Sprecherin", + "stellvertr. Sprecherinnen / stellvertr. Sprecher" + ] + } + }, + { + "multi_match": { + "query": "Rothermel", + "fields": [ + "Antragsteller", + "Antragstellerin", + "Antragstellerinnen", + "Antragstellerinnen / Antragsteller", + "Beteiligte Person", + "Beteiligte Personen", + "Co-Sprecher", + "Co-Sprecherinnen / Co-Sprecher", + "Ehemalige Antragsteller", + "Ehemalige Antragstellerin", + "Ehemalige Antragstellerinnen", + "Ehemalige Antragstellerinnen / Ehemalige Antragsteller", + "Ehemaliger Antragsteller", + "Gastgeber", + "Gastgeberin", + "Gastgeberinnen", + "Gastgeberinnen / Gastgeber", + "Kooperationspartner", + "Kooperationspartnerin", + "Kooperationspartnerinnen", + "Kooperationspartnerinnen / Kooperationspartner", + "Leiter", + "Leiterin", + "Leiterinnen", + "Leiterinnen / Leiter", + "Mitantragsteller", + "Mitantragstellerin", + "Mitantragstellerinnen", + "Mitantragstellerinnen / Mitantragsteller", + "Mitverantwortlich", + "Mitverantwortlich(e)", + "Mitverantwortliche", + "Sprecher", + "Sprecher (IGK-Partner)", + "Sprecherin", + "Sprecherin (IGK-Partner)", + "Sprecherinnen", + "Sprecherinnen (IGK-Partner) / Sprecher (IGK-Partner)", + "Sprecherinnen / Sprecher", + "Teilprojektleiter", + "Teilprojektleiterin", + "Teilprojektleiterinnen", + "Teilprojektleiterinnen / Teilprojektleiter", + "ausländ. Mitantragstellerin", + "ausländ. Mitantragstellerinnen", + "ausländ. Mitantragstellerinnen / ausländische Mitantragsteller", + "ausländische Mitantragsteller", + "ausländischer Mitantragsteller", + "beteiligte Wissenschaftler", + "beteiligte Wissenschaftlerin", + "beteiligte Wissenschaftlerinnen", + "beteiligte Wissenschaftlerinnen / beteiligte Wissenschaftler", + "beteiligter Wissenschaftler", + "person_creater_name", + "stellvertr. Sprecher", + "stellvertr. Sprecherin", + "stellvertr. Sprecherinnen / stellvertr. Sprecher" + ] + } + } + ] + } + } + ], + "minimum_should_match": 1 + } + } + ], + "filter": [ + { + "script": { + "script": { + "lang": "painless", + "source": "def fields = ['Antragsteller.keyword', 'Antragstellerin.keyword', 'Antragstellerinnen.keyword', 'Antragstellerinnen / Antragsteller.keyword', 'Beteiligte Person.keyword', 'Beteiligte Personen.keyword', 'Co-Sprecher.keyword', 'Co-Sprecherinnen / Co-Sprecher.keyword', 'Ehemalige Antragsteller.keyword', 'Ehemalige Antragstellerin.keyword', 'Ehemalige Antragstellerinnen.keyword', 'Ehemalige Antragstellerinnen / Ehemalige Antragsteller.keyword', 'Ehemaliger Antragsteller.keyword', 'Gastgeber.keyword', 'Gastgeberin.keyword', 'Gastgeberinnen.keyword', 'Gastgeberinnen / Gastgeber.keyword', 'Kooperationspartner.keyword', 'Kooperationspartnerin.keyword', 'Kooperationspartnerinnen.keyword', 'Kooperationspartnerinnen / Kooperationspartner.keyword', 'Leiter.keyword', 'Leiterin.keyword', 'Leiterinnen.keyword', 'Leiterinnen / Leiter.keyword', 'Mitantragsteller.keyword', 'Mitantragstellerin.keyword', 'Mitantragstellerinnen.keyword', 'Mitantragstellerinnen / Mitantragsteller.keyword', 'Mitverantwortlich.keyword', 'Mitverantwortlich(e).keyword', 'Mitverantwortliche.keyword', 'Sprecher.keyword', 'Sprecher (IGK-Partner).keyword', 'Sprecherin.keyword', 'Sprecherin (IGK-Partner).keyword', 'Sprecherinnen.keyword', 'Sprecherinnen (IGK-Partner) / Sprecher (IGK-Partner).keyword', 'Sprecherinnen / Sprecher.keyword', 'Teilprojektleiter.keyword', 'Teilprojektleiterin.keyword', 'Teilprojektleiterinnen.keyword', 'Teilprojektleiterinnen / Teilprojektleiter.keyword', 'ausländ. Mitantragstellerin.keyword', 'ausländ. Mitantragstellerinnen.keyword', 'ausländ. Mitantragstellerinnen / ausländische Mitantragsteller.keyword', 'ausländische Mitantragsteller.keyword', 'ausländischer Mitantragsteller.keyword', 'beteiligte Wissenschaftler.keyword', 'beteiligte Wissenschaftlerin.keyword', 'beteiligte Wissenschaftlerinnen.keyword', 'beteiligte Wissenschaftlerinnen / beteiligte Wissenschaftler.keyword', 'beteiligter Wissenschaftler.keyword', 'person_creater_name.keyword', 'stellvertr. Sprecher.keyword', 'stellvertr. Sprecherin.keyword', 'stellvertr. Sprecherinnen / stellvertr. Sprecher.keyword']; for (field in fields) { if (doc.containsKey(field) && !doc[field].empty) { for (value in doc[field]) { if (value.contains(';')) { def splitValues = value.splitOnToken(';'); for (singlePersonRaw in splitValues) { def singlePerson = singlePersonRaw.toLowerCase(); if ((singlePerson.contains('kurt') && singlePerson.contains('rothermel'))) { return true; } } } else { def singlePerson = value.toLowerCase(); if ((singlePerson.contains('kurt') && singlePerson.contains('rothermel'))) { return true; } } } } } return false;" + } + } + } + ] + } + }, + "script_fields": { + "all_found_names": { + "script": { + "lang": "painless", + "source": "def names = new HashSet(); def fields = ['Antragsteller.keyword', 'Antragstellerin.keyword', 'Antragstellerinnen.keyword', 'Antragstellerinnen / Antragsteller.keyword', 'Beteiligte Person.keyword', 'Beteiligte Personen.keyword', 'Co-Sprecher.keyword', 'Co-Sprecherinnen / Co-Sprecher.keyword', 'Ehemalige Antragsteller.keyword', 'Ehemalige Antragstellerin.keyword', 'Ehemalige Antragstellerinnen.keyword', 'Ehemalige Antragstellerinnen / Ehemalige Antragsteller.keyword', 'Ehemaliger Antragsteller.keyword', 'Gastgeber.keyword', 'Gastgeberin.keyword', 'Gastgeberinnen.keyword', 'Gastgeberinnen / Gastgeber.keyword', 'Kooperationspartner.keyword', 'Kooperationspartnerin.keyword', 'Kooperationspartnerinnen.keyword', 'Kooperationspartnerinnen / Kooperationspartner.keyword', 'Leiter.keyword', 'Leiterin.keyword', 'Leiterinnen.keyword', 'Leiterinnen / Leiter.keyword', 'Mitantragsteller.keyword', 'Mitantragstellerin.keyword', 'Mitantragstellerinnen.keyword', 'Mitantragstellerinnen / Mitantragsteller.keyword', 'Mitverantwortlich.keyword', 'Mitverantwortlich(e).keyword', 'Mitverantwortliche.keyword', 'Sprecher.keyword', 'Sprecher (IGK-Partner).keyword', 'Sprecherin.keyword', 'Sprecherin (IGK-Partner).keyword', 'Sprecherinnen.keyword', 'Sprecherinnen (IGK-Partner) / Sprecher (IGK-Partner).keyword', 'Sprecherinnen / Sprecher.keyword', 'Teilprojektleiter.keyword', 'Teilprojektleiterin.keyword', 'Teilprojektleiterinnen.keyword', 'Teilprojektleiterinnen / Teilprojektleiter.keyword', 'ausländ. Mitantragstellerin.keyword', 'ausländ. Mitantragstellerinnen.keyword', 'ausländ. Mitantragstellerinnen / ausländische Mitantragsteller.keyword', 'ausländische Mitantragsteller.keyword', 'ausländischer Mitantragsteller.keyword', 'beteiligte Wissenschaftler.keyword', 'beteiligte Wissenschaftlerin.keyword', 'beteiligte Wissenschaftlerinnen.keyword', 'beteiligte Wissenschaftlerinnen / beteiligte Wissenschaftler.keyword', 'beteiligter Wissenschaftler.keyword', 'person_creater_name.keyword', 'stellvertr. Sprecher.keyword', 'stellvertr. Sprecherin.keyword', 'stellvertr. Sprecherinnen / stellvertr. Sprecher.keyword']; for (field in fields) { if (doc.containsKey(field) && !doc[field].empty) { for (value in doc[field]) { if (value.contains(';')) { def splitNames = value.splitOnToken(';'); for (sn in splitNames) { names.add(sn.trim()); } } else { names.add(value.trim()); } } } } return new ArrayList(names);" + } + } + }, + "sort": [{ "id.keyword": { "order": "asc" } }] +} + + + + + + +### +GET https://inse.nes.uni-due.de/elastic/projects_dfg_all/_search +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +{ + "_source": [ + "id", + "link", + "title", + "funding_start", + "funding_end", + "Fachliche Zuordnung" + ], + "query": { + "bool": { + "must": [ + { + "bool": { + "minimum_should_match": 1, + "should": [ + { + "bool": { + "must": [ + { "multi_match": { "query": "Marcus", "fields": ["Antragsteller", "Beteiligte Person"] } }, + { "multi_match": { "query": "Roth", "fields": ["Antragsteller", "Beteiligte Person"] } } + ] + } + } + ] + } + } + ], + "filter": [ + { + "script": { + "script": { + "lang": "painless", + "source": "def felder = ['Antragsteller.keyword', 'Antragstellerin.keyword', 'Beteiligte Person.keyword', 'person_creater_name.keyword']; for (feld in felder) { if (doc.containsKey(feld) && !doc[feld].empty) { for (wert in doc[feld]) { def nameImFeld = wert.toLowerCase(); if (nameImFeld.contains('marcus') && (nameImFeld.contains('roth'))) { return true; } } } } return false;" + } + } + } + ] + } + }, + "script_fields": { + "alle_gefundenen_namen": { + "script": { + "lang": "painless", + "source": "def namen = new HashSet(); def felder = ['Antragsteller.keyword', 'Antragstellerin.keyword', 'Beteiligte Person.keyword', 'person_creater_name.keyword']; for (feld in felder) { if (doc.containsKey(feld) && !doc[feld].empty) { for (wert in doc[feld]) { namen.add(wert); } } } return new ArrayList(namen);" + } + } + } +} + +# { +# "query": { +# "bool": { +# "minimum_should_match": 1, +# "should": [ +# { +# "multi_match": { +# "query": "Marcus Roth", +# "type": "cross_fields", +# "operator": "and", +# "fields": [ +# "Antragsteller", +# "Antragstellerin", +# "Antragstellerinnen", +# "Antragstellerinnen / Antragsteller", +# "Beteiligte Person", +# "Beteiligte Personen", +# "Co-Sprecher", +# "Co-Sprecherinnen / Co-Sprecher", +# "Ehemalige Antragsteller", +# "Ehemalige Antragstellerin", +# "Ehemalige Antragstellerinnen", +# "Ehemalige Antragstellerinnen / Ehemalige Antragsteller", +# "Ehemaliger Antragsteller", +# "Gastgeber", +# "Gastgeberin", +# "Gastgeberinnen", +# "Gastgeberinnen / Gastgeber", +# "Kooperationspartner", +# "Kooperationspartnerin", +# "Kooperationspartnerinnen", +# "Kooperationspartnerinnen / Kooperationspartner", +# "Leiter", +# "Leiterin", +# "Leiterinnen", +# "Leiterinnen / Leiter", +# "Mitantragsteller", +# "Mitantragstellerin", +# "Mitantragstellerinnen", +# "Mitantragstellerinnen / Mitantragsteller", +# "Mitverantwortlich", +# "Mitverantwortlich(e)", +# "Mitverantwortliche", +# "Sprecher", +# "Sprecher (IGK-Partner)", +# "Sprecherin", +# "Sprecherin (IGK-Partner)", +# "Sprecherinnen", +# "Sprecherinnen (IGK-Partner) / Sprecher (IGK-Partner)", +# "Sprecherinnen / Sprecher", +# "Teilprojektleiter", +# "Teilprojektleiterin", +# "Teilprojektleiterinnen", +# "Teilprojektleiterinnen / Teilprojektleiter", +# "ausländ. Mitantragstellerin", +# "ausländ. Mitantragstellerinnen", +# "ausländ. Mitantragstellerinnen / ausländische Mitantragsteller", +# "ausländische Mitantragsteller", +# "ausländischer Mitantragsteller", +# "beteiligte Wissenschaftler", +# "beteiligte Wissenschaftlerin", +# "beteiligte Wissenschaftlerinnen", +# "beteiligte Wissenschaftlerinnen / beteiligte Wissenschaftler", +# "beteiligter Wissenschaftler", +# "person_creater_name", +# "stellvertr. Sprecher", +# "stellvertr. Sprecherin", +# "stellvertr. Sprecherinnen / stellvertr. Sprecher" +# ] +# } +# } +# ] +# } +# } +# } + +### +GET https://inse.nes.uni-due.de/elastic/projects_dfg_all/_search +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + { "size": 100, "query": { @@ -344,6 +664,31 @@ GET https://project.nes.uni-due.de/elastic/openalex-authors/_mapping Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ== Content-Type: application/json +### + +GET https://project.nes.uni-due.de/elastic/openalex-authors/_search +Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ== +Content-Type: application/json + +{ + "_source": ["id", "display_name"], + "query": { + "term": { + "id": { + "value": "https://openalex.org/A5023430147" + } + } + }, + "size": 1 +} + +### + +GET https://project.nes.uni-due.de/elastic/openalex-authors/_search +Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ== +Content-Type: application/json + + ### GET https://project.nes.uni-due.de/elastic/openalex-authors/_search diff --git a/webapp/build.gradle b/webapp/build.gradle index d6f8a0a4..d3f69e7e 100644 --- a/webapp/build.gradle +++ b/webapp/build.gradle @@ -39,7 +39,7 @@ task generateOpenApiClient(type: GenerateTask) { description = "Generates the API client using OpenAPI Generator" generatorName = "typescript-angular" - inputSpec = file("../service/build/openapi/inse-service.openapi.json").path + inputSpec = file("../service/build/openapi/inse-service.openapi.json").toURI().toString() outputDir = file("src/app/api").path } diff --git a/webapp/src/app/api/.openapi-generator/FILES b/webapp/src/app/api/.openapi-generator/FILES index 63db0e7f..707098fd 100644 --- a/webapp/src/app/api/.openapi-generator/FILES +++ b/webapp/src/app/api/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore README.md api.base.service.ts api.module.ts @@ -36,6 +35,7 @@ model/autocompleteResponse.ts model/autocompleteResponseMeta.ts model/autocompleteResponseResultsInner.ts model/award.ts +model/bodyCreateUser.ts model/bundProject.ts model/bundProjectPage.ts model/categoryNested.ts @@ -49,6 +49,8 @@ model/dehydratedAuthor.ts model/dehydratedFunder.ts model/dehydratedInstitution.ts model/dehydratedSource.ts +model/dfgProjectPage.ts +model/dfgProjectSummary.ts model/displayCodeSplittedNested.ts model/euProject.ts model/euProjectPage.ts @@ -93,6 +95,7 @@ model/topicSubfield.ts model/topicsByTime.ts model/topicsByYear.ts model/topicsListResponse.ts +model/user.ts model/validationError.ts model/validationErrorLocInner.ts model/value.ts diff --git a/webapp/src/app/api/api/iNSEAccountService.service.ts b/webapp/src/app/api/api/iNSEAccountService.service.ts index 7b43eaa5..90181dbd 100644 --- a/webapp/src/app/api/api/iNSEAccountService.service.ts +++ b/webapp/src/app/api/api/iNSEAccountService.service.ts @@ -19,9 +19,13 @@ import { Observable } from 'rxjs'; // @ts-ignore import { AccessGrant } from '../model/accessGrant'; // @ts-ignore +import { BodyCreateUser } from '../model/bodyCreateUser'; +// @ts-ignore import { HTTPValidationError } from '../model/hTTPValidationError'; // @ts-ignore import { IdentityGrant } from '../model/identityGrant'; +// @ts-ignore +import { User } from '../model/user'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; @@ -39,6 +43,71 @@ export class INSEAccountServiceService extends BaseService { super(basePath, configuration); } + /** + * Create User + * @endpoint post /inse-account/create + * @param bodyCreateUser + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUser(bodyCreateUser: BodyCreateUser, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public createUser(bodyCreateUser: BodyCreateUser, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createUser(bodyCreateUser: BodyCreateUser, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createUser(bodyCreateUser: BodyCreateUser, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (bodyCreateUser === null || bodyCreateUser === undefined) { + throw new Error('Required parameter bodyCreateUser was null or undefined when calling createUser.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/inse-account/create`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: bodyCreateUser, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + /** * Get Access Grant * @endpoint post /inse-account/auth/access @@ -48,18 +117,18 @@ export class INSEAccountServiceService extends BaseService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getAccessGrantInseAccountAuthAccessPost(secret: string, account: number, organization: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getAccessGrantInseAccountAuthAccessPost(secret: string, account: number, organization: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAccessGrantInseAccountAuthAccessPost(secret: string, account: number, organization: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAccessGrantInseAccountAuthAccessPost(secret: string, account: number, organization: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public getAccessGrant(secret: string, account: number, organization: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getAccessGrant(secret: string, account: number, organization: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAccessGrant(secret: string, account: number, organization: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAccessGrant(secret: string, account: number, organization: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { if (secret === null || secret === undefined) { - throw new Error('Required parameter secret was null or undefined when calling getAccessGrantInseAccountAuthAccessPost.'); + throw new Error('Required parameter secret was null or undefined when calling getAccessGrant.'); } if (account === null || account === undefined) { - throw new Error('Required parameter account was null or undefined when calling getAccessGrantInseAccountAuthAccessPost.'); + throw new Error('Required parameter account was null or undefined when calling getAccessGrant.'); } if (organization === null || organization === undefined) { - throw new Error('Required parameter organization was null or undefined when calling getAccessGrantInseAccountAuthAccessPost.'); + throw new Error('Required parameter organization was null or undefined when calling getAccessGrant.'); } let localVarHeaders = this.defaultHeaders; @@ -136,15 +205,15 @@ export class INSEAccountServiceService extends BaseService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getIdentityGrantInseAccountAuthIdPost(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getIdentityGrantInseAccountAuthIdPost(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getIdentityGrantInseAccountAuthIdPost(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getIdentityGrantInseAccountAuthIdPost(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public getIdentityGrant(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getIdentityGrant(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getIdentityGrant(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getIdentityGrant(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { if (username === null || username === undefined) { - throw new Error('Required parameter username was null or undefined when calling getIdentityGrantInseAccountAuthIdPost.'); + throw new Error('Required parameter username was null or undefined when calling getIdentityGrant.'); } if (password === null || password === undefined) { - throw new Error('Required parameter password was null or undefined when calling getIdentityGrantInseAccountAuthIdPost.'); + throw new Error('Required parameter password was null or undefined when calling getIdentityGrant.'); } let localVarHeaders = this.defaultHeaders; diff --git a/webapp/src/app/api/api/institutions.service.ts b/webapp/src/app/api/api/institutions.service.ts index 7a956eca..89bf1fd5 100644 --- a/webapp/src/app/api/api/institutions.service.ts +++ b/webapp/src/app/api/api/institutions.service.ts @@ -43,7 +43,7 @@ export class InstitutionsService extends BaseService { /** * Returns institution options for autocomplete inputs. - * @endpoint get /api/institutions/autocomplete + * @endpoint get /api/inse-service/institutions/autocomplete * @param query Institution search text, for example \'Duisburg Essen\'. * @param countryCode Optional ISO country code filter. * @param type Optional institution type filter. @@ -94,7 +94,7 @@ export class InstitutionsService extends BaseService { } } - let localVarPath = `/api/institutions/autocomplete`; + let localVarPath = `/api/inse-service/institutions/autocomplete`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request('get', `${basePath}${localVarPath}`, { @@ -113,7 +113,7 @@ export class InstitutionsService extends BaseService { /** * Returns a single institution by ID. * Returns a single institution by its OpenAlex ID. - * @endpoint get /api/institutions/{id} + * @endpoint get /api/inse-service/institutions/{id} * @param id * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -151,7 +151,7 @@ export class InstitutionsService extends BaseService { } } - let localVarPath = `/api/institutions/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + let localVarPath = `/api/inse-service/institutions/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request('get', `${basePath}${localVarPath}`, { @@ -168,7 +168,7 @@ export class InstitutionsService extends BaseService { /** * Returns a list of OpenAlex institutions. - * @endpoint get /api/institutions + * @endpoint get /api/inse-service/institutions * @param search Full-text search, for example \'Duisburg Essen\'. * @param filter OpenAlex filter, for example \'country_code:DE,type:education\'. * @param sort Sort field, for example \'works_count:desc\'. @@ -231,7 +231,7 @@ export class InstitutionsService extends BaseService { } } - let localVarPath = `/api/institutions`; + let localVarPath = `/api/inse-service/institutions`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request('get', `${basePath}${localVarPath}`, { diff --git a/webapp/src/app/api/api/projects.service.ts b/webapp/src/app/api/api/projects.service.ts index c399094a..ef64863e 100644 --- a/webapp/src/app/api/api/projects.service.ts +++ b/webapp/src/app/api/api/projects.service.ts @@ -16,11 +16,11 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -// @ts-ignore -import { BundProject } from '../model/bundProject'; // @ts-ignore import { BundProjectPage } from '../model/bundProjectPage'; // @ts-ignore +import { DfgProjectPage } from '../model/dfgProjectPage'; +// @ts-ignore import { EuProjectPage } from '../model/euProjectPage'; // @ts-ignore import { HTTPValidationError } from '../model/hTTPValidationError'; @@ -41,66 +41,10 @@ export class ProjectsService extends BaseService { super(basePath, configuration); } - /** - * Get a bund project by its project ID. - * Returns a bund project based on its project ID. - * @endpoint get /api/projects/bund/{bund_project_id} - * @param bundProjectId The ID of the bund project to retrieve. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getBundProjectById(bundProjectId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getBundProjectById(bundProjectId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getBundProjectById(bundProjectId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getBundProjectById(bundProjectId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (bundProjectId === null || bundProjectId === undefined) { - throw new Error('Required parameter bundProjectId was null or undefined when calling getBundProjectById.'); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/projects/bund/${this.configuration.encodeParam({name: "bundProjectId", value: bundProjectId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - /** * Get bund projects. * Returns a page of bund projects based on the provided pagination parameters and optional institution filter. - * @endpoint get /api/projects/bund/search + * @endpoint get /api/projects/institution/bund/search * @param institutionId The institution ID to filter by. * @param topic The topic to filter by. * @param page The page number. @@ -157,7 +101,7 @@ export class ProjectsService extends BaseService { } } - let localVarPath = `/api/projects/bund/search`; + let localVarPath = `/api/projects/institution/bund/search`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request('get', `${basePath}${localVarPath}`, { @@ -173,10 +117,86 @@ export class ProjectsService extends BaseService { ); } + /** + * Get DFG projects. + * Returns a page of DFG projects based on the provided pagination parameters and optional institution filter. + * @endpoint get /api/projects/person/dfg/search + * @param authorId The author ID to filter by. + * @param topic The topic to filter by. + * @param page The page number. + * @param size The page size. + * @param sortBy The field to sort by. + * @param sortDirection The sort direction (asc or desc). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDfgProjects(authorId: string, topic?: string, page?: number, size?: number, sortBy?: string, sortDirection?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getDfgProjects(authorId: string, topic?: string, page?: number, size?: number, sortBy?: string, sortDirection?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDfgProjects(authorId: string, topic?: string, page?: number, size?: number, sortBy?: string, sortDirection?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDfgProjects(authorId: string, topic?: string, page?: number, size?: number, sortBy?: string, sortDirection?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (authorId === null || authorId === undefined) { + throw new Error('Required parameter authorId was null or undefined when calling getDfgProjects.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + authorId, 'author_id'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + topic, 'topic'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + size, 'size'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sortBy, 'sort_by'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sortDirection, 'sort_direction'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/projects/person/dfg/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + /** * Get EU projects. * Returns a page of EU projects based on the provided pagination parameters and optional institution filter. - * @endpoint get /api/projects/eu/search + * @endpoint get /api/projects/institution/eu/search * @param institutionId The institution ID to filter by. * @param topic The topic to filter by. * @param page The page number. @@ -233,7 +253,7 @@ export class ProjectsService extends BaseService { } } - let localVarPath = `/api/projects/eu/search`; + let localVarPath = `/api/projects/institution/eu/search`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request('get', `${basePath}${localVarPath}`, { diff --git a/webapp/src/app/api/api/topics.service.ts b/webapp/src/app/api/api/topics.service.ts index 2667546d..4c2902a1 100644 --- a/webapp/src/app/api/api/topics.service.ts +++ b/webapp/src/app/api/api/topics.service.ts @@ -367,4 +367,67 @@ export class TopicsService extends BaseService { ); } + /** + * Semantic / vector search for topics using a keyword/sentence. + * @endpoint get /api/topics/vector-search + * @param query Word or sentence to search by similarity. + * @param limit Maximum number of topics to return. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public vectorSearchTopics(query: string, limit?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public vectorSearchTopics(query: string, limit?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public vectorSearchTopics(query: string, limit?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public vectorSearchTopics(query: string, limit?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (query === null || query === undefined) { + throw new Error('Required parameter query was null or undefined when calling vectorSearchTopics.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + query, 'query'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + limit, 'limit'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/topics/vector-search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + } diff --git a/webapp/src/app/api/model/authAccount.ts b/webapp/src/app/api/model/authAccount.ts index 0c76d8dc..770a61f5 100644 --- a/webapp/src/app/api/model/authAccount.ts +++ b/webapp/src/app/api/model/authAccount.ts @@ -13,5 +13,7 @@ export interface AuthAccount { i: number; l: string; o: number; + e: string; + on: string; } diff --git a/webapp/src/app/api/model/bodyCreateUser.ts b/webapp/src/app/api/model/bodyCreateUser.ts new file mode 100644 index 00000000..76caab3b --- /dev/null +++ b/webapp/src/app/api/model/bodyCreateUser.ts @@ -0,0 +1,19 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface BodyCreateUser { + username: string; + password: string; + email: string; + institution: string; + superadmin?: boolean; +} + diff --git a/webapp/src/app/api/model/bundProjectPage.ts b/webapp/src/app/api/model/bundProjectPage.ts index fc378141..10514bce 100644 --- a/webapp/src/app/api/model/bundProjectPage.ts +++ b/webapp/src/app/api/model/bundProjectPage.ts @@ -11,10 +11,6 @@ import { BundProject } from './bundProject'; export interface BundProjectPage { - /** - * The bund projects on this page. - */ - elements?: Array; /** * The current page number. */ @@ -24,8 +20,12 @@ export interface BundProjectPage { */ size?: number; /** - * The total number of bund projects. + * The total number of items. */ total?: number; + /** + * The bund projects on this page. + */ + elements?: Array; } diff --git a/webapp/src/app/api/model/collaborationNetworkNodeType.ts b/webapp/src/app/api/model/collaborationNetworkNodeType.ts index 752e35b0..1b3c0d84 100644 --- a/webapp/src/app/api/model/collaborationNetworkNodeType.ts +++ b/webapp/src/app/api/model/collaborationNetworkNodeType.ts @@ -10,9 +10,9 @@ export const CollaborationNetworkNodeType = { - Author: 'author', - Institution: 'institution', - Work: 'work' + author: 'author', + institution: 'institution', + work: 'work' } as const; export type CollaborationNetworkNodeType = typeof CollaborationNetworkNodeType[keyof typeof CollaborationNetworkNodeType]; diff --git a/webapp/src/app/api/model/dfgProjectPage.ts b/webapp/src/app/api/model/dfgProjectPage.ts new file mode 100644 index 00000000..8f67e170 --- /dev/null +++ b/webapp/src/app/api/model/dfgProjectPage.ts @@ -0,0 +1,31 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { DfgProjectSummary } from './dfgProjectSummary'; + + +export interface DfgProjectPage { + /** + * The current page number. + */ + page?: number; + /** + * The requested page size. + */ + size?: number; + /** + * The total number of items. + */ + total?: number; + /** + * The DFG projects on this page. + */ + elements?: Array; +} + diff --git a/webapp/src/app/api/model/dfgProjectSummary.ts b/webapp/src/app/api/model/dfgProjectSummary.ts new file mode 100644 index 00000000..145dba4a --- /dev/null +++ b/webapp/src/app/api/model/dfgProjectSummary.ts @@ -0,0 +1,27 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface DfgProjectSummary { + /** + * The unique identifier of the DFG project. + */ + id: string; + link?: string | null; + title?: string | null; + professional_classification?: string | null; + funding_start?: string | null; + funding_end?: string | null; + /** + * The names of the researchers involved in the DFG project. + */ + names?: Array; +} + diff --git a/webapp/src/app/api/model/euProjectPage.ts b/webapp/src/app/api/model/euProjectPage.ts index 81440c37..e03e1c0f 100644 --- a/webapp/src/app/api/model/euProjectPage.ts +++ b/webapp/src/app/api/model/euProjectPage.ts @@ -11,10 +11,6 @@ import { EuProject } from './euProject'; export interface EuProjectPage { - /** - * The EU projects on this page. - */ - elements?: Array; /** * The current page number. */ @@ -24,8 +20,12 @@ export interface EuProjectPage { */ size?: number; /** - * The total number of EU projects. + * The total number of items. */ total?: number; + /** + * The EU projects on this page. + */ + elements?: Array; } diff --git a/webapp/src/app/api/model/models.ts b/webapp/src/app/api/model/models.ts index 7e188d4c..7b37e6c3 100644 --- a/webapp/src/app/api/model/models.ts +++ b/webapp/src/app/api/model/models.ts @@ -16,6 +16,7 @@ export * from './autocompleteResponse'; export * from './autocompleteResponseMeta'; export * from './autocompleteResponseResultsInner'; export * from './award'; +export * from './bodyCreateUser'; export * from './bundProject'; export * from './bundProjectPage'; export * from './categoryNested'; @@ -29,6 +30,8 @@ export * from './dehydratedAuthor'; export * from './dehydratedFunder'; export * from './dehydratedInstitution'; export * from './dehydratedSource'; +export * from './dfgProjectPage'; +export * from './dfgProjectSummary'; export * from './displayCodeSplittedNested'; export * from './euProject'; export * from './euProjectPage'; @@ -72,6 +75,7 @@ export * from './topicSubfield'; export * from './topicsByTime'; export * from './topicsByYear'; export * from './topicsListResponse'; +export * from './user'; export * from './validationError'; export * from './validationErrorLocInner'; export * from './value'; diff --git a/webapp/src/app/api/model/user.ts b/webapp/src/app/api/model/user.ts new file mode 100644 index 00000000..def604e1 --- /dev/null +++ b/webapp/src/app/api/model/user.ts @@ -0,0 +1,45 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * An entry in the user configuration file. + */ +export interface User { + /** + * The username of the user. + */ + username: string; + /** + * The password of the user. + */ + password: string; + /** + * The email of the user. + */ + email: string; + /** + * The account id of the user. + */ + account: number; + /** + * The organization id of the user. + */ + organization: number; + /** + * The organization name of the user. + */ + organization_name: string; + /** + * Indicates whether the user is a superadmin. + */ + superadmin?: boolean; +} + diff --git a/webapp/src/app/app.config.ts b/webapp/src/app/app.config.ts index 7aaeef9e..fe2175b6 100644 --- a/webapp/src/app/app.config.ts +++ b/webapp/src/app/app.config.ts @@ -1,9 +1,19 @@ -import { ApplicationConfig, LOCALE_ID } from '@angular/core'; -import { provideRouter } from '@angular/router'; +import { ApplicationConfig, inject, LOCALE_ID } from '@angular/core'; +import { + NavigationError, + provideRouter, + Router, + withComponentInputBinding, + withNavigationErrorHandler, +} from '@angular/router'; import { routes } from './app.routes'; import { provideAnimationsAsync } from '@angular/platform-browser/animations/async'; -import { provideHttpClient, withInterceptors } from '@angular/common/http'; +import { + HttpErrorResponse, + provideHttpClient, + withInterceptors, +} from '@angular/common/http'; import locale from '@angular/common/locales/de'; import { registerLocaleData } from '@angular/common'; import { authenticationInterceptor } from './shared/interceptors/authentication.interceptor'; @@ -11,6 +21,7 @@ import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field'; import { MatPaginatorIntl } from '@angular/material/paginator'; import { PaginatorIntl } from './shared/utils/paginatorIntl'; import { provideEchartsCore } from 'ngx-echarts'; +import { ErrorService } from './shared/services/error.service'; registerLocaleData(locale); @@ -22,7 +33,42 @@ export const appConfig: ApplicationConfig = { useValue: { appearance: 'outline' }, }, { provide: MatPaginatorIntl, useClass: PaginatorIntl }, - provideRouter(routes), + provideRouter( + routes, + withComponentInputBinding(), + withNavigationErrorHandler((navigationError: NavigationError) => { + const router = inject(Router); + const errorService = inject(ErrorService); + + if ( + router.url.includes('/error') || + router.currentNavigation()?.extractedUrl.toString().includes('/error') + ) { + console.error( + 'Kritischer Fehler beim Laden der Fehlerseite selbst:', + navigationError, + ); + return; + } + + const error = navigationError.error; + let errorMessage: string = 'Unbekannter Fehler'; + if (error instanceof HttpErrorResponse) { + errorMessage = error.error?.message || 'Unbekannter HTTP-Fehler'; + } + + errorService.setError({ + statusCode: error.status || 500, + title: 'Daten-Fehler', + message: 'Die Daten für diese Ansicht konnten nicht geladen werden.', + errorDetails: errorMessage, + }); + + setTimeout(() => { + router.navigate(['/error'], { replaceUrl: true }); + }); + }), + ), provideHttpClient(withInterceptors([authenticationInterceptor])), // provideApi('/inse-service'), provideAnimationsAsync(), diff --git a/webapp/src/app/app.routes.ts b/webapp/src/app/app.routes.ts index ed9c7421..f6ab27f3 100644 --- a/webapp/src/app/app.routes.ts +++ b/webapp/src/app/app.routes.ts @@ -7,8 +7,13 @@ import { personResolver } from './resolvers/person.resolver'; import { institutionResolver } from './resolvers/institution.resolver'; import { bundProjectsResolver } from './resolvers/bund-projects.resolver'; import { euProjectsResolver } from './resolvers/eu-projects.resolver'; - +import { dfgProjectsResolver } from './resolvers/dfg-projects.resolver'; export const routes: Routes = [ + { + path: '', + pathMatch: 'full', + redirectTo: 'dashboard', + }, { path: 'login', loadComponent: () => @@ -16,6 +21,13 @@ export const routes: Routes = [ (mod) => mod.AppLoginComponent, ), }, + { + path: 'register', + loadComponent: () => + import('./modules/app-register/app-register.component').then( + (mod) => mod.AppRegisterComponent, + ), + }, { path: 'dashboard', canActivate: [userGuard], @@ -96,6 +108,30 @@ export const routes: Routes = [ (mod) => mod.PersonOverviewComponent, ), }, + { + path: 'projects', + loadComponent: () => + import('./modules/person-projects/person-projects.component').then( + (mod) => mod.PersonProjectsComponent, + ), + resolve: { + dfgProjectPage: dfgProjectsResolver, + }, + runGuardsAndResolvers: (from, to) => { + const keys = ['page', 'size', 'sort_by', 'sort_direction', 'search']; + + return keys.some( + (key) => from.queryParamMap.get(key) !== to.queryParamMap.get(key), + ); + }, + }, + { + path: 'publications', + loadComponent: () => + import('./modules/person-publications/person-publications.component').then( + (mod) => mod.PersonPublicationsComponent, + ), + }, { path: 'network', loadComponent: () => @@ -124,13 +160,7 @@ export const routes: Routes = [ ); }, }, - { - path: 'publications', - loadComponent: () => - import('./modules/person-publications/person-publications.component').then( - (mod) => mod.PersonPublicationsComponent, - ), - }, + { path: 'funding', loadComponent: () => @@ -191,8 +221,25 @@ export const routes: Routes = [ ); }, }, + { + path: 'error', + loadComponent: () => + import('./modules/error-page/error-page.component').then( + (mod) => mod.ErrorPageComponent, + ), + }, { path: '**', - redirectTo: 'login', + loadComponent: () => + import('./modules/error-page/error-page.component').then( + (mod) => mod.ErrorPageComponent, + ), + data: { + routeStatusCode: 404, + routeTitle: 'Seite nicht gefunden', + routeMessage: + 'Die gesuchte Seite existiert leider nicht oder wurde verschoben.', + }, + canActivate: [userGuard], }, ]; diff --git a/webapp/src/app/modules/app-login/app-login.component.html b/webapp/src/app/modules/app-login/app-login.component.html index 4ebfd0be..957a6b5f 100644 --- a/webapp/src/app/modules/app-login/app-login.component.html +++ b/webapp/src/app/modules/app-login/app-login.component.html @@ -42,6 +42,12 @@ [disabled]="!loginForm.valid || (credentialService.validating | async)"> Anmelden + +
+ +

@if (credentialService.validating | async) { diff --git a/webapp/src/app/modules/app-login/app-login.component.scss b/webapp/src/app/modules/app-login/app-login.component.scss index 56b7c05a..034b92ac 100644 --- a/webapp/src/app/modules/app-login/app-login.component.scss +++ b/webapp/src/app/modules/app-login/app-login.component.scss @@ -37,7 +37,7 @@ } .field { - width: 300px; + width: 400px; } .progress { diff --git a/webapp/src/app/modules/app-login/app-login.component.ts b/webapp/src/app/modules/app-login/app-login.component.ts index 17353a00..24fd129f 100644 --- a/webapp/src/app/modules/app-login/app-login.component.ts +++ b/webapp/src/app/modules/app-login/app-login.component.ts @@ -13,7 +13,7 @@ import { MatIconModule } from '@angular/material/icon'; import { CommonModule } from '@angular/common'; import { Subscription } from 'rxjs'; import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar'; -import { Router } from '@angular/router'; +import { Router, RouterLink } from '@angular/router'; @Component({ selector: 'app-app-login', @@ -25,6 +25,7 @@ import { Router } from '@angular/router'; MatButtonModule, MatIconModule, MatSnackBarModule, + RouterLink, ], templateUrl: './app-login.component.html', styleUrl: './app-login.component.scss', diff --git a/webapp/src/app/modules/app-register/app-register.component.html b/webapp/src/app/modules/app-register/app-register.component.html new file mode 100644 index 00000000..018be1bf --- /dev/null +++ b/webapp/src/app/modules/app-register/app-register.component.html @@ -0,0 +1,97 @@ +

+
+

Konto erstellen

+

+ Bitte gib Deine Daten ein, um Dich zu registrieren. +

+ + + Benutzername + + @if (registerForm.controls['username'].hasError('required')) { + Fehler: Benutzername erforderlich. + } @else if (registerForm.controls['username'].hasError('minlength')) { + Fehler: Benutzername ist unvollständig. + } + + + + E-Mail + + @if (registerForm.controls['email'].hasError('required')) { + Fehler: E-Mail erforderlich. + } @else if (registerForm.controls['email'].hasError('email')) { + Fehler: Ungültige E-Mail Adresse. + } + + + + Passwort + + @if (showPassword) { + visibility + } @else { + visibility_off + } + @if (registerForm.controls['password'].hasError('required')) { + Fehler: Passwort erforderlich. + } @else if (registerForm.controls['password'].hasError('minlength')) { + Fehler: Passwort ist unvollständig. + } + + + + Institution + + apartment + + @if (registerForm.controls['institution'].hasError('required')) { + Fehler: Institution erforderlich. + } + + @for (institution of institutionOptions(); track institution.id) { + +
{{ institution.display_name }}
+ @if (institution.hint) { + {{ institution.hint }} + } +
+ } +
+
+ +
+ Superadmin Rechte +
+ + + +
+ +
+
+

+ +

+
\ No newline at end of file diff --git a/webapp/src/app/modules/app-register/app-register.component.scss b/webapp/src/app/modules/app-register/app-register.component.scss new file mode 100644 index 00000000..d1585259 --- /dev/null +++ b/webapp/src/app/modules/app-register/app-register.component.scss @@ -0,0 +1,56 @@ +.container { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + width: 100%; + height: 100%; + background: linear-gradient(160deg, #f4f6fb, #e8ecf7); +} + +.form { + display: flex; + flex-direction: column; + align-items: center; + background: #fff; + border: none; + border-radius: 12px; + box-shadow: + 0 2px 12px #1a3a6e1a, + 0 1px 4px #0000000f; + gap: 20px; + padding: 36px 32px 28px; + + h3 { + margin: 0 0 4px; + font-weight: 600; + color: #1a3a6e; + } +} + +.button { + min-height: 48px; + min-width: 140px; + border-radius: 8px; + font-weight: 500; + letter-spacing: 0.02em; +} + +.field { + width: 400px; +} + +.checkbox-container { + display: flex; + align-items: center; + justify-content: flex-start; +} + +.progress { + padding-top: 5px; + width: 300px; + height: 2em; + text-align: center; + font-size: small; + color: #585f71; +} diff --git a/webapp/src/app/modules/app-register/app-register.component.ts b/webapp/src/app/modules/app-register/app-register.component.ts new file mode 100644 index 00000000..70b2f073 --- /dev/null +++ b/webapp/src/app/modules/app-register/app-register.component.ts @@ -0,0 +1,150 @@ +import { Component, inject, OnDestroy, signal, DestroyRef, OnInit } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; +import { Router, RouterLink } from '@angular/router'; +import { + FormBuilder, + FormGroup, + ReactiveFormsModule, + Validators, +} from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { MatIconModule } from '@angular/material/icon'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { CredentialService } from '../../shared/services/credential.service'; +import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar'; +import { Subscription, map, switchMap, debounceTime, distinctUntilChanged, catchError,of} from 'rxjs'; +import { MatAutocompleteModule, MatAutocompleteSelectedEvent } from '@angular/material/autocomplete'; +import { InstitutionsService } from '../../api'; +@Component({ + selector: 'app-register', + standalone: true, + imports: [ + CommonModule, + ReactiveFormsModule, + MatButtonModule, + MatFormFieldModule, + MatInputModule, + MatIconModule, + MatCheckboxModule, + RouterLink, + MatSnackBarModule, + MatAutocompleteModule, + ], + templateUrl: './app-register.component.html', + styleUrl: './app-register.component.scss', +}) +export class AppRegisterComponent implements OnDestroy, OnInit { + private readonly fb = inject(FormBuilder); + protected readonly credentialService = inject(CredentialService); + private readonly router = inject(Router); + private readonly snackBar = inject(MatSnackBar); + private readonly destroyRef = inject(DestroyRef); + private subscription?: Subscription; + private institutionsService = inject(InstitutionsService) + registerForm: FormGroup = this.fb.group({ + username: ['', [Validators.required, Validators.minLength(4)]], + email: ['', [Validators.required, Validators.email]], + password: ['', [Validators.required, Validators.minLength(8)]], + institution: ['', [Validators.required]], + superadmin: [false], + }); + readonly institutionOptions = signal([]); + showPassword = false; + + constructor() { + this.setupInstitutionAutocomplete(); + } + ngOnInit(): void { + this.subscription = this.credentialService.validating.subscribe( + (validating) => { + if (validating) { + this.registerForm.disable(); + } else { + this.registerForm.enable(); + this.checkEnter(); + } + }, + ); + if (!this.credentialService.validating) { + this.checkEnter(); + } + } + ngOnDestroy(): void { + this.subscription?.unsubscribe(); + } + + checkEnter(): void { + if (this.credentialService.authenticated.value) { + this.router.navigate(['/dashboard']); + } + } + submit() { + if (this.registerForm.valid) { + this.credentialService.validating.next(true); + this.registerForm.disable(); + + this.subscription = this.credentialService + .registerAccount(this.registerForm.value) + .subscribe({ + next: () => { + this.credentialService.validating.next(false); + this.snackBar.open( + 'Konto erfolgreich erstellt! Du kannst Dich jetzt anmelden.', + 'OK', + { duration: 5000 }, + ); + this.router.navigate(['/login']); + }, + error: (err) => { + this.credentialService.validating.next(false); + this.registerForm.enable(); + const message = + err.error?.message || + 'Fehler bei der Registrierung. Bitte versuche es später erneut.'; + this.snackBar.open(message, 'Schließen', { + panelClass: ['error-snackbar'], + duration: 5000, + }); + }, + }); + } + } + + private setupInstitutionAutocomplete(): void { + this.registerForm.controls['institution'].valueChanges + .pipe( + debounceTime(250), + map((value) => (typeof value === 'string' ? value.trim() : '')), + distinctUntilChanged(), + switchMap((query) => { + if (query.length < 2) { + this.institutionOptions.set([]); + return of([]); + } + + return this.searchInstitutions(query).pipe( + catchError((ev) => {console.log(ev);return of([])}), + ); + }), + takeUntilDestroyed(this.destroyRef), + ) + .subscribe((options) => { + this.institutionOptions.set(options); + }); + } + + private searchInstitutions(query: string) { + return this.institutionsService + .autocompleteInstitutions(query, undefined, undefined, 10) + .pipe(map((response) => response.results ?? [])); + } + + onInstitutionSelected(event: MatAutocompleteSelectedEvent): void { + const val = event.option.value; + this.registerForm.controls['institution'].setValue(val, { emitEvent: false }); + this.institutionOptions.set([]); + } +} diff --git a/webapp/src/app/modules/error-page/error-page.component.html b/webapp/src/app/modules/error-page/error-page.component.html new file mode 100644 index 00000000..126ea4fb --- /dev/null +++ b/webapp/src/app/modules/error-page/error-page.component.html @@ -0,0 +1,37 @@ +
+ + +
+ warning +
+ + Fehler {{ statusCode() }} +

{{ title() }}

+

{{ message() }}

+ + + + @if (errorDetails()) { + + + + ERWEITERTE DIAGNOSE + + + +
{{ errorDetails() }}
+
+ } +
+
+
diff --git a/webapp/src/app/modules/error-page/error-page.component.scss b/webapp/src/app/modules/error-page/error-page.component.scss new file mode 100644 index 00000000..b7c2bee1 --- /dev/null +++ b/webapp/src/app/modules/error-page/error-page.component.scss @@ -0,0 +1,87 @@ +.error-container { + min-height: 90vh; + background-color: none !important; + display: flex; + align-items: center; + justify-content: center; + padding: 1.5rem; + box-sizing: border-box; +} + +.error-card { + max-width: 450px; + width: 100%; + box-shadow: + 0 4px 6px -1px rgb(0 0 0 / 0.05), + 0 2px 4px -2px rgb(0 0 0 / 0.05) !important; +} + +.error-content { + display: flex; + flex-direction: column; + align-items: center; + text-align: center; +} + +.error-icon { + height: 36px !important; + width: 36px !important; + font-size: 36px !important; +} + +.status-code { + font-size: 0.75rem; + font-weight: 600; + letter-spacing: 0.05em; + color: #94a3b8; + text-transform: uppercase; +} + +.error-title { + margin: 0.5rem 0 1rem 0; + font-size: 1.75rem; + font-weight: 700; + color: #1e293b; + letter-spacing: -0.025em; + line-height: 1.2; +} + +.error-message { + margin: 0 0 2rem 0; + font-size: 1rem; + color: #475569; + line-height: 1.6; +} + +.back-button { + margin-bottom: 1rem; + display: flex; + align-items: center; + gap: 0.5rem; +} + +.diagnostics-panel { + width: 100%; + background: transparent !important; +} + +.diagnostics-title { + font-size: 0.75rem !important; + font-weight: 600; + color: #94a3b8; + letter-spacing: 0.05em; +} + +.diagnostics-code { + margin-top: 0.5rem; + padding: 1rem; + background-color: #0f172a; + border-radius: 8px; + font-size: 0.75rem; + color: #34d399; + overflow-x: auto; + font-family: monospace; + text-align: left; + white-space: pre-wrap; + max-height: 160px; +} diff --git a/webapp/src/app/modules/error-page/error-page.component.ts b/webapp/src/app/modules/error-page/error-page.component.ts new file mode 100644 index 00000000..26acf5ee --- /dev/null +++ b/webapp/src/app/modules/error-page/error-page.component.ts @@ -0,0 +1,58 @@ +import { Location } from '@angular/common'; +import { Component, input, OnInit, signal, inject } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCardModule } from '@angular/material/card'; +import { MatExpansionModule } from '@angular/material/expansion'; +import { MatIconModule } from '@angular/material/icon'; +import { ErrorService } from '../../shared/services/error.service'; + +@Component({ + selector: 'app-error-page', + standalone: true, + imports: [MatButtonModule, MatCardModule, MatIconModule, MatExpansionModule], + templateUrl: './error-page.component.html', + styleUrl: './error-page.component.scss', +}) +export class ErrorPageComponent implements OnInit { + routeStatusCode = input(500); + routeTitle = input('Da ist was schiefgelaufen'); + routeMessage = input( + 'Ein unerwarteter Fehler ist aufgetreten. Bitte versuchen Sie es später erneut.', + ); + routeErrorDetails = input(undefined); + + statusCode = signal(500); + title = signal(''); + message = signal(''); + errorDetails = signal(undefined); + + isDetailsOpen = signal(false); + + private readonly location = inject(Location); + private readonly errorService = inject(ErrorService); + + ngOnInit() { + const savedError = this.errorService.getError(); + + if (savedError) { + this.statusCode.set(savedError.statusCode); + this.title.set(savedError.title); + this.message.set(savedError.message); + this.errorDetails.set(savedError.errorDetails); + this.errorService.clearError(); // Speicher aufräumen + } else { + this.statusCode.set(this.routeStatusCode()); + this.title.set(this.routeTitle()); + this.message.set(this.routeMessage()); + this.errorDetails.set(this.routeErrorDetails()); + } + } + + toggleDetails() { + this.isDetailsOpen.update((isOpen) => !isOpen); + } + + goBack() { + this.location.back(); + } +} diff --git a/webapp/src/app/modules/institution-overview/institution-overview.component.spec.ts b/webapp/src/app/modules/institution-overview/institution-overview.component.spec.ts index 7c34642c..2926265e 100644 --- a/webapp/src/app/modules/institution-overview/institution-overview.component.spec.ts +++ b/webapp/src/app/modules/institution-overview/institution-overview.component.spec.ts @@ -8,9 +8,8 @@ describe('InstitutionOverviewComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [InstitutionOverviewComponent] - }) - .compileComponents(); + imports: [InstitutionOverviewComponent], + }).compileComponents(); fixture = TestBed.createComponent(InstitutionOverviewComponent); component = fixture.componentInstance; diff --git a/webapp/src/app/modules/institution-overview/institution-overview.component.ts b/webapp/src/app/modules/institution-overview/institution-overview.component.ts index fc138784..13b18fa4 100644 --- a/webapp/src/app/modules/institution-overview/institution-overview.component.ts +++ b/webapp/src/app/modules/institution-overview/institution-overview.component.ts @@ -6,6 +6,4 @@ import { Component } from '@angular/core'; templateUrl: './institution-overview.component.html', styleUrl: './institution-overview.component.scss', }) -export class InstitutionOverviewComponent { - -} +export class InstitutionOverviewComponent {} diff --git a/webapp/src/app/modules/institution-projects/institution-projects.component.html b/webapp/src/app/modules/institution-projects/institution-projects.component.html index cf093be4..77736b04 100644 --- a/webapp/src/app/modules/institution-projects/institution-projects.component.html +++ b/webapp/src/app/modules/institution-projects/institution-projects.component.html @@ -18,8 +18,7 @@ > + (selectedTabChange)="selectedTabChange($event)"> >('fundingEndTmp'); grantAmountTmp = viewChild.required>('grantAmountTmp'); - euProjectPage = signal(null); + euProjectPage = input.required(); euProjectColumns: GenericColumn[] = []; euProjectData: EuProjectRow[] = []; - bundProjectPage = signal(null); + bundProjectPage = input.required(); bundProjectColumns: GenericColumn[] = []; bundProjectData: BundProjectRow[] = []; @@ -86,11 +87,6 @@ export class InstitutionProjectsComponent implements OnInit { private readonly activatedRoute: ActivatedRoute, private readonly router: Router, ) { - this.activatedRoute.data.subscribe((data) => { - this.euProjectPage.set(data['euProjectPage']); - this.bundProjectPage.set(data['bundProjectPage']); - }); - this.activatedRoute.queryParams .pipe(takeUntilDestroyed()) .subscribe((params) => { diff --git a/webapp/src/app/modules/institution/institution.component.scss b/webapp/src/app/modules/institution/institution.component.scss index 401a7523..2521fee5 100644 --- a/webapp/src/app/modules/institution/institution.component.scss +++ b/webapp/src/app/modules/institution/institution.component.scss @@ -1,6 +1,6 @@ .content { - padding: 16px; - display: flex; - flex-direction: column; - gap: 16px; -} \ No newline at end of file + padding: 16px; + display: flex; + flex-direction: column; + gap: 16px; +} diff --git a/webapp/src/app/modules/person-funding/person-funding.component.html b/webapp/src/app/modules/person-funding/person-funding.component.html index 8c579e5f..4fa60a0a 100644 --- a/webapp/src/app/modules/person-funding/person-funding.component.html +++ b/webapp/src/app/modules/person-funding/person-funding.component.html @@ -303,17 +303,6 @@ } } @else {
-
-

- {{ getUniquePublicationCount() }} - Einzigartige Publikationen -

-

- {{ filteredFunders.length }} - Förderer -

-
-
@@ -321,23 +310,35 @@
Filter nach Position:
@@ -466,7 +467,44 @@
} @else {
-

Klicke auf einen Förderer für Details.

+
+ @if (activeFilter !== "all") { + + Filter: {{ getPositionLabel(activeFilter) }} + + } +

Förderübersicht

+

+ @if (activeFilter === "all") { + Alle geförderten Publikationen dieser Person im Überblick. + } @else { + Nur Publikationen mit der gewählten Autorenposition. + } +

+
+
+ {{ + getUniquePublicationCount() + }} + Einzigartige Publikationen +
+
+ {{ + filteredFunders.length + }} + Förderer +
+
+
+ +

+ Wähle links einen Förderer aus, um die zugehörigen Publikationen + anzuzeigen. +

+
+
}
diff --git a/webapp/src/app/modules/person-funding/person-funding.component.scss b/webapp/src/app/modules/person-funding/person-funding.component.scss index 949d838c..0d6f7ab9 100644 --- a/webapp/src/app/modules/person-funding/person-funding.component.scss +++ b/webapp/src/app/modules/person-funding/person-funding.component.scss @@ -23,38 +23,42 @@ button { padding: 6px 14px; - border: 1px solid #ccc; + border: 1px solid transparent; border-radius: 20px; - background: white; + background: #fff; cursor: pointer; font-size: 14px; + font-weight: 500; - &:hover { - background: #f0f0f0; + &.active { + font-weight: 600; + border-width: 2px; + padding: 5px 13px; } } + button:nth-child(2) { - background: #f0f6ff; - color: #0b63ce; - border-color: #bdd4ff; + color: #3b82c4; + border-color: #c7dcfa; + &.active { color: #0b4f9e; background: #e8f2ff; border-color: #3b82c4; } } button:nth-child(3) { - background: #effaf3; - color: #24834f; - border-color: #bdebcf; + color: #3d9a66; + border-color: #b8e6cb; + &.active { color: #1a6b3f; background: #e8f7ee; border-color: #3d9a66; } } button:nth-child(4) { - background: #f6f0ff; - color: #7255d9; - border-color: #d8cafe; + color: #7c65d9; + border-color: #d5c8f8; + &.active { color: #5b3fc9; background: #f0ebff; border-color: #7c65d9; } } button:nth-child(5) { - background: #fff7e8; - color: #c67500; - border-color: #ffd796; + color: #d1435f; + border-color: #f8c4ce; + &.active { color: #a61e3a; background: #ffe8ec; border-color: #d1435f; } } } @@ -69,9 +73,7 @@ color: #333; font-size: 14px; - span { - color: #555; - } + span { color: #555; } select { border: 0; @@ -101,9 +103,7 @@ flex-wrap: wrap; } - .sort-control { - margin-left: auto; - } + .sort-control { margin-left: auto; } table { width: 100%; @@ -119,14 +119,7 @@ tr { cursor: pointer; - - &:hover { - background: #f5f5f5; - } - - &.selected { - background: #f0f0f0; - } + &.selected { background: #f0f0f0; } } td { @@ -152,18 +145,22 @@ display: flex; align-items: center; justify-content: center; - color: #999; - min-height: 200px; + min-height: 280px; + padding: 24px; + background: + radial-gradient(circle at 100% 0%, rgba(200, 217, 255, 0.35), transparent 45%), + linear-gradient(160deg, #fff 0%, #f8faff 100%); + border-color: #dbe3f2; } h3 { - margin: 0 0 16px 0; + margin: 0 0 16px; font-size: 16px; color: #333; } h4 { - margin: 16px 0 8px 0; + margin: 16px 0 8px; font-size: 14px; color: #555; } @@ -172,16 +169,13 @@ .position-stats { display: flex; gap: 12px; - margin-bottom: 16px; + margin: 0 auto 16px; width: fit-content; - margin-left: auto; - margin-right: auto; .stat { - flex: 0 auto; min-width: 100px; text-align: center; - background: white; + background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 10px; @@ -200,20 +194,48 @@ color: #333; } } - .stat-first { - background: #effaf3; - border-color: #bdebcf; - } +} - .stat-middle { - background: #f6f0ff; - border-color: #d8cafe; - } +.stat-first, +.position-badge--first, +.hero-highlight--open, +.publication-detail-grid .access-badge--open { + background: #effaf3; +} - .stat-last { - background: #fff7e8; - border-color: #ffd796; - } +.stat-first { border-color: #bdebcf; } + +.position-badge--first { + color: #24834f; + border: 1px solid #bdebcf; +} + +.hero-highlight--open, +.publication-detail-grid .access-badge--open { + border-color: #bdebcf; + color: #24834f; +} + +.stat-middle, +.position-badge--middle { + background: #f6f0ff; + border-color: #d8cafe; +} + +.position-badge--middle { + color: #7255d9; + border: 1px solid #d8cafe; +} + +.stat-last, +.position-badge--last { + background: #fff1f2; + border-color: #fda4af; +} + +.position-badge--last { + color: #be123c; + border: 1px solid #fda4af; } .publication-list { @@ -241,7 +263,7 @@ padding: 4px 10px; border: 1px solid #d0d0d0; border-radius: 6px; - background: white; + background: #fff; cursor: pointer; font-size: 12px; @@ -257,38 +279,109 @@ } } -.funding-summary { - margin-bottom: 16px; +.empty-overview { + width: 100%; + text-align: center; - .summary-line { - margin: 0 0 4px 0; - font-size: 14px; - color: #333; - } - - .summary-label { - color: #333; - } - - .summary-value { + &__filter { + display: inline-block; + margin-bottom: 12px; + padding: 4px 12px; + border: 1px solid #dbe3f2; + border-radius: 999px; + background: rgba(255, 255, 255, 0.9); + color: #475569; + font-size: 0.75rem; font-weight: 600; - color: #333; + text-transform: uppercase; + } + + &__title { + margin: 0 0 8px; + font-size: 1.125rem; + color: #1e3a5f; + } + + &__subtitle { + margin: 0 0 20px; + color: #64748b; + font-size: 0.875rem; + line-height: 1.5; + } + + &__stats { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 12px; + margin-bottom: 20px; + } + + &__stat { + display: flex; + flex-direction: column; + gap: 6px; + padding: 16px 12px; + border: 1px solid #e0e6f0; + border-radius: 10px; + background: rgba(255, 255, 255, 0.85); + } + + &__stat-value { + font-size: 1.75rem; + font-weight: 700; + line-height: 1.1; + color: #1e3a5f; + } + + &__stat-label { + font-size: 0.8rem; + line-height: 1.35; + color: #64748b; + } + + &__hint { + display: flex; + align-items: flex-start; + gap: 10px; + padding: 12px 14px; + border: 1px dashed #c7d5ea; + border-radius: 10px; + background: rgba(255, 255, 255, 0.7); + text-align: left; + + .material-icons { + font-size: 20px; + color: #3b82c4; + } + + p { + margin: 0; + color: #475569; + font-size: 0.875rem; + line-height: 1.45; + } } } -.funding-publication-page { - padding: 16px; -} +.funding-publication-page { padding: 16px; } -.publication-detail-back { +.publication-detail-back, +.publication-more-info { display: inline-flex; align-items: center; - gap: 6px; border: 0; background: transparent; cursor: pointer; } +.publication-detail-back { gap: 6px; } + +.publication-more-info { + gap: 4px; + margin-top: 6px; + padding: 0; +} + .publication-detail-hero { display: flex; justify-content: space-between; @@ -326,7 +419,6 @@ font-size: 0.75rem; font-weight: 700; text-transform: uppercase; - letter-spacing: 0.02em; } } @@ -362,7 +454,6 @@ display: inline-flex; align-items: center; gap: 6px; - flex-shrink: 0; padding: 10px 16px; border: 1px solid #bdd4ff; border-radius: 8px; @@ -371,33 +462,14 @@ font-weight: 600; font-size: 0.875rem; text-decoration: none; - white-space: nowrap; - &:hover { - background: #e3efff; - } - - .material-icons { - font-size: 18px; - } - } -} - -@media (max-width: 720px) { - .publication-detail-hero { - flex-direction: column; - align-items: stretch; - - &__action { - justify-content: center; - } + .material-icons { font-size: 18px; } } } .hero-highlight { display: inline-flex; flex-direction: column; - min-width: 72px; padding: 8px 12px; border: 1px solid #e0e6f0; border-radius: 8px; @@ -414,7 +486,6 @@ font-size: 0.7rem; color: #64748b; text-transform: uppercase; - letter-spacing: 0.03em; } &--badge { @@ -426,12 +497,6 @@ color: #475569; } - &--open { - border-color: #bdebcf; - background: #effaf3; - color: #24834f; - } - &--closed { border-color: #e0e6f0; background: #f8fafc; @@ -447,24 +512,6 @@ font-size: 0.8rem; font-weight: 700; - &--first { - background: #effaf3; - color: #24834f; - border: 1px solid #bdebcf; - } - - &--middle { - background: #f6f0ff; - color: #7255d9; - border: 1px solid #d8cafe; - } - - &--last { - background: #fff7e8; - color: #c67500; - border: 1px solid #ffd796; - } - &--unknown { background: #f1f5f9; color: #64748b; @@ -472,179 +519,123 @@ } } -.publication-detail-grid { +$g: '.publication-detail-grid'; + +#{$g} { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 12px; +} - .publication-detail-main, - .publication-detail-side { - display: grid; - gap: 12px; - min-width: 0; - } +#{$g} .publication-detail-main, +#{$g} .publication-detail-side { + display: grid; + gap: 12px; + min-width: 0; +} - .publication-detail-section { - border: 1px solid #e0e6f0; - border-radius: 10px; - padding: 18px; - background: #fff; +#{$g} .publication-detail-section { + border: 1px solid #e0e6f0; + border-radius: 10px; + padding: 18px; + background: #fff; - h3 { - margin: 0 0 14px; - font-size: 1rem; - color: #1e3a5f; - } - - &--funding { - background: #fafbfd; - } - } - - .publication-overview, - .publication-abstract { - margin: 0; - color: #334155; - line-height: 1.65; - } - - .publication-detail-facts { - display: grid; - gap: 12px; - margin: 0; - - div { - display: grid; - grid-template-columns: 130px minmax(0, 1fr); - gap: 12px; - } - - dt { - color: #64748b; - font-size: 0.875rem; - } - - dd { - margin: 0; - word-break: break-word; - color: #1e293b; - } - } - - .tag-list { - display: flex; - flex-wrap: wrap; - gap: 6px; - margin: 0; - padding: 0; - list-style: none; - - &--compact .tag { - font-size: 0.75rem; - padding: 3px 8px; - } - } - - .tag { - padding: 4px 10px; - border-radius: 999px; - background: #f0f6ff; - border: 1px solid #dbeafe; - color: #1e40af; - font-size: 0.8rem; - line-height: 1.3; - } - - .access-badge { - display: inline-flex; - padding: 4px 10px; - border-radius: 999px; - font-size: 0.8rem; - font-weight: 600; - background: #f1f5f9; - color: #64748b; - - &--open { - background: #effaf3; - color: #24834f; - } - - &--closed { - background: #f8fafc; - color: #475569; - } - } - - .access-actions { - display: flex; - flex-wrap: wrap; - gap: 10px; - align-items: center; - } - - .inline-action { - display: inline-flex; - align-items: center; - gap: 4px; - color: #0b63ce; - font-weight: 600; - font-size: 0.875rem; - text-decoration: none; - - .material-icons { - font-size: 16px; - } - } - - .warning-badge { - display: inline-flex; - padding: 4px 10px; - border-radius: 999px; - background: #fef2f2; - border: 1px solid #fecaca; - color: #b91c1c; - font-size: 0.8rem; - font-weight: 600; - } - - .citation-year-table { - border-collapse: collapse; - - th, - td { - padding: 2px 0; - font-weight: normal; - text-align: left; - vertical-align: top; - } - - th { - padding-right: 20px; - font-weight: 600; - color: #334155; - white-space: nowrap; - } - - td { - color: #1e293b; - } + h3 { + margin: 0 0 14px; + font-size: 1rem; + color: #1e3a5f; } } -@media (max-width: 960px) { - .publication-detail-grid { - grid-template-columns: 1fr; - } +#{$g} .publication-overview, +#{$g} .publication-abstract { + margin: 0; + color: #334155; + line-height: 1.65; +} + +#{$g} .publication-detail-facts { + display: grid; + gap: 12px; + margin: 0; +} + +#{$g} .publication-detail-facts div { + display: grid; + grid-template-columns: 130px minmax(0, 1fr); + gap: 12px; +} + +#{$g} .publication-detail-facts dt { + color: #64748b; + font-size: 0.875rem; +} + +#{$g} .publication-detail-facts dd { + margin: 0; + word-break: break-word; + color: #1e293b; +} + +#{$g} .tag-list { + display: flex; + flex-wrap: wrap; + gap: 6px; + margin: 0; + padding: 0; + list-style: none; +} + +#{$g} .tag, +#{$g} .access-badge, +#{$g} .warning-badge { + display: inline-flex; + padding: 4px 10px; + border-radius: 999px; + font-size: 0.8rem; +} + +#{$g} .tag { + background: #f0f6ff; + border: 1px solid #dbeafe; + color: #1e40af; + line-height: 1.3; +} + +#{$g} .access-badge { + font-weight: 600; + background: #f1f5f9; + color: #64748b; +} + +#{$g} .access-badge--closed { + background: #f8fafc; + color: #475569; +} + +#{$g} .inline-action { + display: inline-flex; + align-items: center; + gap: 4px; + color: #0b63ce; + font-weight: 600; + font-size: 0.875rem; + text-decoration: none; + + .material-icons { font-size: 16px; } +} + +#{$g} .warning-badge { + background: #fef2f2; + border: 1px solid #fecaca; + color: #b91c1c; + font-weight: 600; } .publication-item { padding: 8px 0; border-bottom: 2px solid #5b5555; cursor: pointer; - - &:hover { - background: #f9f9f9; - } } .publication-title { @@ -654,30 +645,31 @@ word-break: break-word; display: block; } -.publication-more-info { - display: flex; - align-items: center; - gap: 4px; - margin-top: 6px; - border: 0; - background: transparent; - padding: 0; - cursor: pointer; -} + +.mehr-infos-label, +.publication-link-icon { color: #1976d2; } .mehr-infos-label { font-size: 0.8rem; - color: #1976d2; font-weight: 500; } .publication-link-icon { display: flex; align-items: center; - color: #1976d2; - flex-shrink: 0; - .material-icons { - font-size: 16px; + .material-icons { font-size: 16px; } +} + +@media (max-width: 720px) { + .publication-detail-hero { + flex-direction: column; + align-items: stretch; + + &__action { justify-content: center; } } } + +@media (max-width: 960px) { + #{$g} { grid-template-columns: 1fr; } +} diff --git a/webapp/src/app/modules/person-network-collaborators/person-network-collaborators.component.html b/webapp/src/app/modules/person-network-collaborators/person-network-collaborators.component.html deleted file mode 100644 index 0c95379c..00000000 --- a/webapp/src/app/modules/person-network-collaborators/person-network-collaborators.component.html +++ /dev/null @@ -1,52 +0,0 @@ -
- - - - - - - - - - - - - - - - -
Name - {{ element.name }} - Häufigkeit - {{ element.works.length }} - - - open_in_new - -
-
-@if (dataSource.filteredData.length === 0) { -

Keine Kollaborierenden gefunden.

-} - - -
- -
-
diff --git a/webapp/src/app/modules/person-network-collaborators/person-network-collaborators.component.scss b/webapp/src/app/modules/person-network-collaborators/person-network-collaborators.component.scss deleted file mode 100644 index 4dfb4f9e..00000000 --- a/webapp/src/app/modules/person-network-collaborators/person-network-collaborators.component.scss +++ /dev/null @@ -1,38 +0,0 @@ -.table { - overflow: auto; - width: 100%; - max-height: 100%; -} - -.mat-mdc-table { - background-color: var(--sg-background); -} - -.element-row { - position: relative; -} - -.element-row:not(.expanded) { - cursor: pointer; -} - -.element-row:not(.expanded):hover { - background: #f5f5f5; -} - -.element-row.expanded { - border-bottom-color: transparent; -} - -.detail-row { - width: 100%; -} - -.work-link { - color: var(--sg-primary); - text-decoration: none; - - &:hover { - text-decoration: underline; - } -} diff --git a/webapp/src/app/modules/person-network-collaborators/person-network-collaborators.component.ts b/webapp/src/app/modules/person-network-collaborators/person-network-collaborators.component.ts deleted file mode 100644 index f86545d4..00000000 --- a/webapp/src/app/modules/person-network-collaborators/person-network-collaborators.component.ts +++ /dev/null @@ -1,156 +0,0 @@ -import { - AfterViewInit, - Component, - input, - effect, - ViewChild, -} from '@angular/core'; -import { CollaborationNetwork } from '../../api'; -import { RouterModule } from '@angular/router'; - -import { MatTableDataSource, MatTableModule } from '@angular/material/table'; -import { MatButtonModule } from '@angular/material/button'; -import { MatIconModule } from '@angular/material/icon'; -import { MatSort, MatSortModule } from '@angular/material/sort'; -import { CdkDetailRowDirective } from '../../directives/cdk-detail-row.directive'; - -type Work = { - id: string; - title: string; -}; - -type Collaborator = { - id: string; - name: string; - category: string; - works: Work[]; -}; - -@Component({ - selector: 'app-person-network-collaborators', - imports: [ - MatTableModule, - MatIconModule, - MatSortModule, - MatButtonModule, - RouterModule, - CdkDetailRowDirective, - ], - templateUrl: './person-network-collaborators.component.html', - styleUrl: './person-network-collaborators.component.scss', -}) -export class PersonNetworkCollaboratorsComponent implements AfterViewInit { - collaborationNetwork = input.required(); - searchTerm = input.required(); - - displayedColumns: string[] = ['name', 'count', 'actions']; - - dataSource = new MatTableDataSource(); - - trackBy = (index: number, item: Collaborator) => item.id; - - @ViewChild(MatSort) sort!: MatSort; - - constructor() { - effect(() => { - const collaborationNetwork = this.collaborationNetwork(); - this.dataSource = this.buildCollaboratorsDataSource(collaborationNetwork); - this.dataSource.sortingDataAccessor = (item, property) => { - if (property === 'count') { - return item.works.length; - } - return (item as Record)[property] as string | number; - }; - this.dataSource.filterPredicate = (data, filter) => { - const value = filter.trim().toLowerCase(); - return ( - data.id.toLowerCase().includes(value) || - data.name.toLowerCase().includes(value) - ); - }; - if (this.sort) { - this.dataSource.sort = this.sort; - this.setDefaultSort(); - } - const currentSearchTerm = this.searchTerm().trim().toLowerCase(); - this.dataSource.filter = currentSearchTerm; - }); - - effect(() => { - const searchTerm = this.searchTerm(); - const normalizedTerm = searchTerm.trim().toLowerCase(); - this.dataSource.filter = normalizedTerm; - }); - } - - ngAfterViewInit() { - this.dataSource.sort = this.sort; - } - - private setDefaultSort(): void { - this.sort.active = 'name'; - this.sort.direction = 'asc'; - this.sort.sortChange.emit({ active: 'name', direction: 'asc' }); - } - - buildCollaboratorsDataSource( - collaborationNetwork: CollaborationNetwork, - ): MatTableDataSource { - // key: collaborator id, value: set of work ids - const worksByCollaborator: Record> = {}; - // key: work id, value: work - const works: Record = {}; - - const allWorks: Record = collaborationNetwork.work_nodes - .map((node) => ({ - id: node.raw_id, - title: node.display_name, - })) - .reduce( - (acc, work) => { - acc[work.id] = work; - return acc; - }, - {} as Record, - ); - - const allAuthors: Record = - collaborationNetwork.author_nodes - .map((node) => ({ - id: node.raw_id, - name: node.display_name, - category: node.category, - works: [], - })) - .reduce( - (acc, author) => { - acc[author.id] = author; - return acc; - }, - {} as Record, - ); - - collaborationNetwork.collaboration_edges.forEach((edge) => { - if ( - edge.raw_source_id.toUpperCase().startsWith('A') && - edge.raw_target_id.toUpperCase().startsWith('W') - ) { - allAuthors[edge.raw_source_id]?.works.push( - allWorks[edge.raw_target_id], - ); - } - }); - - Object.values(allAuthors).forEach((author) => { - author.works.sort((a, b) => a.title.localeCompare(b.title)); - }); - - return new MatTableDataSource( - Object.values(allAuthors).filter( - (author) => - author.works.length > 0 && - author.id !== collaborationNetwork.raw_person_id, - ), - ); - } -} diff --git a/webapp/src/app/modules/person-network-institutions/person-network-institutions.component.html b/webapp/src/app/modules/person-network-institutions/person-network-institutions.component.html deleted file mode 100644 index 39a86dd9..00000000 --- a/webapp/src/app/modules/person-network-institutions/person-network-institutions.component.html +++ /dev/null @@ -1,45 +0,0 @@ -
- - - - - - - - - - - - -
Name - {{ element.name }} - Mitwirkende - {{ element.collaborators.length }} -
-
-@if (dataSource.filteredData.length === 0) { -

Keine Institutionen gefunden.

-} - - - - - - - - diff --git a/webapp/src/app/modules/person-network-institutions/person-network-institutions.component.scss b/webapp/src/app/modules/person-network-institutions/person-network-institutions.component.scss deleted file mode 100644 index 7cb09d57..00000000 --- a/webapp/src/app/modules/person-network-institutions/person-network-institutions.component.scss +++ /dev/null @@ -1,38 +0,0 @@ -.table { - overflow: auto; - width: 100%; - max-height: 100%; -} - -.mat-mdc-table { - background-color: var(--sg-background); -} - -.element-row { - position: relative; -} - -.element-row:not(.expanded) { - cursor: pointer; -} - -.element-row:not(.expanded):hover { - background: #f5f5f5; -} - -.element-row.expanded { - border-bottom-color: transparent; -} - -.detail-row { - width: 100%; -} - -.person-link { - color: var(--sg-primary); - text-decoration: none; - - &:hover { - text-decoration: underline; - } -} diff --git a/webapp/src/app/modules/person-network-institutions/person-network-institutions.component.ts b/webapp/src/app/modules/person-network-institutions/person-network-institutions.component.ts deleted file mode 100644 index c992a06e..00000000 --- a/webapp/src/app/modules/person-network-institutions/person-network-institutions.component.ts +++ /dev/null @@ -1,124 +0,0 @@ -import { - AfterViewInit, - Component, - effect, - input, - ViewChild, -} from '@angular/core'; -import { CollaborationNetwork } from '../../api'; -import { MatTableDataSource, MatTableModule } from '@angular/material/table'; -import { MatSort, MatSortModule } from '@angular/material/sort'; -import { MatIconModule } from '@angular/material/icon'; -import { RouterModule } from '@angular/router'; -import { CdkDetailRowDirective } from '../../directives/cdk-detail-row.directive'; -import { MatButtonModule } from '@angular/material/button'; - -type Collaborator = { - id: string; - name: string; -}; - -type Institution = { - id: string; - name: string; - collaborators: Collaborator[]; -}; - -@Component({ - selector: 'app-person-network-institutions', - imports: [ - MatTableModule, - MatIconModule, - MatSortModule, - RouterModule, - CdkDetailRowDirective, - MatButtonModule, - ], - templateUrl: './person-network-institutions.component.html', - styleUrl: './person-network-institutions.component.scss', -}) -export class PersonNetworkInstitutionsComponent implements AfterViewInit { - collaborationNetwork = input.required(); - searchTerm = input.required(); - - displayedColumns: string[] = ['name', 'collaborators']; - - dataSource = new MatTableDataSource(); - - trackBy = (index: number, item: Institution) => item.id; - - @ViewChild(MatSort) sort!: MatSort; - - constructor() { - effect(() => { - const collaborationNetwork = this.collaborationNetwork(); - if (!collaborationNetwork) { - return; - } - - this.dataSource = this.buildInstitutionsDataSource(collaborationNetwork); - this.dataSource.sortingDataAccessor = (item, property) => { - if (property === 'collaborators') { - return item.collaborators.length; - } - return (item as any)[property]; - }; - if (this.sort) { - this.dataSource.sort = this.sort; - this.setDefaultSort(); - } - }); - - effect(() => { - const searchTerm = this.searchTerm().toLowerCase(); - this.dataSource.filter = searchTerm; - }); - } - - ngAfterViewInit() { - if (this.sort) { - this.dataSource.sort = this.sort; - } - } - - private setDefaultSort(): void { - this.sort.active = 'name'; - this.sort.direction = 'asc'; - this.sort.sortChange.emit({ active: 'name', direction: 'asc' }); - } - - buildInstitutionsDataSource( - collaborationNetwork: CollaborationNetwork, - ): MatTableDataSource { - const institutionsMap: Record = {}; - - for (const node of collaborationNetwork.institution_nodes) { - institutionsMap[node.raw_id] = { - id: node.raw_id, - name: node.display_name, - collaborators: [], - }; - } - - for (const edge of collaborationNetwork.collaboration_edges) { - if (edge.raw_target_id in institutionsMap) { - const institution = institutionsMap[edge.raw_target_id]; - institution.collaborators.push({ - id: edge.raw_source_id, - name: - collaborationNetwork.author_nodes.find( - (node) => node.raw_id === edge.raw_source_id, - )?.display_name || 'Unbekannt', - }); - } - } - - for (const institution of Object.values(institutionsMap)) { - institution.collaborators.sort((a, b) => - a.name.localeCompare(b.name, 'de', { sensitivity: 'base' }), - ); - } - - return new MatTableDataSource(Object.values(institutionsMap)); - } -} diff --git a/webapp/src/app/modules/person-network-publications/person-network-publications.component.html b/webapp/src/app/modules/person-network-publications/person-network-publications.component.html deleted file mode 100644 index 83bcc41c..00000000 --- a/webapp/src/app/modules/person-network-publications/person-network-publications.component.html +++ /dev/null @@ -1,54 +0,0 @@ -
- - - - - - - - - - - - - - - - -
Titel - {{ element.title }} - Mitwirkende - {{ element.collaborators.length }} - - - open_in_new - -
-
-@if (dataSource.filteredData.length === 0) { -

Keine Publikationen gefunden.

-} - - - - - - - - diff --git a/webapp/src/app/modules/person-network-publications/person-network-publications.component.scss b/webapp/src/app/modules/person-network-publications/person-network-publications.component.scss deleted file mode 100644 index 7cb09d57..00000000 --- a/webapp/src/app/modules/person-network-publications/person-network-publications.component.scss +++ /dev/null @@ -1,38 +0,0 @@ -.table { - overflow: auto; - width: 100%; - max-height: 100%; -} - -.mat-mdc-table { - background-color: var(--sg-background); -} - -.element-row { - position: relative; -} - -.element-row:not(.expanded) { - cursor: pointer; -} - -.element-row:not(.expanded):hover { - background: #f5f5f5; -} - -.element-row.expanded { - border-bottom-color: transparent; -} - -.detail-row { - width: 100%; -} - -.person-link { - color: var(--sg-primary); - text-decoration: none; - - &:hover { - text-decoration: underline; - } -} diff --git a/webapp/src/app/modules/person-network-publications/person-network-publications.component.ts b/webapp/src/app/modules/person-network-publications/person-network-publications.component.ts deleted file mode 100644 index c4c08016..00000000 --- a/webapp/src/app/modules/person-network-publications/person-network-publications.component.ts +++ /dev/null @@ -1,144 +0,0 @@ -import { - AfterViewInit, - Component, - input, - effect, - ViewChild, -} from '@angular/core'; -import { CollaborationNetwork } from '../../api'; -import { RouterModule } from '@angular/router'; - -import { MatTableDataSource, MatTableModule } from '@angular/material/table'; -import { MatButtonModule } from '@angular/material/button'; -import { MatIconModule } from '@angular/material/icon'; -import { MatSort, MatSortModule } from '@angular/material/sort'; -import { CdkDetailRowDirective } from '../../directives/cdk-detail-row.directive'; - -type Collaborator = { - id: string; - name: string; - category: string; -}; - -type Work = { - id: string; - title: string; - collaborators: Collaborator[]; -}; - -@Component({ - selector: 'app-person-network-publications', - imports: [ - MatTableModule, - MatIconModule, - MatSortModule, - RouterModule, - CdkDetailRowDirective, - MatButtonModule, - ], - templateUrl: './person-network-publications.component.html', - styleUrl: './person-network-publications.component.scss', -}) -export class PersonNetworkPublicationsComponent implements AfterViewInit { - collaborationNetwork = input.required(); - searchTerm = input.required(); - - displayedColumns: string[] = ['title', 'contributors', 'actions']; - - dataSource = new MatTableDataSource(); - - trackBy = (index: number, item: Work) => item.id; - - @ViewChild(MatSort) sort!: MatSort; - - constructor() { - effect(() => { - const collaborationNetwork = this.collaborationNetwork(); - if (!collaborationNetwork) { - return; - } - - this.dataSource = this.buildWorksDataSource(collaborationNetwork); - this.dataSource.sortingDataAccessor = (item, property) => { - if (property === 'contributors') { - return item.collaborators.length; - } - return (item as Record)[property] as string | number; - }; - if (this.sort) { - this.dataSource.sort = this.sort; - this.setDefaultSort(); - } - }); - - effect(() => { - const searchTerm = this.searchTerm(); - this.dataSource.filter = searchTerm.trim().toLowerCase(); - }); - } - - ngAfterViewInit() { - this.dataSource.sort = this.sort; - } - - private setDefaultSort(): void { - this.sort.active = 'title'; - this.sort.direction = 'asc'; - this.sort.sortChange.emit({ active: 'title', direction: 'asc' }); - } - - buildWorksDataSource( - collaborationNetwork: CollaborationNetwork, - ): MatTableDataSource { - const allWorks: Record = collaborationNetwork.work_nodes - .map((node) => ({ - id: node.raw_id, - title: node.display_name, - collaborators: [], - })) - .reduce( - (acc, work) => { - acc[work.id] = work; - return acc; - }, - {} as Record, - ); - - const allAuthors: Record = - collaborationNetwork.author_nodes - .map((node) => ({ - id: node.raw_id, - name: node.display_name, - category: - node.raw_id === collaborationNetwork.raw_person_id - ? 'author' - : 'collaborator', - })) - .reduce( - (acc, person) => { - acc[person.id] = person; - return acc; - }, - {} as Record, - ); - - collaborationNetwork.collaboration_edges.forEach((edge) => { - if ( - edge.raw_source_id.toUpperCase().startsWith('A') && - edge.raw_target_id.toUpperCase().startsWith('W') - ) { - allWorks[edge.raw_target_id]?.collaborators.push( - allAuthors[edge.raw_source_id], - ); - } - }); - - Object.values(allWorks).forEach((work) => { - work.collaborators.sort((a, b) => a.name.localeCompare(b.name)); - }); - - return new MatTableDataSource( - Object.values(allWorks).filter((work) => work.collaborators.length > 0), - ); - } -} diff --git a/webapp/src/app/modules/person-network/person-network.component.html b/webapp/src/app/modules/person-network/person-network.component.html index 5da3bb31..f6a27bce 100644 --- a/webapp/src/app/modules/person-network/person-network.component.html +++ b/webapp/src/app/modules/person-network/person-network.component.html @@ -6,7 +6,7 @@
@@ -51,17 +51,26 @@ @if (this.displayedTable() === 'collaborators') { - + } @else if (this.displayedTable() === 'publications') { - + } @else if (this.displayedTable() === 'institutions') { - + } @@ -77,3 +86,81 @@ }
+ + + + open_in_new + + + + + {{ element.works.length }} + + + +
+ +
+
+ + + + open_in_new + + + + + {{ element.collaborators.length }} + + + +
+ +
+
+ + + + open_in_new + + + + + {{ element.collaborators.length }} + + + +
+ +
diff --git a/webapp/src/app/modules/person-network/person-network.component.scss b/webapp/src/app/modules/person-network/person-network.component.scss index 36506868..74a4778c 100644 --- a/webapp/src/app/modules/person-network/person-network.component.scss +++ b/webapp/src/app/modules/person-network/person-network.component.scss @@ -59,3 +59,13 @@ form > div > mat-button-toggle-group { mat-card { background-color: var(--sg-background); } + +.person-link, +.work-link { + color: var(--sg-primary); + text-decoration: none; +} +.person-link:hover, +.work-link:hover { + text-decoration: underline; +} diff --git a/webapp/src/app/modules/person-network/person-network.component.ts b/webapp/src/app/modules/person-network/person-network.component.ts index 647f2939..1c96f6eb 100644 --- a/webapp/src/app/modules/person-network/person-network.component.ts +++ b/webapp/src/app/modules/person-network/person-network.component.ts @@ -1,17 +1,23 @@ import { toSignal } from '@angular/core/rxjs-interop'; -import { Component, computed, OnInit, signal } from '@angular/core'; +import { + Component, + computed, + effect, + input, + OnInit, + signal, + TemplateRef, + viewChild, +} from '@angular/core'; import { ActivatedRoute, Router, RouterModule } from '@angular/router'; import { MatCardModule } from '@angular/material/card'; import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatRippleModule } from '@angular/material/core'; import { provideEchartsCore } from 'ngx-echarts'; import * as echarts from 'echarts/core'; -import { MatTableModule } from '@angular/material/table'; import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; -import { ScrollingModule } from '@angular/cdk/scrolling'; import { MatFormFieldModule } from '@angular/material/form-field'; import { FormControl, @@ -20,11 +26,7 @@ import { ReactiveFormsModule, } from '@angular/forms'; import { MatInputModule } from '@angular/material/input'; -import { MatSliderModule } from '@angular/material/slider'; -import { MatSortModule } from '@angular/material/sort'; import { CollaborationNetwork } from '../../api'; -import { PersonNetworkCollaboratorsComponent } from '../person-network-collaborators/person-network-collaborators.component'; -import { PersonNetworkPublicationsComponent } from '../person-network-publications/person-network-publications.component'; import { debounceTime } from 'rxjs'; import { NodeCategory, @@ -36,26 +38,57 @@ import { MatExpansionModule } from '@angular/material/expansion'; import { MatDialog, MatDialogModule } from '@angular/material/dialog'; import { PersonNetworkFilterDialogComponent } from '../person-network-filter-dialog/person-network-filter-dialog.component'; import { PersonNetworkInfoCardComponent } from '../person-network-info-card/person-network-info-card.component'; -import { PersonNetworkInstitutionsComponent } from '../person-network-institutions/person-network-institutions.component'; +import { + GenericColumn, + DataTableComponent, +} from '../../shared/ui/data-table/data-table.component'; + +type CWork = { + id: string; + title: string; +}; + +type CCollaborator = { + id: string; + name: string; + category: string; + works: CWork[]; +}; + +type PCollaborator = { + id: string; + name: string; + category: string; +}; + +type PWork = { + id: string; + title: string; + collaborators: PCollaborator[]; +}; + +type ICollaborator = { + id: string; + name: string; +}; + +type IInstitution = { + id: string; + name: string; + collaborators: ICollaborator[]; +}; @Component({ selector: 'app-person-network', imports: [ MatCardModule, - MatTableModule, MatButtonModule, MatIconModule, - ScrollingModule, MatButtonToggleModule, MatFormFieldModule, FormsModule, MatInputModule, - MatSortModule, - MatRippleModule, RouterModule, - PersonNetworkCollaboratorsComponent, - PersonNetworkPublicationsComponent, - MatSliderModule, ReactiveFormsModule, FormsModule, PersonNetworkGraphComponent, @@ -63,14 +96,50 @@ import { PersonNetworkInstitutionsComponent } from '../person-network-institutio MatExpansionModule, MatDialogModule, PersonNetworkInfoCardComponent, - PersonNetworkInstitutionsComponent, + DataTableComponent, ], templateUrl: './person-network.component.html', styleUrl: './person-network.component.scss', providers: [provideEchartsCore({ echarts })], }) export class PersonNetworkComponent implements OnInit { - collaborationNetwork!: CollaborationNetwork; + collaborationNetwork = input.required(); + + collaboratorsColumns: GenericColumn[] = []; + collaboratorsData: CCollaborator[] = []; + collaboratorsActionTmp = viewChild.required>( + 'collaboratorsActionTmp', + ); + collaboratorsFrequencyTmp = viewChild.required>( + 'collaboratorsFrequencyTmp', + ); + collaboratorsDetailRow = viewChild.required>( + 'collaboratorsDetailRow', + ); + + publicationsColumns: GenericColumn[] = []; + publicationsData: PWork[] = []; + publicationsActionTmp = viewChild.required>( + 'publicationsActionTmp', + ); + publicationsCollaborationFrequencyTmp = viewChild.required>( + 'publicationsCollaborationFrequencyTmp', + ); + publicationsDetailRow = viewChild.required>( + 'publicationsDetailRow', + ); + + institutionsColumns: GenericColumn[] = []; + institutionsData: IInstitution[] = []; + institutionsActionTmp = viewChild.required>( + 'institutionsActionTmp', + ); + institutionsFrequencyTmp = viewChild.required>( + 'institutionsFrequencyTmp', + ); + institutionsDetailRow = viewChild.required>( + 'institutionsDetailRow', + ); filterForm = new FormGroup({ searchTerm: new FormControl(''), @@ -181,7 +250,50 @@ export class PersonNetworkComponent implements OnInit { private readonly activatedRoute: ActivatedRoute, private readonly router: Router, private readonly dialog: MatDialog, - ) {} + ) { + effect(() => { + this.collaboratorsData = this.buildCollaboratorsDataSource( + this.collaborationNetwork(), + ); + + this.publicationsData = this.buildWorksDataSource( + this.collaborationNetwork(), + ); + + this.institutionsData = this.buildInstitutionsDataSource( + this.collaborationNetwork(), + ); + + this.calculateSummary(this.collaborationNetwork()); + + const currentParams = this.activatedRoute.snapshot.queryParams; + + this.filterForm.setValue({ + searchTerm: currentParams['search_term'] || '', + filterBy: currentParams['filter_by'] || 'works', + displayedTable: currentParams['table'] || 'collaborators', + + startYear: + Number(currentParams['start_year']) || + this.collaborationNetwork().filter_information.min_possible_year, + endYear: + Number(currentParams['end_year']) || + this.collaborationNetwork().filter_information.max_possible_year, + topics: currentParams['topics'] + ? currentParams['topics'].split(',') + : [], + minContributors: Number(currentParams['min_contributors']) || 2, + maxContributors: Number(currentParams['max_contributors']) || 10, + + minCollaborations: Number(currentParams['min_collaborations']) || 1, + maxCollaborations: Number(currentParams['max_collaborations']) || 100, + + institutions: currentParams['institutions'] + ? currentParams['institutions'].split(',') + : [], + }); + }); + } openFilterDialog() { console.log('Form value when opening dialog:', this.filterForm.value); @@ -233,38 +345,66 @@ export class PersonNetworkComponent implements OnInit { } ngOnInit(): void { - this.activatedRoute.data.subscribe(({ collaborationNetwork }) => { - this.collaborationNetwork = collaborationNetwork; - - this.calculateSummary(collaborationNetwork); - - const currentParams = this.activatedRoute.snapshot.queryParams; - - this.filterForm.setValue({ - searchTerm: currentParams['search_term'] || '', - filterBy: currentParams['filter_by'] || 'works', - displayedTable: currentParams['table'] || 'collaborators', - - startYear: - Number(currentParams['start_year']) || - this.collaborationNetwork.filter_information.min_possible_year, - endYear: - Number(currentParams['end_year']) || - this.collaborationNetwork.filter_information.max_possible_year, - topics: currentParams['topics'] - ? currentParams['topics'].split(',') - : [], - minContributors: Number(currentParams['min_contributors']) || 2, - maxContributors: Number(currentParams['max_contributors']) || 10, - - minCollaborations: Number(currentParams['min_collaborations']) || 1, - maxCollaborations: Number(currentParams['max_collaborations']) || 100, - - institutions: currentParams['institutions'] - ? currentParams['institutions'].split(',') - : [], - }); - }); + this.collaboratorsColumns = [ + { + id: 'name', + header: 'Name', + type: 'accessor', + accessorKey: 'name', + }, + { + id: 'works', + header: 'Häufigkeit', + type: 'display', + cellTemplate: this.collaboratorsFrequencyTmp(), + }, + { + id: 'actions', + header: '', + type: 'display', + cellTemplate: this.collaboratorsActionTmp(), + }, + ]; + this.publicationsColumns = [ + { + id: 'title', + header: 'Titel', + type: 'accessor', + accessorKey: 'title', + }, + { + id: 'collaborators', + header: 'Mitwirkende', + type: 'display', + cellTemplate: this.publicationsCollaborationFrequencyTmp(), + }, + { + id: 'actions', + header: '', + type: 'display', + cellTemplate: this.publicationsActionTmp(), + }, + ]; + this.institutionsColumns = [ + { + id: 'name', + header: 'Name', + type: 'accessor', + accessorKey: 'name', + }, + { + id: 'collaborators', + header: 'Mitwirkende', + type: 'display', + cellTemplate: this.institutionsFrequencyTmp(), + }, + { + id: 'actions', + header: '', + type: 'display', + cellTemplate: this.institutionsActionTmp(), + }, + ]; this.filterForm.valueChanges.pipe(debounceTime(300)).subscribe((value) => { console.log('Form value changed:', value); @@ -294,4 +434,151 @@ export class PersonNetworkComponent implements OnInit { } this.filterForm.get('displayedTable')?.setValue(value); } + + buildCollaboratorsDataSource( + collaborationNetwork: CollaborationNetwork, + ): CCollaborator[] { + // key: collaborator id, value: set of work ids + const worksByCollaborator: Record> = {}; + // key: work id, value: work + const works: Record = {}; + + const allWorks: Record = collaborationNetwork.work_nodes + .map((node) => ({ + id: node.raw_id, + title: node.display_name, + })) + .reduce( + (acc, work) => { + acc[work.id] = work; + return acc; + }, + {} as Record, + ); + + const allAuthors: Record = + collaborationNetwork.author_nodes + .map((node) => ({ + id: node.raw_id, + name: node.display_name, + category: node.category, + works: [], + })) + .reduce( + (acc, author) => { + acc[author.id] = author; + return acc; + }, + {} as Record, + ); + + collaborationNetwork.collaboration_edges.forEach((edge) => { + if ( + edge.raw_source_id.toUpperCase().startsWith('A') && + edge.raw_target_id.toUpperCase().startsWith('W') + ) { + allAuthors[edge.raw_source_id]?.works.push( + allWorks[edge.raw_target_id], + ); + } + }); + + Object.values(allAuthors).forEach((author) => { + author.works.sort((a, b) => a.title.localeCompare(b.title)); + }); + + return Object.values(allAuthors).filter( + (author) => + author.works.length > 0 && + author.id !== collaborationNetwork.raw_person_id, + ); + } + + buildWorksDataSource(collaborationNetwork: CollaborationNetwork): PWork[] { + const allWorks: Record = collaborationNetwork.work_nodes + .map((node) => ({ + id: node.raw_id, + title: node.display_name, + collaborators: [], + })) + .reduce( + (acc, work) => { + acc[work.id] = work; + return acc; + }, + {} as Record, + ); + + const allAuthors: Record = + collaborationNetwork.author_nodes + .map((node) => ({ + id: node.raw_id, + name: node.display_name, + category: + node.raw_id === collaborationNetwork.raw_person_id + ? 'author' + : 'collaborator', + })) + .reduce( + (acc, person) => { + acc[person.id] = person; + return acc; + }, + {} as Record, + ); + + collaborationNetwork.collaboration_edges.forEach((edge) => { + if ( + edge.raw_source_id.toUpperCase().startsWith('A') && + edge.raw_target_id.toUpperCase().startsWith('W') + ) { + allWorks[edge.raw_target_id]?.collaborators.push( + allAuthors[edge.raw_source_id], + ); + } + }); + + Object.values(allWorks).forEach((work) => { + work.collaborators.sort((a, b) => a.name.localeCompare(b.name)); + }); + + return Object.values(allWorks).filter( + (work) => work.collaborators.length > 0, + ); + } + + buildInstitutionsDataSource( + collaborationNetwork: CollaborationNetwork, + ): IInstitution[] { + const institutionsMap: Record = {}; + + for (const node of collaborationNetwork.institution_nodes) { + institutionsMap[node.raw_id] = { + id: node.raw_id, + name: node.display_name, + collaborators: [], + }; + } + + for (const edge of collaborationNetwork.collaboration_edges) { + if (edge.raw_target_id in institutionsMap) { + const institution = institutionsMap[edge.raw_target_id]; + institution.collaborators.push({ + id: edge.raw_source_id, + name: + collaborationNetwork.author_nodes.find( + (node) => node.raw_id === edge.raw_source_id, + )?.display_name || 'Unbekannt', + }); + } + } + + for (const institution of Object.values(institutionsMap)) { + institution.collaborators.sort((a, b) => + a.name.localeCompare(b.name, 'de', { sensitivity: 'base' }), + ); + } + + return Object.values(institutionsMap); + } } diff --git a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.html b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.html index 5376284b..65bf5eae 100644 --- a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.html +++ b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.html @@ -225,6 +225,10 @@ type="button" class="main-topic-button" [disabled]="!getMainTopicItem(item)?.id" + [matTooltip]="getTopicDescription(getMainTopicItem(item))" + [matTooltipDisabled]=" + !hasTopicDescription(getMainTopicItem(item)) + " (click)=" selectTopic(getMainTopicItem(item), [item.year]) "> @@ -261,8 +265,17 @@ [ngClass]="getColorClass(index)" [disabled]="!topic.id" (click)="selectTopic(topic, [item.year])"> - {{ topic.name }} - {{ topic.count }} + + {{ topic.name }} + + + {{ topic.count }} + @@ -322,6 +335,10 @@ type="button" class="main-topic-button" [disabled]="!phase.primaryTopic.id" + [matTooltip]="getTopicDescription(phase.primaryTopic)" + [matTooltipDisabled]=" + !hasTopicDescription(phase.primaryTopic) + " (click)=" selectTopic(phase.primaryTopic, getPhaseYears(phase)) "> @@ -341,8 +358,17 @@ [ngClass]="getColorClass(index)" [disabled]="!topic.id" (click)="selectTopic(topic, getPhaseYears(phase))"> - {{ topic.name }} - {{ topic.count }} + + {{ topic.name }} + + + {{ topic.count }} + @@ -413,8 +439,15 @@ class="mini-topic-chip" [disabled]="!topic.id" (click)="selectTopic(topic, [year.year])"> - {{ topic.name }} - {{ topic.count }} + + {{ topic.name }} + + + {{ topic.count }} + diff --git a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss index 0535e874..e1b43d09 100644 --- a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss +++ b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss @@ -409,7 +409,6 @@ .topic-count { display: inline-flex; - flex: 0 0 auto; align-items: center; justify-content: center; min-width: 18px; @@ -453,7 +452,6 @@ } .phase-marker { - flex: 0 0 auto; width: 11px; height: 11px; margin-top: 5px; @@ -493,7 +491,6 @@ .phase-publications-button { display: inline-flex; - flex: 0 0 auto; width: fit-content; color: #68748f; font-size: 12px; @@ -602,6 +599,9 @@ } strong { + display: inline-flex; + align-items: center; + gap: 2px; color: var(--accent); font-size: 10px; } diff --git a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.ts b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.ts index 90dfbe9f..43c99ff3 100644 --- a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.ts +++ b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.ts @@ -17,6 +17,7 @@ export interface TopicTimelineTopic { id?: string; name: string; count: number; + description?: string; } export interface TopicTimelineElement { @@ -330,6 +331,31 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked { ); } + getTopicDescription(topic: TopicTimelineTopic | undefined): string { + return (topic?.description ?? '').trim(); + } + + hasTopicDescription(topic: TopicTimelineTopic | undefined): boolean { + return this.getTopicDescription(topic).length > 0; + } + + getYearTopicCountTooltip( + topic: TopicTimelineTopic, + item: TopicTimelineElement, + ): string { + return this.getTopicCountTooltip(topic, `im Jahr ${item.year}`); + } + + getPhaseTopicCountTooltip( + topic: TopicTimelineTopic, + phase: ResearchTimelinePhase, + ): string { + return this.getTopicCountTooltip( + topic, + this.getPhasePublicationTooltipPeriod(phase), + ); + } + togglePhase(phase: ResearchTimelinePhase): void { if (this.expandedPhaseIds.has(phase.id)) { this.expandedPhaseIds.delete(phase.id); @@ -462,6 +488,17 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked { return `Insgesamt ${count} ${publicationLabel} ${period} veröffentlicht.`; } + private getTopicCountTooltip( + topic: TopicTimelineTopic, + period: string, + ): string { + const publicationLabel = + topic.count === 1 ? 'Publikation' : 'Publikationen'; + const verb = topic.count === 1 ? 'hat' : 'haben'; + + return `${topic.count} ${publicationLabel} ${period} ${verb} das Topic ${topic.name}.`; + } + private getPhasePublicationTooltipPeriod( phase: ResearchTimelinePhase, ): string { @@ -608,6 +645,7 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked { const primaryTopicName = primaryTopic.name; let count = 0; let id = primaryTopic.id; + let description = primaryTopic.description; for (const year of years) { for (const topic of year.primary_topics ?? []) { @@ -620,6 +658,10 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked { if (!id && topic.id) { id = topic.id; } + + if (!description && topic.description) { + description = topic.description; + } } } @@ -627,6 +669,7 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked { id, name: primaryTopicName, count: count > 0 ? count : primaryTopic.count, + description, }; } @@ -637,6 +680,7 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked { const counts = new Map(); const originalNames = new Map(); const ids = new Map(); + const descriptions = new Map(); for (const year of years) { for (const topic of year.topics ?? []) { @@ -652,6 +696,10 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked { ids.set(normalizedName, topic.id); } + if (topic.description) { + descriptions.set(normalizedName, topic.description); + } + counts.set( normalizedName, (counts.get(normalizedName) ?? 0) + topic.count, @@ -664,6 +712,7 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked { id: ids.get(normalizedName), name: originalNames.get(normalizedName) ?? normalizedName, count, + description: descriptions.get(normalizedName), })) .sort((left, right) => { if (right.count !== left.count) { diff --git a/webapp/src/app/modules/person-overview/person-overview.component.ts b/webapp/src/app/modules/person-overview/person-overview.component.ts index 5291c82a..57d2275c 100644 --- a/webapp/src/app/modules/person-overview/person-overview.component.ts +++ b/webapp/src/app/modules/person-overview/person-overview.component.ts @@ -453,6 +453,7 @@ export class PersonOverviewComponent implements OnInit { id: topic.id ?? undefined, name: topic.name, count: topic.count ?? 0, + description: topic.description ?? undefined, })); } diff --git a/webapp/src/app/modules/person-projects/person-projects.component.html b/webapp/src/app/modules/person-projects/person-projects.component.html new file mode 100644 index 00000000..b1f8bb43 --- /dev/null +++ b/webapp/src/app/modules/person-projects/person-projects.component.html @@ -0,0 +1,64 @@ +
+
+
Projekte
+

Übersicht der durchgeführten Projekte.

+
+ + + + Suche nach Titel + + search + + + + + + + + + + +
+ + + + open_in_new + + + + + {{ element.funding_end == '2999' ? 'laufend' : element.funding_end }} + + + +
+
    + @for ( + name of element.names.sort((a, b) => a.localeCompare(b)); + track $index + ) { +
  • + {{ name }} +
  • + } +
+
+
diff --git a/webapp/src/app/modules/person-projects/person-projects.component.scss b/webapp/src/app/modules/person-projects/person-projects.component.scss new file mode 100644 index 00000000..9bd15288 --- /dev/null +++ b/webapp/src/app/modules/person-projects/person-projects.component.scss @@ -0,0 +1,13 @@ +.person-projects { + padding: 2rem; +} + +.description-container { + display: flex; + flex-direction: column; +} + +mat-card, +mat-paginator { + background-color: var(--sg-background); +} diff --git a/webapp/src/app/modules/person-projects/person-projects.component.ts b/webapp/src/app/modules/person-projects/person-projects.component.ts new file mode 100644 index 00000000..660576e3 --- /dev/null +++ b/webapp/src/app/modules/person-projects/person-projects.component.ts @@ -0,0 +1,162 @@ +import { + Component, + computed, + effect, + input, + OnInit, + signal, + TemplateRef, + viewChild, +} from '@angular/core'; +import { DfgProjectPage, DfgProjectSummary } from '../../api'; +import { + DataTableComponent, + GenericColumn, +} from '../../shared/ui/data-table/data-table.component'; +import { MatIconModule } from '@angular/material/icon'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCardModule } from '@angular/material/card'; +import { MatTabsModule } from '@angular/material/tabs'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { DebounceDirective } from '../../directives/debounce.directive'; +import { ActivatedRoute, Router } from '@angular/router'; +import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; +import { MatPaginatorModule, PageEvent } from '@angular/material/paginator'; +import { Sort, SortDirection } from '@angular/material/sort'; + +@Component({ + selector: 'app-person-projects', + imports: [ + DataTableComponent, + MatIconModule, + MatButtonModule, + MatCardModule, + MatTabsModule, + MatFormFieldModule, + MatInputModule, + DebounceDirective, + MatPaginatorModule, + ], + templateUrl: './person-projects.component.html', + styleUrl: './person-projects.component.scss', +}) +export class PersonProjectsComponent implements OnInit { + dfgProjectPage = input.required(); + dfgProjectColumns: GenericColumn[] = []; + dfgProjectData: DfgProjectSummary[] = []; + + dfgProjectFundingEndTmp = viewChild.required>( + 'dfgProjectFundingEndTmp', + ); + dfgProjectActionsTmp = viewChild.required>( + 'dfgProjectActionsTmp', + ); + dfgProjectDetailRowTmp = viewChild.required>( + 'dfgProjectDetailRowTmp', + ); + + urlSearchTerm = signal(''); + urlSortKey = signal(''); + urlSortDirection = signal(''); + + readonly pageTotal = computed(() => { + return this.dfgProjectPage()?.total ?? 0; + }); + + readonly pageSize = computed(() => { + return this.dfgProjectPage()?.size ?? 10; + }); + + readonly pageIndex = computed(() => { + return this.dfgProjectPage()?.page ?? 0; + }); + + constructor( + private readonly router: Router, + private readonly activatedRoute: ActivatedRoute, + ) { + this.activatedRoute.queryParamMap + .pipe(takeUntilDestroyed()) + .subscribe((params) => { + this.urlSearchTerm.set(params.get('search') || ''); + }); + + effect(() => { + console.log( + 'PersonProjectsComponent: dfgProjectPage changed', + this.dfgProjectPage(), + ); + this.dfgProjectData = this.dfgProjectPage().elements || []; + }); + + effect(() => { + const searchTerm = this.urlSearchTerm(); + if (searchTerm) { + this.router.navigate([], { + queryParams: { search: searchTerm }, + queryParamsHandling: 'merge', + }); + } + }); + } + + ngOnInit(): void { + this.dfgProjectColumns = [ + { id: 'title', header: 'Titel', type: 'accessor', accessorKey: 'title' }, + { + id: 'funding_start', + header: 'Förderbeginn', + type: 'accessor', + accessorKey: 'funding_start', + }, + { + id: 'funding_end', + header: 'Förderende', + type: 'accessor', + accessorKey: 'funding_end', + cellTemplate: this.dfgProjectFundingEndTmp(), + }, + { + id: 'professional_classification', + header: 'Fachliche Zuordnung', + type: 'accessor', + accessorKey: 'professional_classification', + }, + { + id: 'actions', + header: '', + type: 'display', + cellTemplate: this.dfgProjectActionsTmp(), + }, + ]; + } + + handleSearchTermChange(newTerm: string): void { + this.router.navigate([], { + queryParams: { search: newTerm }, + queryParamsHandling: 'merge', + }); + } + + clearSearchTerm(): void { + this.router.navigate([], { + queryParams: { search: null }, + queryParamsHandling: 'merge', + }); + } + + handlePageChange(event: PageEvent): void { + this.router.navigate([], { + queryParams: { page: event.pageIndex, size: event.pageSize }, + queryParamsHandling: 'merge', + }); + } + + handleSortChange(event: Sort): void { + this.router.navigate([], { + queryParams: { sort_by: event.active, sort_direction: event.direction }, + queryParamsHandling: 'merge', + }); + } +} diff --git a/webapp/src/app/modules/person/person.component.html b/webapp/src/app/modules/person/person.component.html index b4fba84c..a0b50703 100644 --- a/webapp/src/app/modules/person/person.component.html +++ b/webapp/src/app/modules/person/person.component.html @@ -21,11 +21,11 @@ } @if (citedByCount() !== null) { {{ citedByCount() }} Zitationen - } + } @if (h_index() !== null) { - h_index: {{ h_index() }} + h_index: {{ h_index() }} } } @@ -74,6 +74,7 @@ this.person()?.works_count ?? null); readonly citedByCount = computed(() => this.person()?.cited_by_count ?? null); - readonly h_index = computed(() => this.person()?.summary_stats?.h_index ?? null); + readonly h_index = computed( + () => this.person()?.summary_stats?.h_index ?? null, + ); readonly orcid = computed(() => { const rawOrcid = this.getId('orcid'); if (!rawOrcid) { @@ -168,7 +170,18 @@ export class PersonComponent { ); links = [ { label: 'Übersicht', path: 'overview', disabled: false }, - { label: 'Projekte', path: 'projects', disabled: true }, + { + label: 'Projekte', + path: 'projects', + queryParams: { + page: 0, + size: 10, + sort_by: 'title', + sort_direction: 'asc', + search: '', + }, + disabled: false, + }, { label: 'Publikationen', path: 'publications', disabled: false }, { label: 'Netzwerk', path: 'network', disabled: false }, { label: 'Gründungen', path: 'foundings', disabled: true }, diff --git a/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.ts b/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.ts index 8bead083..eb9468e3 100644 --- a/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.ts +++ b/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.ts @@ -11,6 +11,13 @@ import { MatCheckboxModule } from '@angular/material/checkbox'; import { MatIconModule } from '@angular/material/icon'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { TopicsService } from '../../api/api/topics.service'; +import { Subject, of } from 'rxjs'; +import { + debounceTime, + distinctUntilChanged, + switchMap, + catchError, +} from 'rxjs/operators'; export interface TopicItem { id: string; @@ -79,7 +86,54 @@ export class TopicHierarchyComponent implements OnInit { expandedFields = new Set(); expandedSubfields = new Set(); - constructor(private topicsService: TopicsService) {} + private readonly searchSubject = new Subject(); + + constructor(private topicsService: TopicsService) { + this.searchSubject + .pipe( + debounceTime(300), + distinctUntilChanged(), + switchMap((query) => { + if (!query) { + this.filteredFlatTopics = []; + return of({ results: [] }); + } + this.loading.set(true); + return this.topicsService.vectorSearchTopics(query, 50).pipe( + catchError((err) => { + console.error('Error in semantic topic search:', err); + // Fallback to local filtering + const q = query.toLowerCase(); + this.filteredFlatTopics = this.flatTopics.filter( + (t) => + t.name.toLowerCase().includes(q) || + t.path.toLowerCase().includes(q), + ); + return of({ results: [] }); + }), + ); + }), + ) + .subscribe((response) => { + this.loading.set(false); + if (response && response.results) { + this.filteredFlatTopics = response.results.map((topic) => { + const parts = []; + if (topic.domain?.display_name) + parts.push(topic.domain.display_name); + if (topic.field?.display_name) parts.push(topic.field.display_name); + if (topic.subfield?.display_name) + parts.push(topic.subfield.display_name); + return { + id: topic.id || '', + name: topic.display_name || '', + path: + parts.length > 0 ? parts.join(' > ') : topic.description || '', + }; + }); + } + }); + } ngOnInit(): void { this.topicsService.getTopicHierarchy().subscribe({ @@ -121,12 +175,7 @@ export class TopicHierarchyComponent implements OnInit { this.filteredFlatTopics = []; return; } - const query = this.searchQuery.toLowerCase(); - this.filteredFlatTopics = this.flatTopics.filter( - (t) => - t.name.toLowerCase().includes(query) || - t.path.toLowerCase().includes(query), - ); + this.searchSubject.next(this.searchQuery); } toggleTopic(name: string): void { diff --git a/webapp/src/app/resolvers/dfg-projects.resolver.ts b/webapp/src/app/resolvers/dfg-projects.resolver.ts new file mode 100644 index 00000000..f5414f57 --- /dev/null +++ b/webapp/src/app/resolvers/dfg-projects.resolver.ts @@ -0,0 +1,28 @@ +import { inject } from '@angular/core'; +import { ResolveFn } from '@angular/router'; +import { DfgProjectPage, ProjectsService } from '../api'; + +export const dfgProjectsResolver: ResolveFn = ( + route, + state, +) => { + const page = route.queryParamMap.get('page') ?? '0'; + const size = route.queryParamMap.get('size') ?? '10'; + const rawAuthorId = route.parent?.params['id']; + if (!rawAuthorId) { + throw new Error('Author ID is required to resolve collaboration network'); + } + + const searchTerm = route.queryParamMap.get('search'); + const sortBy = route.queryParamMap.get('sort_by') || 'title'; + const sortDirection = route.queryParamMap.get('sort_direction') || 'asc'; + + return inject(ProjectsService).getDfgProjects( + rawAuthorId, + searchTerm ?? undefined, + Number(page), + Number(size), + sortBy, + sortDirection, + ); +}; diff --git a/webapp/src/app/resolvers/institution.resolver.ts b/webapp/src/app/resolvers/institution.resolver.ts index 12fcdc10..716fa075 100644 --- a/webapp/src/app/resolvers/institution.resolver.ts +++ b/webapp/src/app/resolvers/institution.resolver.ts @@ -2,10 +2,7 @@ import { ResolveFn } from '@angular/router'; import { Institution, InstitutionsService } from '../api'; import { inject } from '@angular/core'; -export const institutionResolver: ResolveFn = ( - route, - state, -) => { +export const institutionResolver: ResolveFn = (route, state) => { const institutionId = route.paramMap.get('institutionId'); if (!institutionId) { throw new Error( diff --git a/webapp/src/app/resolvers/person-list.resolver.ts b/webapp/src/app/resolvers/person-list.resolver.ts index 97001abe..8e4b824c 100644 --- a/webapp/src/app/resolvers/person-list.resolver.ts +++ b/webapp/src/app/resolvers/person-list.resolver.ts @@ -26,8 +26,8 @@ export const personListResolver: ResolveFn = ( : 10; const institutionName = params.get('institutionName') || undefined; - const sortBy= params.get('sortBy') || undefined; - const sortOrder= params.get('sortOrder') || undefined; + const sortBy = params.get('sortBy') || undefined; + const sortOrder = params.get('sortOrder') || undefined; const topicsParam = params.getAll('topic'); diff --git a/webapp/src/app/shared/interceptors/authentication.interceptor.ts b/webapp/src/app/shared/interceptors/authentication.interceptor.ts index 788ed84a..ac649afd 100644 --- a/webapp/src/app/shared/interceptors/authentication.interceptor.ts +++ b/webapp/src/app/shared/interceptors/authentication.interceptor.ts @@ -5,8 +5,11 @@ import { switchMap, throwError } from 'rxjs'; export const authenticationInterceptor: HttpInterceptorFn = (req, next) => { if ( - req.method == 'POST' && - (req.url.endsWith('/auth/id') || req.url.endsWith('/auth/access')) + (req.method == 'POST' && + (req.url.endsWith('/auth/id') || + req.url.endsWith('/auth/access') || + req.url.endsWith('/inse-account/create'))) || + req.url.endsWith('/institutions/autocomplete') ) { return next(req); } else { diff --git a/webapp/src/app/shared/services/credential.service.ts b/webapp/src/app/shared/services/credential.service.ts index 13bf6ad5..040eac7c 100644 --- a/webapp/src/app/shared/services/credential.service.ts +++ b/webapp/src/app/shared/services/credential.service.ts @@ -1,14 +1,15 @@ -import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -//import { BehaviorSubject, Observable, takeWhile } from 'rxjs'; +import { Injectable,inject } from '@angular/core'; import { filter, take, map } from 'rxjs/operators'; //TODO: review by arman import { Observable, of } from 'rxjs'; // review import { BehaviorSubject } from 'rxjs'; //review +import { INSEAccountServiceService, IdentityGrant as ApiIdentityGrant, AccessGrant as ApiAccessGrant } from '../../api'; export interface AuthAccount { i: number; l: string; o: number; + e: string; + on: string; } export interface AuthScope { @@ -47,6 +48,8 @@ interface TimedAccessGrant { providedIn: 'root', }) export class CredentialService { + private accountService = inject(INSEAccountServiceService); + private static readonly KEY_GRANT = 'grant'; public readonly validating = new BehaviorSubject(false); @@ -57,6 +60,8 @@ export class CredentialService { undefined, ); public readonly login = new BehaviorSubject(''); + public readonly email = new BehaviorSubject(''); + public readonly organizationName = new BehaviorSubject(''); private readonly identityToken = new BehaviorSubject< TimedIdentityGrant | undefined @@ -67,17 +72,21 @@ export class CredentialService { private request = 0; - constructor(private http: HttpClient) { + constructor() { this.accessToken.subscribe((token) => { if (token) { const r = token.grant.scope.r as string[]; this.superadmin.next(r.includes('SUPER_ADMIN')); this.universityadmin.next(r.includes('UNI_ADMIN')); this.login.next(token.grant.scope.a?.l ?? ''); + this.email.next(token.grant.scope.a?.e ?? ''); + this.organizationName.next(token.grant.scope.a?.on ?? ''); } else { this.superadmin.next(false); this.universityadmin.next(false); this.login.next(''); + this.email.next(''); + this.organizationName.next(''); } }); const data = localStorage.getItem(CredentialService.KEY_GRANT); @@ -104,15 +113,12 @@ export class CredentialService { body.set('username', login); body.set('password', password); - this.http - .post('/inse-account/auth/id', body.toString(), { - headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, - }) + this.accountService.getIdentityGrant(login,password) .subscribe({ next: (result) => { if (this.request != request) return; - const token = { - grant: result, + const token: TimedIdentityGrant = { + grant: result as any as IdentityGrant, expiration: result.expires_in * 1000 + now, }; this.identityToken.next(token); @@ -137,20 +143,12 @@ export class CredentialService { const uid = identityToken.grant.scope.a!.i; const org = identityToken.grant.scope.a!.o; - const body = new URLSearchParams(); - body.set('secret', identityToken.grant.access_token); - body.set('account', uid.toString()); - body.set('organization', org.toString()); - - this.http - .post('/inse-account/auth/access', body.toString(), { - headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, - }) + this.accountService.getAccessGrant(identityToken.grant.access_token, uid, org) .subscribe({ next: (result) => { if (this.request != request) return; - const token = { - grant: result, + const token: TimedAccessGrant = { + grant: result as any as AccessGrant, expiration: result.expires_in * 1000 + now, }; this.accessToken.next(token); @@ -180,6 +178,11 @@ export class CredentialService { this.identityToken.next(undefined); this.accessToken.next(undefined); this.validating.next(false); + + } + + public registerAccount(data: any): Observable { + return this.accountService.createUser(data) } //review: arman (generated fix) diff --git a/webapp/src/app/shared/services/error.service.ts b/webapp/src/app/shared/services/error.service.ts new file mode 100644 index 00000000..04eb0e40 --- /dev/null +++ b/webapp/src/app/shared/services/error.service.ts @@ -0,0 +1,27 @@ +import { Injectable, signal } from '@angular/core'; + +export interface ErrorState { + statusCode: number; + title: string; + message: string; + errorDetails?: string; +} + +@Injectable({ + providedIn: 'root', +}) +export class ErrorService { + private readonly errorSignal = signal(null); + + setError(error: ErrorState): void { + this.errorSignal.set(error); + } + + clearError(): void { + this.errorSignal.set(null); + } + + getError(): ErrorState | null { + return this.errorSignal(); + } +} diff --git a/webapp/src/app/shared/ui/app-layout/app-layout.component.html b/webapp/src/app/shared/ui/app-layout/app-layout.component.html index 1c3a8d9b..6de5f1f4 100644 --- a/webapp/src/app/shared/ui/app-layout/app-layout.component.html +++ b/webapp/src/app/shared/ui/app-layout/app-layout.component.html @@ -15,45 +15,51 @@ } - -
- @if ( - mediaQuery.matches && (credentialService.authenticated | async) - ) { - + } + - } - -
- -
- -
-
+ + +
+ +
+ + }
- @if (resolverState.isResolvingFromOutside('/persons')) { - - } @else if (resolverState.isResolvingFromOutside('/person/')) { - - } @else { - - } +
+ @if (resolverState.isResolvingFromOutside('/persons')) { + + } @else if (resolverState.isResolvingFromOutside('/person/')) { + + } @else { + + } +
+ +
+ +
diff --git a/webapp/src/app/shared/ui/app-layout/app-layout.component.scss b/webapp/src/app/shared/ui/app-layout/app-layout.component.scss index 8311f123..6556c59f 100644 --- a/webapp/src/app/shared/ui/app-layout/app-layout.component.scss +++ b/webapp/src/app/shared/ui/app-layout/app-layout.component.scss @@ -18,7 +18,10 @@ } .content-shell { - min-height: 100%; + display: flex; + flex-direction: column; + height: 100%; + overflow: hidden; background: var(--sg-background); } @@ -34,10 +37,9 @@ mat-toolbar.main { gap: 24px; height: 76px; padding: 0 32px; - background: rgba(255, 255, 255, 0.92); + background: var(--sg-surface-soft); border-bottom: 1px solid var(--sg-border); color: var(--sg-text); - backdrop-filter: blur(16px); box-shadow: none; } @@ -82,10 +84,30 @@ mat-toolbar.main { } .content { - min-height: calc(100svh - 76px); + display: flex; + flex-direction: column; + flex: 1; + overflow-y: auto; background: var(--sg-background); } +.main-content-body { + flex: 1; +} + +.footer-container { + flex-shrink: 0; + padding: 12px 32px; + background: var(--sg-surface-soft); + border-top: 1px solid var(--sg-border); +} + +.footer { + font-size: 12px; + color: var(--sg-text-muted); + text-align: center; +} + @media (max-width: 900px) { mat-toolbar.main { grid-template-columns: auto 1fr auto; @@ -115,7 +137,7 @@ mat-toolbar.main { } .content { - min-height: calc(100svh - 124px); + min-height: 0; } } .search-wrapper { diff --git a/webapp/src/app/shared/ui/app-menu/app-menu.component.html b/webapp/src/app/shared/ui/app-menu/app-menu.component.html index 8e136a31..5963c6ee 100644 --- a/webapp/src/app/shared/ui/app-menu/app-menu.component.html +++ b/webapp/src/app/shared/ui/app-menu/app-menu.component.html @@ -1,5 +1,5 @@