MyCode Project
Overview
Minimal starter template you can copy to bootstrap a new AGILab application.
Demonstrates the project layout expected by the platform (manager package, worker package,
app_argsdefinitions, Analysis configuration) with minimal business logic so you can focus on custom code.Ships with blank web forms and prompt files to illustrate where to plug in UI customisation and Pipeline prompts.
Scientific placeholders
The template is intentionally lightweight, but many AGILab workflows ultimately fit the pattern of learning or calibrating a function \(f_\theta\):
where \(\ell\) is a task-dependent loss (regression, classification, imitation learning, etc.). You can use the MyCode skeleton to prototype the data loading, feature extraction, and artifact export around this core loop.
Manager (mycode.mycode)
Lightweight subclass of
BaseWorkerthat shows how to wire argument handling, logging and dataframe export without heavy dependencies.Provides the same
from_toml/to_tomlhelpers as production projects so you can reuse the Orchestrate page snippets verbatim.
Args (mycode.app_args)
Simple Pydantic model that mirrors the keys present in
app_settings.toml.Ideal starting point for capturing new configuration options; extend the model and the web form generated on the Orchestrate page will pick them up.
Worker (mycode_worker.mycode_worker)
Skeleton worker that demonstrates the lifecycle hooks (
start,work_init,run) required by the distributor.Includes placeholder logic for dataset loading and result persistence—replace with your domain-specific processing steps.
Assets & Tests
app_test.pyensures the installer and worker skeleton keep working as the template evolves.test/_test_*modules show how to unit-test managers and workers in isolation.app_args_form.pyprovides the optional web form that mirrors the generated UI; tailor it when you need additional validation or widgets.
API Reference
Minimal manager implementation for the mycode sample project.
- class mycode.mycode.Mycode(env, args=None, **kwargs)[source]
Bases:
BaseWorkerLightweight orchestration surface for the mycode example.
- build_distribution(_workers=None)[source]
- Return type:
Tuple[List[List],List[List[Tuple[int,int]]],str,str,str]
- classmethod from_toml(env, settings_path='app_settings.toml', section='args', **overrides)[source]
- Return type:
- to_toml(settings_path='app_settings.toml', section='args', create_missing=True)[source]
- Return type:
None
- worker_vars = {}
- class mycode.mycode.MycodeApp(env, args=None, **kwargs)[source]
Bases:
MycodeAlias retaining the historical suffix for compatibility.
Argument management helpers for the mycode sample project.
- mycode.app_args.ArgsModel
alias of
MycodeArgs
- mycode.app_args.ArgsOverrides
alias of
MycodeArgsTD
- class mycode.app_args.MycodeArgs(**data)[source]
Bases:
BaseModelRuntime parameters for the mycode application.
- data_in
- data_out
- files
- model_config = {'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- nfile
- nread
- nskip
- reset_target
- class mycode.app_args.MycodeArgsTD[source]
Bases:
TypedDict- data_in
- data_out
- files
- nfile
- nread
- nskip
- reset_target
- mycode.app_args.dump_args(args, settings_path, *, section='args', create_missing=True)[source]
- Return type:
None
Default worker implementation for the mycode project.
This worker simply inherits the PolarsWorker so that projects with minimal
requirements still provide a concrete worker class. Downstream installers rely
on the class name MycodeWorker to determine the runtime bundle to ship.
- class mycode_worker.mycode_worker.MycodeWorker[source]
Bases:
PolarsWorkerPolars worker used by the mycode sample application.