xyzpy.gen.auto_growing¶
Grow batches from all crops in one directory.
Attributes¶
Classes¶
Reload a TOML settings file when it changes. |
|
Allow only one watcher in a directory. |
|
Find crop batches and start them in round-robin order. |
Functions¶
|
Return a file stamp, or None when the path does not exist. |
|
Return the input stamp that must change before a task is retried. |
|
|
|
|
|
Module Contents¶
- xyzpy.gen.auto_growing._file_stamp(path)¶
Return a file stamp, or None when the path does not exist.
- xyzpy.gen.auto_growing.CONFIG_KEYS¶
- xyzpy.gen.auto_growing._failure_stamp(task)¶
Return the input stamp that must change before a task is retried.
- xyzpy.gen.auto_growing._parse_bool(value)¶
- xyzpy.gen.auto_growing._validate_settings(settings)¶
- class xyzpy.gen.auto_growing.ConfigFile(path, base_settings)¶
Reload a TOML settings file when it changes.
- _UNREAD¶
- path¶
- base_settings¶
- stamp¶
- _stamp()¶
- read()¶
Return
(changed, settings, error)after checking the file.
- class xyzpy.gen.auto_growing.DirectoryLock(directory)¶
Allow only one watcher in a directory.
- path¶
- file = None¶
- __enter__()¶
- __exit__(exc_type, exc_value, traceback)¶
- class xyzpy.gen.auto_growing.CropState¶
-
- path: pathlib.Path¶
- pending_ids: collections.deque[int]¶
- class xyzpy.gen.auto_growing.AutoGrower(parent_dir, settings, config_path, once=False)¶
Find crop batches and start them in round-robin order.
- parent_dir¶
- settings¶
- config¶
- once = False¶
- runner¶
- crops = []¶
- cursor = 0¶
- failed¶
- recent_failures = []¶
- config_error = None¶
- stopping = False¶
- stop_error = None¶
- _last_event = 'starting'¶
- _last_scan = 0.0¶
- _last_refresh = 0.0¶
- _event(message)¶
- _apply_config(initial=False)¶
- scan()¶
Refresh crops, queues, and held failures from disk.
- has_pending()¶
Return True if any crop has a queued batch.
- next_task()¶
Remove and return the next batch in round-robin order.
- _handle_completions()¶
- _launch_available()¶
- _render()¶
- run()¶
Watch until stopped or a one-shot run cannot start more work.
- xyzpy.gen.auto_growing.build_parser()¶
- xyzpy.gen.auto_growing.main(argv=None)¶