Skip to content

Commit 93b394b

Browse files
committed
Refactor SKILL.md and demo_api_main.py for improved imports and clarity
- Updated import statements in `SKILL.md` to re-export `start_as_task` from `arctrl`, enhancing clarity on usage. - Changed `CompositeHeader.performer` and `.date` to be called as factories, correcting previous documentation. - Simplified import in `demo_api_main.py` by consolidating `ARC` and `start_as_task` from `arctrl` into a single line, improving readability.
1 parent 84a0646 commit 93b394b

2 files changed

Lines changed: 9 additions & 14 deletions

File tree

.agents/skills/arctrl/SKILL.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ from the bare `arctrl` package.
3939
override is not in place):
4040

4141
```python
42-
from arctrl.py.fable_modules.fable_library.async_ import start_as_task # type: ignore[import-untyped]
4342
from arctrl.py.Core.Table.composite_cell import Data # type: ignore[import-untyped]
4443
```
4544

@@ -58,10 +57,8 @@ from arctrl import (
5857
OntologyAnnotation,
5958
Person,
6059
Publication,
60+
start_as_task, # re-exported from fable_library
6161
)
62-
63-
# Async write helper lives in the Fable internals:
64-
from arctrl.py.fable_modules.fable_library.async_ import start_as_task # type: ignore[import-untyped]
6562
```
6663

6764
---
@@ -216,8 +213,8 @@ header_factor = CompositeHeader.factor(OntologyAnnotation("temperature", "", "")
216213
header_param = CompositeHeader.parameter(OntologyAnnotation("extraction", "", ""))
217214
header_comp = CompositeHeader.component(OntologyAnnotation("reagent", "", ""))
218215
header_cmt = CompositeHeader.comment("My comment label")
219-
header_perf = CompositeHeader.performer # property, not callable
220-
header_date = CompositeHeader.date # property, not callable
216+
header_perf = CompositeHeader.performer() # factory — call it
217+
header_date = CompositeHeader.date() # factory — call it
221218
# Fallback for unknown/simple header names:
222219
header_any = CompositeHeader.OfHeaderString("SomeColumnName")
223220

@@ -273,15 +270,14 @@ await start_as_task(arc.WriteAsync("/path/to/output/dir"))
273270

274271
## Known Pitfalls
275272

276-
**`start_as_task` is untyped**always add `# type: ignore[import-untyped]`
277-
on the import.
273+
**`start_as_task`**import from `arctrl` (re-exported). Prefer the public
274+
import over the internal `arctrl.py.fable_modules…` path.
278275

279-
**`CompositeHeader.performer` and `.date` are properties, not constructors**
280-
— call them without `()`:
276+
**`CompositeHeader.performer` and `.date` are factories** — call them with `()`:
281277

282278
```python
283-
header = CompositeHeader.performer # CORRECT
284-
header = CompositeHeader.performer() # TypeError
279+
header = CompositeHeader.performer()
280+
header = CompositeHeader.date()
285281
```
286282

287283
**`OntologyAnnotation()` without args is valid** — use for empty/unknown terms

dev_environment/demo_api_main.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
from datetime import UTC, datetime
1414
from pathlib import Path
1515

16-
from arctrl import ARC
17-
from arctrl.py.fable_modules.fable_library.async_ import start_as_task
16+
from arctrl import ARC, start_as_task
1817
from fastapi import FastAPI, Request
1918

2019
app = FastAPI()

0 commit comments

Comments
 (0)