diff --git a/alembic/versions/046ada00e750_creation_of_upscaling_tables.py b/alembic/versions/046ada00e750_creation_of_upscaling_tables.py deleted file mode 100644 index 65f6ae7..0000000 --- a/alembic/versions/046ada00e750_creation_of_upscaling_tables.py +++ /dev/null @@ -1,107 +0,0 @@ -"""creation of upscaling tables - -Revision ID: 046ada00e750 -Revises: 6105be2a2b21 -Create Date: 2025-08-22 13:22:24.266047 - -""" - -from typing import Sequence, Union - -from alembic import op -import sqlalchemy as sa - -from sqlalchemy.dialects.postgresql import ENUM as PG_ENUM - - -# revision identifiers, used by Alembic. -revision: str = "046ada00e750" -down_revision: Union[str, Sequence[str], None] = "6105be2a2b21" -branch_labels: Union[str, Sequence[str], None] = None -depends_on: Union[str, Sequence[str], None] = None - -process_type_enum = PG_ENUM( - "OPENEO", "OGC_API_PROCESS", name="processtypeenum", create_type=False -) - -processing_status_enum = PG_ENUM( - "CREATED", - "QUEUED", - "RUNNING", - "FINISHED", - "CANCELED", - "FAILED", - "UNKNOWN", - name="processingstatusenum", - create_type=False, -) - - -def upgrade() -> None: - """Upgrade schema.""" - # ### commands auto generated by Alembic - please adjust! ### - op.create_table( - "upscaling_tasks", - sa.Column("id", sa.Integer(), autoincrement=True, nullable=False), - sa.Column("title", sa.String(), nullable=False), - sa.Column("label", process_type_enum, nullable=False), - sa.Column("status", processing_status_enum, nullable=False), - sa.Column("user_id", sa.String(), nullable=False), - sa.Column("service", sa.String(), nullable=False), - sa.Column("created", sa.DateTime(), nullable=False), - sa.Column("updated", sa.DateTime(), nullable=False), - sa.PrimaryKeyConstraint("id"), - ) - op.create_index( - op.f("ix_upscaling_tasks_created"), "upscaling_tasks", ["created"], unique=False - ) - op.create_index( - op.f("ix_upscaling_tasks_id"), "upscaling_tasks", ["id"], unique=False - ) - op.create_index( - op.f("ix_upscaling_tasks_label"), "upscaling_tasks", ["label"], unique=False - ) - op.create_index( - op.f("ix_upscaling_tasks_service"), "upscaling_tasks", ["service"], unique=False - ) - op.create_index( - op.f("ix_upscaling_tasks_status"), "upscaling_tasks", ["status"], unique=False - ) - op.create_index( - op.f("ix_upscaling_tasks_title"), "upscaling_tasks", ["title"], unique=False - ) - op.create_index( - op.f("ix_upscaling_tasks_updated"), "upscaling_tasks", ["updated"], unique=False - ) - op.create_index( - op.f("ix_upscaling_tasks_user_id"), "upscaling_tasks", ["user_id"], unique=False - ) - op.add_column( - "processing_jobs", sa.Column("upscaling_task_id", sa.Integer(), nullable=True) - ) - op.create_foreign_key( - None, - "processing_jobs", - "upscaling_tasks", - ["upscaling_task_id"], - ["id"], - ondelete="SET NULL", - ) - # ### end Alembic commands ### - - -def downgrade() -> None: - """Downgrade schema.""" - # ### commands auto generated by Alembic - please adjust! ### - op.drop_constraint(None, "processing_jobs", type_="foreignkey") - op.drop_column("processing_jobs", "upscaling_task_id") - op.drop_index(op.f("ix_upscaling_tasks_user_id"), table_name="upscaling_tasks") - op.drop_index(op.f("ix_upscaling_tasks_updated"), table_name="upscaling_tasks") - op.drop_index(op.f("ix_upscaling_tasks_title"), table_name="upscaling_tasks") - op.drop_index(op.f("ix_upscaling_tasks_status"), table_name="upscaling_tasks") - op.drop_index(op.f("ix_upscaling_tasks_service"), table_name="upscaling_tasks") - op.drop_index(op.f("ix_upscaling_tasks_label"), table_name="upscaling_tasks") - op.drop_index(op.f("ix_upscaling_tasks_id"), table_name="upscaling_tasks") - op.drop_index(op.f("ix_upscaling_tasks_created"), table_name="upscaling_tasks") - op.drop_table("upscaling_tasks") - # ### end Alembic commands ### diff --git a/alembic/versions/6105be2a2b21_processing_jobs_rename_of_service_.py b/alembic/versions/6105be2a2b21_processing_jobs_rename_of_service_.py deleted file mode 100644 index c3a2083..0000000 --- a/alembic/versions/6105be2a2b21_processing_jobs_rename_of_service_.py +++ /dev/null @@ -1,38 +0,0 @@ -"""processing_jobs: rename of service_record field - -Revision ID: 6105be2a2b21 -Revises: a0ca6614c7c1 -Create Date: 2025-08-20 16:55:05.666856 - -""" -from typing import Sequence, Union - -from alembic import op -import sqlalchemy as sa - - -# revision identifiers, used by Alembic. -revision: str = '6105be2a2b21' -down_revision: Union[str, Sequence[str], None] = 'a0ca6614c7c1' -branch_labels: Union[str, Sequence[str], None] = None -depends_on: Union[str, Sequence[str], None] = None - - -def upgrade() -> None: - """Upgrade schema.""" - # ### commands auto generated by Alembic - please adjust! ### - op.add_column('processing_jobs', sa.Column('service', sa.String(), nullable=False)) - op.drop_index(op.f('ix_processing_jobs_service_record'), table_name='processing_jobs') - op.create_index(op.f('ix_processing_jobs_service'), 'processing_jobs', ['service'], unique=False) - op.drop_column('processing_jobs', 'service_record') - # ### end Alembic commands ### - - -def downgrade() -> None: - """Downgrade schema.""" - # ### commands auto generated by Alembic - please adjust! ### - op.add_column('processing_jobs', sa.Column('service_record', sa.VARCHAR(), autoincrement=False, nullable=False)) - op.drop_index(op.f('ix_processing_jobs_service'), table_name='processing_jobs') - op.create_index(op.f('ix_processing_jobs_service_record'), 'processing_jobs', ['service_record'], unique=False) - op.drop_column('processing_jobs', 'service') - # ### end Alembic commands ### diff --git a/alembic/versions/833e4a41c2ad_generation_of_tables.py b/alembic/versions/833e4a41c2ad_generation_of_tables.py new file mode 100644 index 0000000..189823e --- /dev/null +++ b/alembic/versions/833e4a41c2ad_generation_of_tables.py @@ -0,0 +1,88 @@ +"""generation of tables + +Revision ID: 833e4a41c2ad +Revises: +Create Date: 2025-11-24 13:43:40.278229 + +""" +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +from sqlalchemy.dialects import mysql + +# revision identifiers, used by Alembic. +revision: str = '833e4a41c2ad' +down_revision: Union[str, Sequence[str], None] = None +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + """Upgrade schema.""" + # ### commands auto generated by Alembic - please adjust! ### + op.create_table('upscaling_tasks', + sa.Column('id', sa.Integer(), autoincrement=True, nullable=False), + sa.Column('title', sa.String(length=255), nullable=False), + sa.Column('label', sa.Enum('OPENEO', 'OGC_API_PROCESS', name='processtypeenum'), nullable=False), + sa.Column('status', sa.Enum('CREATED', 'QUEUED', 'RUNNING', 'FINISHED', 'CANCELED', 'FAILED', 'UNKNOWN', name='processingstatusenum'), nullable=False), + sa.Column('user_id', sa.String(length=255), nullable=False), + sa.Column('service', mysql.LONGTEXT(), nullable=False), + sa.Column('created', sa.DateTime(), nullable=False), + sa.Column('updated', sa.DateTime(), nullable=False), + sa.PrimaryKeyConstraint('id') + ) + op.create_index(op.f('ix_upscaling_tasks_created'), 'upscaling_tasks', ['created'], unique=False) + op.create_index(op.f('ix_upscaling_tasks_id'), 'upscaling_tasks', ['id'], unique=False) + op.create_index(op.f('ix_upscaling_tasks_label'), 'upscaling_tasks', ['label'], unique=False) + op.create_index(op.f('ix_upscaling_tasks_status'), 'upscaling_tasks', ['status'], unique=False) + op.create_index(op.f('ix_upscaling_tasks_title'), 'upscaling_tasks', ['title'], unique=False) + op.create_index(op.f('ix_upscaling_tasks_updated'), 'upscaling_tasks', ['updated'], unique=False) + op.create_index(op.f('ix_upscaling_tasks_user_id'), 'upscaling_tasks', ['user_id'], unique=False) + op.create_table('processing_jobs', + sa.Column('id', sa.Integer(), autoincrement=True, nullable=False), + sa.Column('title', sa.String(length=255), nullable=False), + sa.Column('label', sa.Enum('OPENEO', 'OGC_API_PROCESS', name='processtypeenum'), nullable=False), + sa.Column('status', sa.Enum('CREATED', 'QUEUED', 'RUNNING', 'FINISHED', 'CANCELED', 'FAILED', 'UNKNOWN', name='processingstatusenum'), nullable=False), + sa.Column('user_id', sa.String(length=255), nullable=False), + sa.Column('platform_job_id', sa.String(length=255), nullable=True), + sa.Column('parameters', mysql.LONGTEXT(), nullable=False), + sa.Column('service', mysql.LONGTEXT(), nullable=False), + sa.Column('created', sa.DateTime(), nullable=False), + sa.Column('updated', sa.DateTime(), nullable=False), + sa.Column('upscaling_task_id', sa.Integer(), nullable=True), + sa.ForeignKeyConstraint(['upscaling_task_id'], ['upscaling_tasks.id'], ondelete='SET NULL'), + sa.PrimaryKeyConstraint('id') + ) + op.create_index(op.f('ix_processing_jobs_created'), 'processing_jobs', ['created'], unique=False) + op.create_index(op.f('ix_processing_jobs_id'), 'processing_jobs', ['id'], unique=False) + op.create_index(op.f('ix_processing_jobs_label'), 'processing_jobs', ['label'], unique=False) + op.create_index(op.f('ix_processing_jobs_platform_job_id'), 'processing_jobs', ['platform_job_id'], unique=False) + op.create_index(op.f('ix_processing_jobs_status'), 'processing_jobs', ['status'], unique=False) + op.create_index(op.f('ix_processing_jobs_title'), 'processing_jobs', ['title'], unique=False) + op.create_index(op.f('ix_processing_jobs_updated'), 'processing_jobs', ['updated'], unique=False) + op.create_index(op.f('ix_processing_jobs_user_id'), 'processing_jobs', ['user_id'], unique=False) + # ### end Alembic commands ### + + +def downgrade() -> None: + """Downgrade schema.""" + # ### commands auto generated by Alembic - please adjust! ### + op.drop_index(op.f('ix_processing_jobs_user_id'), table_name='processing_jobs') + op.drop_index(op.f('ix_processing_jobs_updated'), table_name='processing_jobs') + op.drop_index(op.f('ix_processing_jobs_title'), table_name='processing_jobs') + op.drop_index(op.f('ix_processing_jobs_status'), table_name='processing_jobs') + op.drop_index(op.f('ix_processing_jobs_platform_job_id'), table_name='processing_jobs') + op.drop_index(op.f('ix_processing_jobs_label'), table_name='processing_jobs') + op.drop_index(op.f('ix_processing_jobs_id'), table_name='processing_jobs') + op.drop_index(op.f('ix_processing_jobs_created'), table_name='processing_jobs') + op.drop_table('processing_jobs') + op.drop_index(op.f('ix_upscaling_tasks_user_id'), table_name='upscaling_tasks') + op.drop_index(op.f('ix_upscaling_tasks_updated'), table_name='upscaling_tasks') + op.drop_index(op.f('ix_upscaling_tasks_title'), table_name='upscaling_tasks') + op.drop_index(op.f('ix_upscaling_tasks_status'), table_name='upscaling_tasks') + op.drop_index(op.f('ix_upscaling_tasks_label'), table_name='upscaling_tasks') + op.drop_index(op.f('ix_upscaling_tasks_id'), table_name='upscaling_tasks') + op.drop_index(op.f('ix_upscaling_tasks_created'), table_name='upscaling_tasks') + op.drop_table('upscaling_tasks') + # ### end Alembic commands ### diff --git a/alembic/versions/8a69e1ee3fef_update_of_result_of_processing_job.py b/alembic/versions/8a69e1ee3fef_update_of_result_of_processing_job.py deleted file mode 100644 index e443493..0000000 --- a/alembic/versions/8a69e1ee3fef_update_of_result_of_processing_job.py +++ /dev/null @@ -1,32 +0,0 @@ -"""update of result of processing job - -Revision ID: 8a69e1ee3fef -Revises: 046ada00e750 -Create Date: 2025-08-25 09:40:54.675672 - -""" -from typing import Sequence, Union - -from alembic import op -import sqlalchemy as sa - - -# revision identifiers, used by Alembic. -revision: str = '8a69e1ee3fef' -down_revision: Union[str, Sequence[str], None] = '046ada00e750' -branch_labels: Union[str, Sequence[str], None] = None -depends_on: Union[str, Sequence[str], None] = None - - -def upgrade() -> None: - """Upgrade schema.""" - # ### commands auto generated by Alembic - please adjust! ### - op.drop_column('processing_jobs', 'result_link') - # ### end Alembic commands ### - - -def downgrade() -> None: - """Downgrade schema.""" - # ### commands auto generated by Alembic - please adjust! ### - op.add_column('processing_jobs', sa.Column('result_link', sa.VARCHAR(), autoincrement=False, nullable=True)) - # ### end Alembic commands ### diff --git a/alembic/versions/a0ca6614c7c1_creation_of_processing_jobs.py b/alembic/versions/a0ca6614c7c1_creation_of_processing_jobs.py deleted file mode 100644 index 0b1b0ee..0000000 --- a/alembic/versions/a0ca6614c7c1_creation_of_processing_jobs.py +++ /dev/null @@ -1,63 +0,0 @@ -"""Creation of processing jobs - -Revision ID: a0ca6614c7c1 -Revises: -Create Date: 2025-08-14 11:13:44.474344 - -""" -from typing import Sequence, Union - -from alembic import op -import sqlalchemy as sa - - -# revision identifiers, used by Alembic. -revision: str = 'a0ca6614c7c1' -down_revision: Union[str, Sequence[str], None] = None -branch_labels: Union[str, Sequence[str], None] = None -depends_on: Union[str, Sequence[str], None] = None - - -def upgrade() -> None: - """Upgrade schema.""" - # ### commands auto generated by Alembic - please adjust! ### - op.create_table('processing_jobs', - sa.Column('id', sa.Integer(), autoincrement=True, nullable=False), - sa.Column('title', sa.String(), nullable=False), - sa.Column('label', sa.Enum('OPENEO', 'OGC_API_PROCESS', name='processtypeenum'), nullable=False), - sa.Column('status', sa.Enum('CREATED', 'QUEUED', 'RUNNING', 'FINISHED', 'CANCELED', 'FAILED', 'UNKNOWN', name='processingstatusenum'), nullable=False), - sa.Column('user_id', sa.String(), nullable=False), - sa.Column('platform_job_id', sa.String(), nullable=False), - sa.Column('parameters', sa.String(), nullable=False), - sa.Column('result_link', sa.String(), nullable=True), - sa.Column('service_record', sa.String(), nullable=False), - sa.Column('created', sa.DateTime(), nullable=False), - sa.Column('updated', sa.DateTime(), nullable=False), - sa.PrimaryKeyConstraint('id') - ) - op.create_index(op.f('ix_processing_jobs_created'), 'processing_jobs', ['created'], unique=False) - op.create_index(op.f('ix_processing_jobs_id'), 'processing_jobs', ['id'], unique=False) - op.create_index(op.f('ix_processing_jobs_label'), 'processing_jobs', ['label'], unique=False) - op.create_index(op.f('ix_processing_jobs_platform_job_id'), 'processing_jobs', ['platform_job_id'], unique=False) - op.create_index(op.f('ix_processing_jobs_service_record'), 'processing_jobs', ['service_record'], unique=False) - op.create_index(op.f('ix_processing_jobs_status'), 'processing_jobs', ['status'], unique=False) - op.create_index(op.f('ix_processing_jobs_title'), 'processing_jobs', ['title'], unique=False) - op.create_index(op.f('ix_processing_jobs_updated'), 'processing_jobs', ['updated'], unique=False) - op.create_index(op.f('ix_processing_jobs_user_id'), 'processing_jobs', ['user_id'], unique=False) - # ### end Alembic commands ### - - -def downgrade() -> None: - """Downgrade schema.""" - # ### commands auto generated by Alembic - please adjust! ### - op.drop_index(op.f('ix_processing_jobs_user_id'), table_name='processing_jobs') - op.drop_index(op.f('ix_processing_jobs_updated'), table_name='processing_jobs') - op.drop_index(op.f('ix_processing_jobs_title'), table_name='processing_jobs') - op.drop_index(op.f('ix_processing_jobs_status'), table_name='processing_jobs') - op.drop_index(op.f('ix_processing_jobs_service_record'), table_name='processing_jobs') - op.drop_index(op.f('ix_processing_jobs_platform_job_id'), table_name='processing_jobs') - op.drop_index(op.f('ix_processing_jobs_label'), table_name='processing_jobs') - op.drop_index(op.f('ix_processing_jobs_id'), table_name='processing_jobs') - op.drop_index(op.f('ix_processing_jobs_created'), table_name='processing_jobs') - op.drop_table('processing_jobs') - # ### end Alembic commands ### diff --git a/alembic/versions/be54acd4d160_platform_job_id_becomes_optional.py b/alembic/versions/be54acd4d160_platform_job_id_becomes_optional.py deleted file mode 100644 index c3e2561..0000000 --- a/alembic/versions/be54acd4d160_platform_job_id_becomes_optional.py +++ /dev/null @@ -1,36 +0,0 @@ -"""platform job id becomes optional - -Revision ID: be54acd4d160 -Revises: 8a69e1ee3fef -Create Date: 2025-08-25 11:41:54.963734 - -""" -from typing import Sequence, Union - -from alembic import op -import sqlalchemy as sa - - -# revision identifiers, used by Alembic. -revision: str = 'be54acd4d160' -down_revision: Union[str, Sequence[str], None] = '8a69e1ee3fef' -branch_labels: Union[str, Sequence[str], None] = None -depends_on: Union[str, Sequence[str], None] = None - - -def upgrade() -> None: - """Upgrade schema.""" - # ### commands auto generated by Alembic - please adjust! ### - op.alter_column('processing_jobs', 'platform_job_id', - existing_type=sa.VARCHAR(), - nullable=True) - # ### end Alembic commands ### - - -def downgrade() -> None: - """Downgrade schema.""" - # ### commands auto generated by Alembic - please adjust! ### - op.alter_column('processing_jobs', 'platform_job_id', - existing_type=sa.VARCHAR(), - nullable=False) - # ### end Alembic commands ### diff --git a/app/database/models/processing_job.py b/app/database/models/processing_job.py index cfaa4b4..dd42f53 100644 --- a/app/database/models/processing_job.py +++ b/app/database/models/processing_job.py @@ -4,6 +4,7 @@ from loguru import logger from sqlalchemy import DateTime, Enum, ForeignKey, Integer, String +from sqlalchemy.dialects.mysql import LONGTEXT from sqlalchemy.orm import Mapped, Session, mapped_column from app.database.db import Base @@ -18,15 +19,15 @@ class ProcessingJobRecord(Base): id: Mapped[int] = mapped_column( Integer, primary_key=True, index=True, autoincrement=True ) - title: Mapped[str] = mapped_column(String, index=True) + title: Mapped[str] = mapped_column(String(255), index=True) label: Mapped[ProcessTypeEnum] = mapped_column(Enum(ProcessTypeEnum), index=True) status: Mapped[ProcessingStatusEnum] = mapped_column( Enum(ProcessingStatusEnum), index=True ) - user_id: Mapped[str] = mapped_column(String, index=True) - platform_job_id: Mapped[Optional[str]] = mapped_column(String, index=True) - parameters: Mapped[str] = mapped_column(String, index=False) - service: Mapped[str] = mapped_column(String, index=True) + user_id: Mapped[str] = mapped_column(String(255), index=True) + platform_job_id: Mapped[Optional[str]] = mapped_column(String(255), index=True) + parameters: Mapped[str] = mapped_column(LONGTEXT()) + service: Mapped[str] = mapped_column(LONGTEXT()) created: Mapped[datetime.datetime] = mapped_column( DateTime, default=datetime.datetime.utcnow, index=True ) diff --git a/app/database/models/upscaling_task.py b/app/database/models/upscaling_task.py index 4cbc341..f887b4b 100644 --- a/app/database/models/upscaling_task.py +++ b/app/database/models/upscaling_task.py @@ -3,6 +3,7 @@ from loguru import logger from sqlalchemy import DateTime, Enum, Integer, String +from sqlalchemy.dialects.mysql import LONGTEXT from sqlalchemy.orm import Mapped, Session, mapped_column from app.database.db import Base @@ -15,13 +16,13 @@ class UpscalingTaskRecord(Base): id: Mapped[int] = mapped_column( Integer, primary_key=True, index=True, autoincrement=True ) - title: Mapped[str] = mapped_column(String, index=True) + title: Mapped[str] = mapped_column(String(255), index=True) label: Mapped[ProcessTypeEnum] = mapped_column(Enum(ProcessTypeEnum), index=True) status: Mapped[ProcessingStatusEnum] = mapped_column( Enum(ProcessingStatusEnum), index=True ) - user_id: Mapped[str] = mapped_column(String, index=True) - service: Mapped[str] = mapped_column(String, index=True) + user_id: Mapped[str] = mapped_column(String(255), index=True) + service: Mapped[str] = mapped_column(LONGTEXT) created: Mapped[datetime.datetime] = mapped_column( DateTime, default=datetime.datetime.utcnow, index=True ) diff --git a/guides/execution_example.ipynb b/guides/execution_example.ipynb index 7dfbdee..0dcdfca 100644 --- a/guides/execution_example.ipynb +++ b/guides/execution_example.ipynb @@ -11,7 +11,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 10, "id": "0620587b-b6e9-4150-a6d3-d872171f68c5", "metadata": {}, "outputs": [ @@ -19,26 +19,76 @@ "name": "stdout", "output_type": "stream", "text": [ - "Requirement already satisfied: esa-apex-algorithms in /Users/bramjanssen/.pyenv/versions/3.10.12/lib/python3.10/site-packages (0.0.1)\n", - "Requirement already satisfied: requests>=2.30.0 in /Users/bramjanssen/.pyenv/versions/3.10.12/lib/python3.10/site-packages (from esa-apex-algorithms) (2.32.3)\n", - "Requirement already satisfied: certifi>=2017.4.17 in /Users/bramjanssen/.pyenv/versions/3.10.12/lib/python3.10/site-packages (from requests>=2.30.0->esa-apex-algorithms) (2025.1.31)\n", - "Requirement already satisfied: urllib3<3,>=1.21.1 in /Users/bramjanssen/.pyenv/versions/3.10.12/lib/python3.10/site-packages (from requests>=2.30.0->esa-apex-algorithms) (2.3.0)\n", - "Requirement already satisfied: charset-normalizer<4,>=2 in /Users/bramjanssen/.pyenv/versions/3.10.12/lib/python3.10/site-packages (from requests>=2.30.0->esa-apex-algorithms) (3.4.1)\n", - "Requirement already satisfied: idna<4,>=2.5 in /Users/bramjanssen/.pyenv/versions/3.10.12/lib/python3.10/site-packages (from requests>=2.30.0->esa-apex-algorithms) (3.10)\n", - "\n", - "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m23.0.1\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m25.3\u001b[0m\n", - "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n", + "Requirement already satisfied: esa-apex-algorithms in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (0.0.1)\n", + "Requirement already satisfied: rasterio in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (1.4.4)\n", + "Requirement already satisfied: ipyleaflet in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (0.20.0)\n", + "Requirement already satisfied: pillow in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (12.0.0)\n", + "Collecting authlib\n", + " Downloading authlib-1.6.6-py2.py3-none-any.whl.metadata (9.8 kB)\n", + "Requirement already satisfied: requests>=2.30.0 in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from esa-apex-algorithms) (2.32.4)\n", + "Requirement already satisfied: affine in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from rasterio) (2.4.0)\n", + "Requirement already satisfied: attrs in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from rasterio) (25.4.0)\n", + "Requirement already satisfied: certifi in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from rasterio) (2025.8.3)\n", + "Requirement already satisfied: click!=8.2.*,>=4.0 in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from rasterio) (8.3.1)\n", + "Requirement already satisfied: cligj>=0.5 in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from rasterio) (0.7.2)\n", + "Requirement already satisfied: numpy>=1.24 in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from rasterio) (2.3.2)\n", + "Requirement already satisfied: click-plugins in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from rasterio) (1.1.1.2)\n", + "Requirement already satisfied: pyparsing in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from rasterio) (3.3.1)\n", + "Requirement already satisfied: branca>=0.5.0 in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from ipyleaflet) (0.8.2)\n", + "Requirement already satisfied: ipywidgets<9,>=7.6.0 in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from ipyleaflet) (8.1.8)\n", + "Requirement already satisfied: jupyter-leaflet<0.21,>=0.20 in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from ipyleaflet) (0.20.0)\n", + "Requirement already satisfied: traittypes<3,>=0.2.1 in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from ipyleaflet) (0.2.3)\n", + "Requirement already satisfied: xyzservices>=2021.8.1 in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from ipyleaflet) (2025.11.0)\n", + "Requirement already satisfied: comm>=0.1.3 in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from ipywidgets<9,>=7.6.0->ipyleaflet) (0.2.3)\n", + "Requirement already satisfied: ipython>=6.1.0 in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from ipywidgets<9,>=7.6.0->ipyleaflet) (9.8.0)\n", + "Requirement already satisfied: traitlets>=4.3.1 in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from ipywidgets<9,>=7.6.0->ipyleaflet) (5.14.3)\n", + "Requirement already satisfied: widgetsnbextension~=4.0.14 in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from ipywidgets<9,>=7.6.0->ipyleaflet) (4.0.15)\n", + "Requirement already satisfied: jupyterlab_widgets~=3.0.15 in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from ipywidgets<9,>=7.6.0->ipyleaflet) (3.0.16)\n", + "Requirement already satisfied: cryptography in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from authlib) (46.0.3)\n", + "Requirement already satisfied: jinja2>=3 in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from branca>=0.5.0->ipyleaflet) (3.1.6)\n", + "Requirement already satisfied: colorama in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from click!=8.2.*,>=4.0->rasterio) (0.4.6)\n", + "Requirement already satisfied: decorator>=4.3.2 in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from ipython>=6.1.0->ipywidgets<9,>=7.6.0->ipyleaflet) (5.2.1)\n", + "Requirement already satisfied: ipython-pygments-lexers>=1.0.0 in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from ipython>=6.1.0->ipywidgets<9,>=7.6.0->ipyleaflet) (1.1.1)\n", + "Requirement already satisfied: jedi>=0.18.1 in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from ipython>=6.1.0->ipywidgets<9,>=7.6.0->ipyleaflet) (0.19.2)\n", + "Requirement already satisfied: matplotlib-inline>=0.1.5 in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from ipython>=6.1.0->ipywidgets<9,>=7.6.0->ipyleaflet) (0.2.1)\n", + "Requirement already satisfied: prompt_toolkit<3.1.0,>=3.0.41 in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from ipython>=6.1.0->ipywidgets<9,>=7.6.0->ipyleaflet) (3.0.52)\n", + "Requirement already satisfied: pygments>=2.11.0 in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from ipython>=6.1.0->ipywidgets<9,>=7.6.0->ipyleaflet) (2.19.2)\n", + "Requirement already satisfied: stack_data>=0.6.0 in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from ipython>=6.1.0->ipywidgets<9,>=7.6.0->ipyleaflet) (0.6.3)\n", + "Requirement already satisfied: wcwidth in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from prompt_toolkit<3.1.0,>=3.0.41->ipython>=6.1.0->ipywidgets<9,>=7.6.0->ipyleaflet) (0.2.14)\n", + "Requirement already satisfied: parso<0.9.0,>=0.8.4 in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from jedi>=0.18.1->ipython>=6.1.0->ipywidgets<9,>=7.6.0->ipyleaflet) (0.8.5)\n", + "Requirement already satisfied: MarkupSafe>=2.0 in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from jinja2>=3->branca>=0.5.0->ipyleaflet) (3.0.3)\n", + "Requirement already satisfied: charset_normalizer<4,>=2 in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from requests>=2.30.0->esa-apex-algorithms) (3.4.2)\n", + "Requirement already satisfied: idna<4,>=2.5 in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from requests>=2.30.0->esa-apex-algorithms) (3.10)\n", + "Requirement already satisfied: urllib3<3,>=1.21.1 in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from requests>=2.30.0->esa-apex-algorithms) (2.5.0)\n", + "Requirement already satisfied: executing>=1.2.0 in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from stack_data>=0.6.0->ipython>=6.1.0->ipywidgets<9,>=7.6.0->ipyleaflet) (2.2.1)\n", + "Requirement already satisfied: asttokens>=2.1.0 in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from stack_data>=0.6.0->ipython>=6.1.0->ipywidgets<9,>=7.6.0->ipyleaflet) (3.0.1)\n", + "Requirement already satisfied: pure-eval in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from stack_data>=0.6.0->ipython>=6.1.0->ipywidgets<9,>=7.6.0->ipyleaflet) (0.2.3)\n", + "Requirement already satisfied: cffi>=2.0.0 in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from cryptography->authlib) (2.0.0)\n", + "Requirement already satisfied: pycparser in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from cffi>=2.0.0->cryptography->authlib) (2.23)\n", + "Downloading authlib-1.6.6-py2.py3-none-any.whl (244 kB)\n", + "Installing collected packages: authlib\n", + "Successfully installed authlib-1.6.6\n", "Note: you may need to restart the kernel to use updated packages.\n" ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Could not find platform independent libraries \n", + "\n", + "[notice] A new release of pip is available: 25.1.1 -> 25.3\n", + "[notice] To update, run: python.exe -m pip install --upgrade pip\n" + ] } ], "source": [ - "%pip install esa-apex-algorithms" + "%pip install esa-apex-algorithms rasterio ipyleaflet pillow authlib" ] }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 11, "id": "d99f5fbc", "metadata": {}, "outputs": [], @@ -67,7 +117,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 12, "id": "e8c7ffff-4d0a-4e0c-bc98-44f90316f20c", "metadata": {}, "outputs": [], @@ -90,7 +140,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 13, "id": "4139eacf-03a4-4815-83d2-b2ee04e90331", "metadata": {}, "outputs": [], @@ -120,7 +170,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 14, "id": "760e4d46-7e14-471c-b517-c62232f72fae", "metadata": {}, "outputs": [], @@ -134,14 +184,16 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 15, "id": "16c3fbf4-dde4-49ab-a7d3-87e8ccc40664", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "['wind_turbine',\n", + "['RAMONA-herbaceous_rangeland_biomass-country-mosaick',\n", + " 'wind_turbine',\n", + " 'sen2like',\n", " 'eurac_pv_farm_detection',\n", " 'gep_bas',\n", " 'gep_ost',\n", @@ -149,20 +201,23 @@ " 'snap_insar_sentinel1_iw_slc',\n", " 'bap_composite',\n", " 'biopar',\n", - " 'fusets_mogpr',\n", " 'max_ndvi',\n", " 'max_ndvi_composite',\n", + " 'mogpr_s1s2',\n", " 'parcel_delineation',\n", + " 'peakvalley',\n", + " 'phenology',\n", " 'random_forest_firemapping',\n", " 'sentinel1_stats',\n", " 'variabilitymap',\n", + " 'whittaker',\n", " 'worldcereal_crop_extent',\n", " 'worldcereal_crop_type',\n", " 'worldcover_statistics',\n", " 'worldagrocommodities']" ] }, - "execution_count": 6, + "execution_count": 15, "metadata": {}, "output_type": "execute_result" } @@ -173,7 +228,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 16, "id": "ba7499b0-a4f6-4dc4-a11d-a6f204efdaa0", "metadata": {}, "outputs": [], @@ -183,7 +238,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 17, "id": "3c23c79f-971c-4355-88b9-87bc3c41568f", "metadata": {}, "outputs": [ @@ -193,7 +248,7 @@ "Algorithm(id='eurac_pv_farm_detection', title='Photovoltaic farms mapping', description='Demonstrator service for the detection of photovoltaic farms. Photovoltaic farms (PV farms) mapping is essential for establishing valid policies regarding natural resources management and clean energy. ', udp_link=UdpLink(href='https://raw.githubusercontent.com/ESA-APEx/apex_algorithms/refs/heads/main/algorithm_catalog/eurac/eurac_pv_farm_detection/openeo_udp/eurac_pv_farm_detection.json', title='openEO Process Definition'), service_links=[ServiceLink(href='https://openeofed.dataspace.copernicus.eu', title='CDSE openEO federation')], license=None, organization='Eurac Research')" ] }, - "execution_count": 8, + "execution_count": 17, "metadata": {}, "output_type": "execute_result" } @@ -212,17 +267,17 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 18, "id": "f95065a9", "metadata": {}, "outputs": [], "source": [ - "dispatch_api = \"localhost:8000\"" + "dispatch_api = \"dispatch-api.dev.apex.esa.int\"" ] }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 19, "id": "c83aa9d5", "metadata": {}, "outputs": [], @@ -245,7 +300,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 20, "id": "53d0800c-a6b3-4a64-a7a2-f27689adc7d7", "metadata": {}, "outputs": [], @@ -257,14 +312,14 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 21, "id": "6de8d686", "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "64d0258c1ba5405492fe6dd0358a5d3d", + "model_id": "99d509006acb4c8389b0cd8bfafbe8da", "version_major": 2, "version_minor": 0 }, @@ -272,7 +327,7 @@ "Map(center=[47.985, 16.378000000000004], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_t…" ] }, - "execution_count": 12, + "execution_count": 21, "metadata": {}, "output_type": "execute_result" } @@ -300,7 +355,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 22, "id": "47c7fe82-b611-404c-9cb8-204497dbec57", "metadata": {}, "outputs": [], @@ -311,7 +366,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 23, "id": "b5ee27f5-9e69-4557-ba83-ec7cb74aa874", "metadata": {}, "outputs": [], @@ -372,7 +427,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 24, "id": "c5ca3fdd-7559-4fc7-8318-61b5dc59475f", "metadata": {}, "outputs": [ @@ -380,21 +435,32 @@ "name": "stdout", "output_type": "stream", "text": [ - "Open this URL in your browser: https://auth.dev.apex.esa.int/realms/apex/protocol/openid-connect/auth?response_type=code&client_id=apex-dispatcher-api-dev&redirect_uri=http%3A%2F%2Flocalhost%3A8000%2Fcallback&state=13LGG7k5j3LJXZg9gkzwCyTqCEMIGU\n" + "Open this URL in your browser: https://auth.dev.apex.esa.int/realms/apex/protocol/openid-connect/auth?response_type=code&client_id=apex-dispatcher-api-dev&redirect_uri=http%3A%2F%2Flocalhost%3A8000%2Fcallback&state=arE6JvoFNDGmfQgfC0ur1garn3rAeM\n" ] }, { "name": "stdin", "output_type": "stream", "text": [ - "Paste the redirect URL here: http://localhost:8000/callback?state=13LGG7k5j3LJXZg9gkzwCyTqCEMIGU&session_state=2851af12-bde4-4034-b4ad-4a9e5501345f&iss=https%3A%2F%2Fauth.dev.apex.esa.int%2Frealms%2Fapex&code=d0d5bec8-7a7c-4230-b0ff-8ecd6bab4e54.2851af12-bde4-4034-b4ad-4a9e5501345f.c2e791df-00a5-4981-b8af-b014848a2b73\n" + "Paste the redirect URL here: http://localhost:8000/callback?state=arE6JvoFNDGmfQgfC0ur1garn3rAeM&session_state=4b90324c-17c8-4c37-9f74-a87b0a830505&iss=https%3A%2F%2Fauth.dev.apex.esa.int%2Frealms%2Fapex&code=90520799-7ed0-4c9a-ab96-fd3331756692.4b90324c-17c8-4c37-9f74-a87b0a830505.ffef7bfc-a27e-4abd-aa7f-9e0925d275a9\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "{'id': 195, 'title': 'PV Farm Detection', 'label': 'openeo', 'status': 'created', 'service': {'endpoint': 'https://openeofed.dataspace.copernicus.eu', 'application': 'https://raw.githubusercontent.com/ESA-APEx/apex_algorithms/refs/heads/main/algorithm_catalog/eurac/eurac_pv_farm_detection/openeo_udp/eurac_pv_farm_detection.json'}, 'parameters': {'spatial_extent': {'west': 16.342, 'south': 47.962, 'east': 16.414, 'north': 48.008}, 'temporal_extent': ['2023-05-01', '2023-09-30']}}\n" + "{'status': 'error', 'error_code': 'AUTHENTICATION_FAILED', 'message': 'Token exchange not configured on the server (missing client credentials).', 'details': None, 'request_id': '31e25cfe-7bfd-4bbb-9bae-9ffe0ef0032b'}\n" + ] + }, + { + "ename": "KeyError", + "evalue": "'id'", + "output_type": "error", + "traceback": [ + "\u001b[31m---------------------------------------------------------------------------\u001b[39m", + "\u001b[31mKeyError\u001b[39m Traceback (most recent call last)", + "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[24]\u001b[39m\u001b[32m, line 21\u001b[39m\n\u001b[32m 1\u001b[39m execution_task = requests.post(\n\u001b[32m 2\u001b[39m \u001b[33mf\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mhttp://\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mdispatch_api\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m/unit_jobs\u001b[39m\u001b[33m\"\u001b[39m, \n\u001b[32m 3\u001b[39m headers={\n\u001b[32m (...)\u001b[39m\u001b[32m 18\u001b[39m }\n\u001b[32m 19\u001b[39m )\n\u001b[32m 20\u001b[39m \u001b[38;5;28mprint\u001b[39m(execution_task.json())\n\u001b[32m---> \u001b[39m\u001b[32m21\u001b[39m execution_task_id = \u001b[43mexecution_task\u001b[49m\u001b[43m.\u001b[49m\u001b[43mjson\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m[\u001b[49m\u001b[33;43m'\u001b[39;49m\u001b[33;43mid\u001b[39;49m\u001b[33;43m'\u001b[39;49m\u001b[43m]\u001b[49m\n", + "\u001b[31mKeyError\u001b[39m: 'id'" ] } ], @@ -596,7 +662,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.12" + "version": "3.13.5" } }, "nbformat": 4, diff --git a/guides/sync_example.ipynb b/guides/sync_example.ipynb index a172a60..8030da6 100644 --- a/guides/sync_example.ipynb +++ b/guides/sync_example.ipynb @@ -11,7 +11,39 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 1, + "id": "157bce28-c04c-4a65-8dae-05789c84d8ae", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Requirement already satisfied: authlib in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (1.6.6)\n", + "Requirement already satisfied: cryptography in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from authlib) (46.0.3)\n", + "Requirement already satisfied: cffi>=2.0.0 in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from cryptography->authlib) (2.0.0)\n", + "Requirement already satisfied: pycparser in c:\\dev\\projects\\apex\\apex_dispatch_api\\venv\\lib\\site-packages (from cffi>=2.0.0->cryptography->authlib) (2.23)\n", + "Note: you may need to restart the kernel to use updated packages.\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Could not find platform independent libraries \n", + "\n", + "[notice] A new release of pip is available: 25.1.1 -> 25.3\n", + "[notice] To update, run: python.exe -m pip install --upgrade pip\n" + ] + } + ], + "source": [ + "%pip install authlib matplotlib" + ] + }, + { + "cell_type": "code", + "execution_count": 1, "id": "44153806-d0e1-47a1-9978-f30987617d3e", "metadata": {}, "outputs": [], @@ -35,7 +67,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 2, "id": "20bf970c-b906-4af4-85a6-be41dc8f1855", "metadata": {}, "outputs": [], @@ -45,7 +77,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 3, "id": "92558b9d-1a2e-41c3-8013-4e6f40e9be31", "metadata": {}, "outputs": [ @@ -166,7 +198,7 @@ "" ] }, - "execution_count": 11, + "execution_count": 3, "metadata": { "application/json": { "expanded": false, @@ -190,7 +222,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 4, "id": "b6306fce-e1e3-4b00-a361-787c153d50a1", "metadata": {}, "outputs": [], @@ -200,7 +232,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 5, "id": "d7107144-9fa0-4ae1-97e7-5cacc71b9bfd", "metadata": {}, "outputs": [], @@ -210,7 +242,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 6, "id": "13d0a985-3ce9-4bb7-8caf-ef064046bd65", "metadata": {}, "outputs": [], @@ -220,7 +252,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 7, "id": "655a0426-fc82-4b48-9663-79069eb53b77", "metadata": {}, "outputs": [], @@ -241,7 +273,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 8, "id": "47c7fe82-b611-404c-9cb8-204497dbec57", "metadata": {}, "outputs": [], @@ -252,7 +284,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 9, "id": "b5ee27f5-9e69-4557-ba83-ec7cb74aa874", "metadata": {}, "outputs": [], @@ -313,7 +345,7 @@ }, { "cell_type": "code", - "execution_count": 48, + "execution_count": 10, "id": "c5ca3fdd-7559-4fc7-8318-61b5dc59475f", "metadata": {}, "outputs": [ @@ -321,8 +353,22 @@ "name": "stdout", "output_type": "stream", "text": [ - "CPU times: user 10.2 ms, sys: 24.5 ms, total: 34.7 ms\n", - "Wall time: 17.5 s\n" + "Open this URL in your browser: https://auth.dev.apex.esa.int/realms/apex/protocol/openid-connect/auth?response_type=code&client_id=apex-dispatcher-api-dev&redirect_uri=http%3A%2F%2Flocalhost%3A8000%2Fcallback&state=tTUobBdPyND9JMazafGNgZTXEN9nDG\n" + ] + }, + { + "name": "stdin", + "output_type": "stream", + "text": [ + "Paste the redirect URL here: http://localhost:8000/callback?state=tTUobBdPyND9JMazafGNgZTXEN9nDG&session_state=98b26b4b-0459-4c0a-8ac0-49ff8517249f&iss=https%3A%2F%2Fauth.dev.apex.esa.int%2Frealms%2Fapex&code=f623a099-ac35-4b00-ab54-24ff2baccc72.98b26b4b-0459-4c0a-8ac0-49ff8517249f.4481708c-e156-4cb5-b27e-16f8144dc26c\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "CPU times: user 1.56 s, sys: 764 ms, total: 2.32 s\n", + "Wall time: 3min 40s\n" ] } ], @@ -356,7 +402,7 @@ }, { "cell_type": "code", - "execution_count": 49, + "execution_count": 11, "id": "bd662ae9-2660-4b36-87f6-d75163ad30ff", "metadata": {}, "outputs": [], @@ -366,7 +412,7 @@ }, { "cell_type": "code", - "execution_count": 50, + "execution_count": 12, "id": "68c15b90-5519-422c-861b-64a0fd9f1e90", "metadata": {}, "outputs": [ @@ -429,7 +475,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.12" + "version": "3.13.5" } }, "nbformat": 4, diff --git a/guides/upscaling_example.ipynb b/guides/upscaling_example.ipynb index 3c7e07c..1f6f458 100644 --- a/guides/upscaling_example.ipynb +++ b/guides/upscaling_example.ipynb @@ -11,29 +11,12 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "5b52c73f-779b-49c2-99bf-7ab5a9e84aa5", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Requirement already satisfied: esa-apex-algorithms in /Users/bramjanssen/.pyenv/versions/3.10.12/lib/python3.10/site-packages (0.0.1)\n", - "Requirement already satisfied: requests>=2.30.0 in /Users/bramjanssen/.pyenv/versions/3.10.12/lib/python3.10/site-packages (from esa-apex-algorithms) (2.32.3)\n", - "Requirement already satisfied: urllib3<3,>=1.21.1 in /Users/bramjanssen/.pyenv/versions/3.10.12/lib/python3.10/site-packages (from requests>=2.30.0->esa-apex-algorithms) (2.3.0)\n", - "Requirement already satisfied: idna<4,>=2.5 in /Users/bramjanssen/.pyenv/versions/3.10.12/lib/python3.10/site-packages (from requests>=2.30.0->esa-apex-algorithms) (3.10)\n", - "Requirement already satisfied: certifi>=2017.4.17 in /Users/bramjanssen/.pyenv/versions/3.10.12/lib/python3.10/site-packages (from requests>=2.30.0->esa-apex-algorithms) (2025.1.31)\n", - "Requirement already satisfied: charset-normalizer<4,>=2 in /Users/bramjanssen/.pyenv/versions/3.10.12/lib/python3.10/site-packages (from requests>=2.30.0->esa-apex-algorithms) (3.4.1)\n", - "\n", - "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m23.0.1\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m25.3\u001b[0m\n", - "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n", - "Note: you may need to restart the kernel to use updated packages.\n" - ] - } - ], + "outputs": [], "source": [ - "%pip install esa-apex-algorithms" + "%pip install esa-apex-algorithms rasterio ipyleaflet pillow authlib" ] }, { @@ -172,38 +155,38 @@ "metadata": {}, "outputs": [], "source": [ - "dispatch_api = \"localhost:8000\"" + "dispatch_api = \"dispatch-api.dev.apex.esa.int\"" ] }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 21, "id": "c83aa9d5", "metadata": {}, "outputs": [], "source": [ - "spatial_extent = {\n", + "spatial_extent ={\n", " \"coordinates\": [\n", " [\n", " [\n", - " 16.148187382518586,\n", - " 48.33760911876428\n", + " 16.14820803974601,\n", + " 48.3081456959695\n", " ],\n", " [\n", - " 16.148187382518586,\n", - " 48.06620807624728\n", + " 16.14820803974601,\n", + " 48.0326396134746\n", " ],\n", " [\n", - " 16.62751804693653,\n", - " 48.06620807624728\n", + " 16.70922281740272,\n", + " 48.0326396134746\n", " ],\n", " [\n", - " 16.62751804693653,\n", - " 48.33760911876428\n", + " 16.70922281740272,\n", + " 48.3081456959695\n", " ],\n", " [\n", - " 16.148187382518586,\n", - " 48.33760911876428\n", + " 16.14820803974601,\n", + " 48.3081456959695\n", " ]\n", " ]\n", " ],\n", @@ -215,7 +198,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 22, "id": "53d0800c-a6b3-4a64-a7a2-f27689adc7d7", "metadata": {}, "outputs": [], @@ -236,7 +219,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 23, "id": "47c7fe82-b611-404c-9cb8-204497dbec57", "metadata": {}, "outputs": [], @@ -247,7 +230,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 24, "id": "b5ee27f5-9e69-4557-ba83-ec7cb74aa874", "metadata": {}, "outputs": [], @@ -307,7 +290,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 25, "id": "e0618338", "metadata": {}, "outputs": [ @@ -315,7 +298,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Processing 9 tiles for area of interest\n" + "Processing 12 tiles for area of interest\n" ] } ], @@ -329,22 +312,22 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 26, "id": "6de8d686", "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "68d472f3512f4321bdfe6286c0eb8029", + "model_id": "37df1a3eb1c749fc9ae80cb45d907a4e", "version_major": 2, "version_minor": 0 }, "text/plain": [ - "Map(center=[48.201908597505785, 16.387852714727558], controls=(ZoomControl(options=['position', 'zoom_in_text'…" + "Map(center=[48.17039265472205, 16.42871542857436], controls=(ZoomControl(options=['position', 'zoom_in_text', …" ] }, - "execution_count": 13, + "execution_count": 26, "metadata": {}, "output_type": "execute_result" } @@ -373,20 +356,34 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 27, "id": "c5ca3fdd-7559-4fc7-8318-61b5dc59475f", "metadata": {}, "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Open this URL in your browser: https://auth.dev.apex.esa.int/realms/apex/protocol/openid-connect/auth?response_type=code&client_id=apex-dispatcher-api-dev&redirect_uri=http%3A%2F%2Flocalhost%3A8000%2Fcallback&state=55hzS7XHezhzT1iJ7FfvSsjfHyflzx\n" + ] + }, + { + "name": "stdin", + "output_type": "stream", + "text": [ + "Paste the redirect URL here: http://localhost:8000/callback?state=55hzS7XHezhzT1iJ7FfvSsjfHyflzx&session_state=dcec5829-f03e-4360-9e37-8189ac7fc305&iss=https%3A%2F%2Fauth.dev.apex.esa.int%2Frealms%2Fapex&code=a9fabf9d-d444-4706-9b17-1201d424ec6a.dcec5829-f03e-4360-9e37-8189ac7fc305.ffef7bfc-a27e-4abd-aa7f-9e0925d275a9\n" + ] + }, { "data": { "text/plain": [ - "{'id': 14,\n", + "{'id': 1,\n", " 'title': 'Upscalinge - PV Detection',\n", " 'label': 'openeo',\n", " 'status': 'created'}" ] }, - "execution_count": 18, + "execution_count": 27, "metadata": {}, "output_type": "execute_result" } @@ -429,7 +426,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 28, "id": "02e5c413-d110-4110-be59-c86e5226edc5", "metadata": {}, "outputs": [], @@ -472,38 +469,45 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 30, "id": "ac428293-7cd4-49a8-9bfa-4e0dc8f4d2cc", "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "a48eeee1172342cf8fa7a6efab0a660a", + "model_id": "9fe6293bcee44e81812d7033c921e289", "version_major": 2, "version_minor": 0 }, "text/plain": [ - "Map(center=[48.201908597505785, 16.387852714727558], controls=(ZoomControl(options=['position', 'zoom_in_text'…" + "Map(center=[48.17039265472205, 16.42871542857436], controls=(ZoomControl(options=['position', 'zoom_in_text', …" ] }, "metadata": {}, "output_type": "display_data" }, { - "name": "stdout", - "output_type": "stream", - "text": [ - "Job finished with status finished\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/var/folders/50/09_2zmx12zj6ks4fdl4y9wgc0000gn/T/ipykernel_65314/627856076.py:81: RuntimeWarning: coroutine 'Connection.close' was never awaited\n", - " websocket.close()\n", - "RuntimeWarning: Enable tracemalloc to get the object allocation traceback\n" + "ename": "InvalidURI", + "evalue": "https://dispatch-api.dev.apex.esa.int/ws/upscale_tasks/1?interval=15&token=eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJTaEs1c1JIR0lLYlJlRXF6azZlenZxamdiZWdvVFJnQnRqQUxMSmtZdmZBIn0.eyJleHAiOjE3NjM5ODg5NzcsImlhdCI6MTc2Mzk4ODY3NywiYXV0aF90aW1lIjoxNzYzOTg4Njc0LCJqdGkiOiI0NDg0Nzc3Yi1jMjZkLTQ3YmYtOGY5Yi04ZjNiZThhMjZhOTMiLCJpc3MiOiJodHRwczovL2F1dGguZGV2LmFwZXguZXNhLmludC9yZWFsbXMvYXBleCIsInN1YiI6ImFmNDgyNjNkLTRkY2ItNGVkMy04MzA3LTA4MDAwY2I0ODU1MCIsInR5cCI6IkJlYXJlciIsImF6cCI6ImFwZXgtZGlzcGF0Y2hlci1hcGktZGV2Iiwic2lkIjoiZGNlYzU4MjktZjAzZS00MzYwLTllMzctODE4OWFjN2ZjMzA1IiwiYWNyIjoiMSIsImFsbG93ZWQtb3JpZ2lucyI6WyJodHRwOi8vbG9jYWxob3N0Il0sInNjb3BlIjoicHJvZmlsZSBlbWFpbCIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJuYW1lIjoiQnJhbSBKYW5zc2VuIiwicHJlZmVycmVkX3VzZXJuYW1lIjoiYnJhbS5qYW5zc2VuQHZpdG8uYmUiLCJnaXZlbl9uYW1lIjoiQnJhbSIsImZhbWlseV9uYW1lIjoiSmFuc3NlbiIsImVtYWlsIjoiYnJhbS5qYW5zc2VuQHZpdG8uYmUifQ.wRyqxRBWtsoS9-e8Xh8oWD_ommcAVqBwzYsDqF8O7dNCTw5I0KI2UCArSfRs1jfMFISvZVXMlym-TDCLrcd2tiXnkax02L9w1jBiN7tXL99aQ87zzaKsSEDJRp9hygMcp_uyxDGUNWXBiuwwg12Urc1SmEboOPVrEqA_E4mom-1VmXa_eQgiUlube3qQ8HvGtwv6JtKKvhDOXiysksKWRr175ggwXS-Mzu529W1IpXTXBZvhvGn_B5Nflff-pB959hgK7KPf8cSDcZJ0tR__06cFwNSEAVo12NAK1oPdbFHFj9mKuOFXZG0vW_vl__5HKkrtF36VUgvTURgKYarE6Q isn't a valid URI: scheme isn't ws or wss", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mInvalidStatus\u001b[0m Traceback (most recent call last)", + "File \u001b[0;32m~/.pyenv/versions/3.10.12/lib/python3.10/site-packages/websockets/asyncio/client.py:543\u001b[0m, in \u001b[0;36mconnect.__await_impl__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 542\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 543\u001b[0m \u001b[38;5;28;01mawait\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mconnection\u001b[38;5;241m.\u001b[39mhandshake(\n\u001b[1;32m 544\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39madditional_headers,\n\u001b[1;32m 545\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39muser_agent_header,\n\u001b[1;32m 546\u001b[0m )\n\u001b[1;32m 547\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m asyncio\u001b[38;5;241m.\u001b[39mCancelledError:\n", + "File \u001b[0;32m~/.pyenv/versions/3.10.12/lib/python3.10/site-packages/websockets/asyncio/client.py:114\u001b[0m, in \u001b[0;36mClientConnection.handshake\u001b[0;34m(self, additional_headers, user_agent_header)\u001b[0m\n\u001b[1;32m 113\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mprotocol\u001b[38;5;241m.\u001b[39mhandshake_exc \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m--> 114\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mprotocol\u001b[38;5;241m.\u001b[39mhandshake_exc\n", + "File \u001b[0;32m~/.pyenv/versions/3.10.12/lib/python3.10/site-packages/websockets/client.py:325\u001b[0m, in \u001b[0;36mClientProtocol.parse\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 324\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 325\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mprocess_response\u001b[49m\u001b[43m(\u001b[49m\u001b[43mresponse\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 326\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m InvalidHandshake \u001b[38;5;28;01mas\u001b[39;00m exc:\n", + "File \u001b[0;32m~/.pyenv/versions/3.10.12/lib/python3.10/site-packages/websockets/client.py:142\u001b[0m, in \u001b[0;36mClientProtocol.process_response\u001b[0;34m(self, response)\u001b[0m\n\u001b[1;32m 141\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m response\u001b[38;5;241m.\u001b[39mstatus_code \u001b[38;5;241m!=\u001b[39m \u001b[38;5;241m101\u001b[39m:\n\u001b[0;32m--> 142\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m InvalidStatus(response)\n\u001b[1;32m 144\u001b[0m headers \u001b[38;5;241m=\u001b[39m response\u001b[38;5;241m.\u001b[39mheaders\n", + "\u001b[0;31mInvalidStatus\u001b[0m: server rejected WebSocket connection: HTTP 308", + "\nDuring handling of the above exception, another exception occurred:\n", + "\u001b[0;31mInvalidURI\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[30], line 85\u001b[0m\n\u001b[1;32m 82\u001b[0m \u001b[38;5;28;01mbreak\u001b[39;00m\n\u001b[1;32m 84\u001b[0m \u001b[38;5;66;03m# Run the websocket listener in the notebook\u001b[39;00m\n\u001b[0;32m---> 85\u001b[0m \u001b[38;5;28;01mawait\u001b[39;00m listen_for_updates()\n", + "Cell \u001b[0;32mIn[30], line 51\u001b[0m, in \u001b[0;36mlisten_for_updates\u001b[0;34m()\u001b[0m\n\u001b[1;32m 49\u001b[0m \u001b[38;5;28;01masync\u001b[39;00m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;21mlisten_for_updates\u001b[39m():\n\u001b[1;32m 50\u001b[0m ws_url \u001b[38;5;241m=\u001b[39m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mws://\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mdispatch_api\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m/ws/upscale_tasks/\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mupscaling_task_id\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m?interval=15&token=\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mget_access_token()\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m---> 51\u001b[0m \u001b[38;5;28;01masync\u001b[39;00m \u001b[38;5;28;01mwith\u001b[39;00m websockets\u001b[38;5;241m.\u001b[39mconnect(ws_url) \u001b[38;5;28;01mas\u001b[39;00m websocket:\n\u001b[1;32m 52\u001b[0m \u001b[38;5;28;01mwhile\u001b[39;00m \u001b[38;5;28;01mTrue\u001b[39;00m:\n\u001b[1;32m 53\u001b[0m message \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mawait\u001b[39;00m websocket\u001b[38;5;241m.\u001b[39mrecv()\n", + "File \u001b[0;32m~/.pyenv/versions/3.10.12/lib/python3.10/site-packages/websockets/asyncio/client.py:587\u001b[0m, in \u001b[0;36mconnect.__aenter__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 586\u001b[0m \u001b[38;5;28;01masync\u001b[39;00m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;21m__aenter__\u001b[39m(\u001b[38;5;28mself\u001b[39m) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m ClientConnection:\n\u001b[0;32m--> 587\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;01mawait\u001b[39;00m \u001b[38;5;28mself\u001b[39m\n", + "File \u001b[0;32m~/.pyenv/versions/3.10.12/lib/python3.10/site-packages/websockets/asyncio/client.py:559\u001b[0m, in \u001b[0;36mconnect.__await_impl__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 550\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m exc:\n\u001b[1;32m 551\u001b[0m \u001b[38;5;66;03m# Always close the connection even though keep-alive is\u001b[39;00m\n\u001b[1;32m 552\u001b[0m \u001b[38;5;66;03m# the default in HTTP/1.1 because create_connection ties\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 555\u001b[0m \u001b[38;5;66;03m# no easy way to reuse the network connection that works\u001b[39;00m\n\u001b[1;32m 556\u001b[0m \u001b[38;5;66;03m# in every case nor to reinitialize the protocol.\u001b[39;00m\n\u001b[1;32m 557\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mconnection\u001b[38;5;241m.\u001b[39mtransport\u001b[38;5;241m.\u001b[39mabort()\n\u001b[0;32m--> 559\u001b[0m uri_or_exc \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mprocess_redirect\u001b[49m\u001b[43m(\u001b[49m\u001b[43mexc\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 560\u001b[0m \u001b[38;5;66;03m# Response is a valid redirect; follow it.\u001b[39;00m\n\u001b[1;32m 561\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(uri_or_exc, \u001b[38;5;28mstr\u001b[39m):\n", + "File \u001b[0;32m~/.pyenv/versions/3.10.12/lib/python3.10/site-packages/websockets/asyncio/client.py:494\u001b[0m, in \u001b[0;36mconnect.process_redirect\u001b[0;34m(self, exc)\u001b[0m\n\u001b[1;32m 492\u001b[0m old_ws_uri \u001b[38;5;241m=\u001b[39m parse_uri(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39muri)\n\u001b[1;32m 493\u001b[0m new_uri \u001b[38;5;241m=\u001b[39m urllib\u001b[38;5;241m.\u001b[39mparse\u001b[38;5;241m.\u001b[39murljoin(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39muri, exc\u001b[38;5;241m.\u001b[39mresponse\u001b[38;5;241m.\u001b[39mheaders[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mLocation\u001b[39m\u001b[38;5;124m\"\u001b[39m])\n\u001b[0;32m--> 494\u001b[0m new_ws_uri \u001b[38;5;241m=\u001b[39m \u001b[43mparse_uri\u001b[49m\u001b[43m(\u001b[49m\u001b[43mnew_uri\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 496\u001b[0m \u001b[38;5;66;03m# If connect() received a socket, it is closed and cannot be reused.\u001b[39;00m\n\u001b[1;32m 497\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mconnection_kwargs\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124msock\u001b[39m\u001b[38;5;124m\"\u001b[39m) \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n", + "File \u001b[0;32m~/.pyenv/versions/3.10.12/lib/python3.10/site-packages/websockets/uri.py:77\u001b[0m, in \u001b[0;36mparse_uri\u001b[0;34m(uri)\u001b[0m\n\u001b[1;32m 75\u001b[0m parsed \u001b[38;5;241m=\u001b[39m urllib\u001b[38;5;241m.\u001b[39mparse\u001b[38;5;241m.\u001b[39murlparse(uri)\n\u001b[1;32m 76\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m parsed\u001b[38;5;241m.\u001b[39mscheme \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m [\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mws\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mwss\u001b[39m\u001b[38;5;124m\"\u001b[39m]:\n\u001b[0;32m---> 77\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m InvalidURI(uri, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mscheme isn\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mt ws or wss\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 78\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m parsed\u001b[38;5;241m.\u001b[39mhostname \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 79\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m InvalidURI(uri, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mhostname isn\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mt provided\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n", + "\u001b[0;31mInvalidURI\u001b[0m: https://dispatch-api.dev.apex.esa.int/ws/upscale_tasks/1?interval=15&token=eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJTaEs1c1JIR0lLYlJlRXF6azZlenZxamdiZWdvVFJnQnRqQUxMSmtZdmZBIn0.eyJleHAiOjE3NjM5ODg5NzcsImlhdCI6MTc2Mzk4ODY3NywiYXV0aF90aW1lIjoxNzYzOTg4Njc0LCJqdGkiOiI0NDg0Nzc3Yi1jMjZkLTQ3YmYtOGY5Yi04ZjNiZThhMjZhOTMiLCJpc3MiOiJodHRwczovL2F1dGguZGV2LmFwZXguZXNhLmludC9yZWFsbXMvYXBleCIsInN1YiI6ImFmNDgyNjNkLTRkY2ItNGVkMy04MzA3LTA4MDAwY2I0ODU1MCIsInR5cCI6IkJlYXJlciIsImF6cCI6ImFwZXgtZGlzcGF0Y2hlci1hcGktZGV2Iiwic2lkIjoiZGNlYzU4MjktZjAzZS00MzYwLTllMzctODE4OWFjN2ZjMzA1IiwiYWNyIjoiMSIsImFsbG93ZWQtb3JpZ2lucyI6WyJodHRwOi8vbG9jYWxob3N0Il0sInNjb3BlIjoicHJvZmlsZSBlbWFpbCIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJuYW1lIjoiQnJhbSBKYW5zc2VuIiwicHJlZmVycmVkX3VzZXJuYW1lIjoiYnJhbS5qYW5zc2VuQHZpdG8uYmUiLCJnaXZlbl9uYW1lIjoiQnJhbSIsImZhbWlseV9uYW1lIjoiSmFuc3NlbiIsImVtYWlsIjoiYnJhbS5qYW5zc2VuQHZpdG8uYmUifQ.wRyqxRBWtsoS9-e8Xh8oWD_ommcAVqBwzYsDqF8O7dNCTw5I0KI2UCArSfRs1jfMFISvZVXMlym-TDCLrcd2tiXnkax02L9w1jBiN7tXL99aQ87zzaKsSEDJRp9hygMcp_uyxDGUNWXBiuwwg12Urc1SmEboOPVrEqA_E4mom-1VmXa_eQgiUlube3qQ8HvGtwv6JtKKvhDOXiysksKWRr175ggwXS-Mzu529W1IpXTXBZvhvGn_B5Nflff-pB959hgK7KPf8cSDcZJ0tR__06cFwNSEAVo12NAK1oPdbFHFj9mKuOFXZG0vW_vl__5HKkrtF36VUgvTURgKYarE6Q isn't a valid URI: scheme isn't ws or wss" ] } ], @@ -620,7 +624,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.12" + "version": "3.13.5" } }, "nbformat": 4,