Skip to content

Commit

Permalink
Allow disabling legacy sublattice path
Browse files Browse the repository at this point in the history
  • Loading branch information
cjao committed May 27, 2024
1 parent 5a69869 commit 08158db
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions covalent/_workflow/electron.py
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,8 @@ def _build_sublattice_graph(sub: Lattice, json_parent_metadata: str, *args, **kw

sub.build_graph(*args, **kwargs)

DISABLE_LEGACY_SUBLATTICES = os.environ.get("COVALENT_DISABLE_LEGACY_SUBLATTICES") == "1"

try:
# Attempt multistage sublattice dispatch.

Expand Down Expand Up @@ -899,5 +901,7 @@ def _build_sublattice_graph(sub: Lattice, json_parent_metadata: str, *args, **kw

except Exception as ex:
# Fall back to legacy sublattice handling
if DISABLE_LEGACY_SUBLATTICES:
raise
print("Falling back to legacy sublattice handling")
return sub.serialize_to_json()

0 comments on commit 08158db

Please sign in to comment.