Skip to content

Commit

Permalink
- Convert EstimateFlow to use Dataclasses as a configuration paramete…
Browse files Browse the repository at this point in the history
…r, and update pipelines to support.

- Bugfix: Adjust EstimateFlow's overlap + expected bounding box to account for the internal stride, resulting in output that no longer overlaps. This overlap caused a significant performance hit while writing distributed volumes with TensorStore.

PiperOrigin-RevId: 653792180
  • Loading branch information
timblakely authored and copybara-github committed Jul 18, 2024
1 parent 49ba764 commit c3b0815
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion connectomics/volume/subvolume_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
import dataclasses
import enum
import importlib
from typing import Any, List, Tuple, Optional, Union
import inspect
from typing import Any, List, Optional, Tuple, Type, Union

from connectomics.common import array
from connectomics.common import bounding_box
Expand All @@ -42,6 +43,13 @@
timer_counter = COUNTER_STORE.timer_counter


def dataclass_configuration(cls: ...) -> Optional[Type]: # pylint:disable=g-bare-generic
init_params = inspect.signature(cls.__init__).parameters
if 'config' in init_params:
# TODO(timblakely): Also check to see if the class is an actual dataclass.
return init_params['config'].annotation


@dataclasses.dataclass
class SubvolumeProcessorConfig(dataclasses_json.DataClassJsonMixin):
"""Configuration for a given subvolume processor."""
Expand Down

0 comments on commit c3b0815

Please sign in to comment.