Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: pull_request
jobs:
test-and-lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
Expand Down
6 changes: 0 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ repos:
- id: check-symlinks
- id: check-yaml
- id: debug-statements
- repo: https://github.com/gitguardian/ggshield
rev: v1.25.0
hooks:
- id: ggshield
language_version: python3
stages: [commit]
# Using this mirror lets us use mypyc-compiled black, which is about 2x faster
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.2.0
Expand Down
2 changes: 0 additions & 2 deletions _tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import os

import numpy as np
import pytest
import yaml
Expand Down
23 changes: 22 additions & 1 deletion mlex_dlsia/utils/tiled.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,13 @@ def allocate_array_space(
metadata=metadata,
key=array_name,
)
# match the new container and new array access tags to the original data_client
copy_tiled_access_info(tiled_dataset.data_client, last_container)
copy_tiled_access_info(tiled_dataset.data_client, array_client)

logging.info(
f"Result space allocated in Tiled and segmentation will be saved in {array_client.uri}."
f"Result space allocated in Tiled and segmentation will be \n"
f"saved in {array_client.uri} with access_tags {array_client.access_blob.get('tags')}."
)

return array_client
Expand All @@ -148,3 +152,20 @@ def prepare_tiled_containers(io_parameters, dataset, network_name):
)
logging.info("Tiled segmentation result space allocated successfully.")
return seg_client


def copy_tiled_access_info(source_client, target_client):
"""
This function copies the access information from a source Tiled URI to a target Tiled client.
Input:
source_uri: str, The URI of the source Tiled resource.
target_client: Tiled client object, The target Tiled client to copy access info to.
Output:
None
"""
access_blob = source_client.access_blob
if access_blob and access_blob.get("tags") is not None:
target_client.replace_metadata(access_tags=access_blob["tags"])
logging.info(
f"Tiled access information copied successfully {source_client.access_blob}."
)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ name = "mlex_dlsia"
version = "0.2.0"
description = "DLSIA models for segmentation in MLExchange"
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.11"
requires-python = ">=3.11, <=3.12"

dependencies = [
"numpy==1.26.4",
Expand Down
Loading