Skip to content

Commit

Permalink
TESTING: 30 non-automatic workflow tests are working, 12 todo
Browse files Browse the repository at this point in the history
  • Loading branch information
sjdv1982 committed Sep 18, 2024
1 parent ae2523a commit 81c9057
Show file tree
Hide file tree
Showing 17 changed files with 201 additions and 121 deletions.
236 changes: 143 additions & 93 deletions seamless/workflow/metalevel/debugmode.py

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions seamless/workflow/metalevel/debugmount.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,12 @@ def __init__(self, tf, path, special):
def mount(self, skip_pins):
from ..core.context import context
from ..core.macro_mode import macro_mode_on
from ..core.cell import subcelltypes, extensions, cell as core_cell
from ..core.cell import (
subcelltypes,
extensions,
cell as core_cell,
cellclasses,
)

skip_pins = skip_pins.copy()
self.skip_pins = skip_pins
Expand Down Expand Up @@ -257,7 +262,9 @@ def mount(self, skip_pins):
if subcelltype is not None:
cellclass = subcelltypes[subcelltype]
else:
raise NotImplementedError
if celltype not in cellclasses:
raise NotImplementedError(celltype, cellclasses)
cellclass = cellclasses[celltype]
c = cellclass()
ext = extensions[cellclass]
filename = os.path.join(self.path, pinname) + ext
Expand Down
4 changes: 4 additions & 0 deletions tests/workflow/debugmode-bash-shell.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import seamless

seamless.delegate(False)

from seamless.workflow import Context
import traceback

Expand Down
4 changes: 3 additions & 1 deletion tests/workflow/debugmode-compiled-light.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import os, tempfile
import seamless

seamless.delegate(False)
from seamless.workflow import Context, Cell

ctx = Context()
Expand Down
3 changes: 3 additions & 0 deletions tests/workflow/debugmode-compiled-sandbox.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import seamless

seamless.delegate(False)
from seamless.workflow import Context, Cell

ctx = Context()
Expand Down
4 changes: 3 additions & 1 deletion tests/workflow/debugmode-compiledmodule-light.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import os, tempfile
import seamless

seamless.delegate(False)
from seamless.workflow import Context, Cell

ctx = Context()
Expand Down
13 changes: 8 additions & 5 deletions tests/workflow/debugmode-compiledmodule-sandbox.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
from seamlessntext, Cell
import seamless

seamless.delegate(False)
from seamless.workflow import Context

ctx = Context()
ctx.transform = lambda a,b: a + b
ctx.transform = lambda a, b: a + b
ctx.transform.a = 2
ctx.transform.b = 3
ctx.translate()
Expand All @@ -23,7 +26,7 @@
}"""
ctx.code.mount("debugmount/compiled_module/main.cpp", authority="cell")
ctx.translate()
ctx.transform.result.example = 0.0 #example, just to fill the schema
ctx.transform.result.example = 0.0 # example, just to fill the schema

ctx.transform.main_module.add.language = "c"
code = """
Expand All @@ -37,7 +40,7 @@
ctx.add_code.set(code)

ctx.translate()
ctx.transform.result.example = 0.0 #example, just to fill the schema
ctx.transform.result.example = 0.0 # example, just to fill the schema
ctx.compute()
print(ctx.result.value)

Expand Down Expand Up @@ -74,4 +77,4 @@
ctx.transform.debug.pull()
ctx.compute()

print(ctx.transform.result.value)
print(ctx.transform.result.value)
4 changes: 3 additions & 1 deletion tests/workflow/debugmode-docker-shell.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import seamless

seamless.delegate(False)
from seamless.workflow import Context
import traceback

ctx = Context()
ctx.code = "head -$lines testdata > RESULT"
Expand Down
4 changes: 4 additions & 0 deletions tests/workflow/debugmode-py-light.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import seamless

seamless.delegate(False)

from seamless.workflow import Context, Cell
import traceback

Expand Down
3 changes: 3 additions & 0 deletions tests/workflow/debugmode-py-sandbox.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import seamless

seamless.delegate(False)
from seamless.workflow import Context, Cell

ctx = Context()
Expand Down
4 changes: 3 additions & 1 deletion tests/workflow/debugmode-py-shell.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import seamless

seamless.delegate(False)
from seamless.workflow import Context, Cell
import traceback

ctx = Context()

Expand Down
4 changes: 3 additions & 1 deletion tests/workflow/debugmode-pymodule-light.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import seamless

seamless.delegate(False)
from seamless.workflow.core.transformer import Transformer
from seamless.workflow import Context, Cell, Module, Transformer
import traceback

ctx = Context()

Expand Down
4 changes: 3 additions & 1 deletion tests/workflow/debugmode-pymodule-sandbox.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import seamless

seamless.delegate(False)
from seamless.workflow.core.transformer import Transformer
from seamless.workflow import Context, Cell, Module, Transformer
import traceback

ctx = Context()

Expand Down
5 changes: 4 additions & 1 deletion tests/workflow/debugmode-pypackage-light.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import seamless

seamless.delegate(False)

from seamless.workflow import Context, Cell, Module
import traceback

ctx = Context()

Expand Down
1 change: 1 addition & 0 deletions tests/workflow/debugmount/test-pymodule.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@

def get_square(value):
return value**2
5 changes: 4 additions & 1 deletion tests/workflow/delay-direct-print-file.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import seamless

seamless.delegate(False)

from seamless.workflow import Context
import asyncio

ctx = Context()

Expand Down
13 changes: 0 additions & 13 deletions wip/xxx
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,6 @@ Non-automatic tests
=========================
10
20


delay-direct-print-file: open with ipython, monitor /tmp/direct-print.out, change ctx.tf1.a and ctx.tf1.delay
debugmode-py-light.py
To debug a simple Python transformer in VSCode. Follow the instructions.
debugmode-compiled-light.py
To debug a simple C++ transformer in VSCode. Follow the instructions.
debugmode-py-sandbox.py
Sandbox debugging of a simple Python transformer in VSCode. Follow the instructions.
debugmode-pymodule-light.py
To debug a Python transformer with Python single-file module in VSCode. Follow the instructions.
debugmode-pymodule-sandbox.py
Sandbox debugging of a Python transformer with Python single-file module in VSCode. Follow the instructions.
30

debugmode-pypackage-light.py
Expand Down

0 comments on commit 81c9057

Please sign in to comment.