feat(app-page): vendor tools as Nipype interfaces & Pydra tasks - #11
Merged
Conversation
styx 0.5.0 adds experimental nipype/pydra codegen. Surface both in the "Vendor this tool" (Source) tab, and rework the now-7-target picker. - Bump @styx-api/core 0.4.0 -> 0.5.0. - Worker emits generateNipype/generatePydra defensively (try/catch -> null, with a console.warn so a real codegen regression is distinguishable from the intended per-tool "not applicable" skip). Both are 2-file delegation targets: the interface/task file imports the styx Python wrapper, so each ships as <iface>.py + _<styx>.py (the latter reusing pythonModule). - Thread DelegationArtifact + a canonical moduleStem through the compile protocol, client, AppPage, and ResultsPanel. - Replace the cramped flat sub-tab strip with a grouped Select (Language wrappers / Workflow frameworks (Python) / Specs) + content panel; nipype/pydra carry an Experimental badge and a caveat note. The effective target is derived (falls back to the first available option) rather than reset in an effect. - Name vendored files from the compiler's module stem, not the raw tool name, so e.g. afni/3dcalc yields import-valid v_3dcalc.py / _v_3dcalc.py and every artifact for a tool shares one stem.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
@styx-api/core0.5.0 (nowlatest) adds experimental nipype and pydra code generation. This surfaces both in the "Vendor this tool" (Source) tab so users can vendor a tool as a NipypeInterfaceor a Pydra task — not just a raw Python/TS wrapper — and reworks the picker, which had outgrown its flat tab strip.The key wrinkle: 2-file delegation
generateNipype/generatePydradon't produce single-file drop-ins. Each emits an interface/task file that imports the styx Python wrapper (from ._bet import bet, BetOutputs). So those targets render two files —<iface>.py+_<styx>.py(the latter reusing the existingpythonModule) — with a "drop both files together" note. Filenames come from the compiler's own stems, never the raw tool name, which is required for the relative import to resolve (e.g.afni/3dcalc→from ._v_3dcalc import v_3dcalc, since3dcalccan't name a Python module).Changes
@styx-api/core0.4.0→0.5.0.generateNipype/generatePydradefensively (try/catch→null, with aconsole.warnso a genuine codegen regression is distinguishable from the intended per-tool "not applicable" skip), plus a canonicalmoduleStemfrombuildTypedSpec.DelegationArtifacttype +moduleStemthrough the compile protocol → client →AppPage→ResultsPanel.Select(Language wrappers / Workflow frameworks (Python) / Specs) + content panel. Nipype/Pydra carry an Experimental badge and a caveat note. The shown target is derived (falls back to the first available option) instead of reset in an effect.3dcalcyields import-validv_3dcalc.py/v_3dcalc.tsmatching the delegation files, instead of the non-importable3dcalc.py.Heads-up
Bumping to 0.5.0 will trip the existing "Compiler version mismatch" banner until the published niwrap manifest is rebuilt with 0.5.0 — that's the lockstep warning working as intended, not a regression.
Verification
npm run check(0 errors),npm run lint,npm run test(185 passing) all green.bet.py+_bet.pywith a resolving import + note; 3dcalc →v_3dcalc.py/_v_3dcalc.py; Python/TypeScript/Boutiques/schemas all still render; no console errors.