spyglass icon indicating copy to clipboard operation
spyglass copied to clipboard

Deprecation factory requires import order

Open CBroz1 opened this issue 11 months ago • 0 comments

Describe the bug

A byproduct of my deprecated factory util, seen in use here is that certain downstream tables cannot be imported before the factory is run.

For example, if I try to run B before A, there will be a circular import error

from spyglass.common.common_position import TrackGraph  # A
from spyglass.linearization.merge import LinearizedPositionOutput # B

Expected behavior

Three goals are in competition:

  1. Tables should be importable in any order.
  2. We should be able to migrate tables out of common to their respective pipelines without interfering with existing code that imports from the current location.
  3. Pipelines should import all public tables at __init__.py

I don't think these items are mutually exclusive, but I'm not yet sure how to achieve all 3. Currently, we make concessions on (1) and cover the natural case of importing upstream before downstream items

CBroz1 avatar Mar 08 '24 18:03 CBroz1