scout-rig 0.2.2 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e217da5dacfbc60fa8f10fdeb62671ae53ecb74b537f422a61b9bdd0d68703a2
4
- data.tar.gz: f8e6e1431abcc659d67f265270a114948c6d8f38e2430c03feb4ca35d9132ed2
3
+ metadata.gz: 3e3f0f41ad3040aa251d03ddef193c6b3bd79fef11074e83a65feb83f3534dee
4
+ data.tar.gz: 6fc7536c4d7fa3dfd786053670ba26652c7577950e98ae92418d6219557a9d66
5
5
  SHA512:
6
- metadata.gz: c1a584e51e233aca2a640e9d4b9a5dc1dda24a96d17bad349d3d4e287d5e43a0a6e5092412dd0f9158cb88511266c5f4831f28788eccfc5aa94f2488e5c0b697
7
- data.tar.gz: 28218f64da5fd31fe30ede23cb181cc9a9cd67fc5c768a7312672ac75321431125cf39be76df37511dbd2e5e62c6879f1cc0ffa10c2704f665c90ed2defa7438
6
+ metadata.gz: '058750407dc01b6c95657f30b4ed063a8012e3b963c43247e2e30ac7e87c29a0be8deec2c1a1c000bac7b2c3c0006d8928d8907e387da445211c5f53857008bf'
7
+ data.tar.gz: adf47c9177aebe4dc1aef81350ac1e3458cefedd3c3a74cb82b485ab7bc96dbe7c118b47e721209fbe80c06db97e64ee7740cb72ae2dae9c4cafd54fce174c2a
data/.vimproject CHANGED
@@ -38,9 +38,7 @@ scout-rig=/$PWD filter="*" {
38
38
  test=test{
39
39
  test_helper.rb
40
40
  }
41
- python=python{
42
- task=task{
43
- }
41
+ python=python filter="*.py"{
44
42
  test.py
45
43
  scout=scout{
46
44
  __init__.py
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.2
1
+ 0.2.5
@@ -22,7 +22,10 @@ module PythonWorkflow
22
22
  m
23
23
  end
24
24
 
25
- path = Scout.python.task
25
+ Kernel.const_set workflow_name, workflow
26
+
27
+ path = Scout.python.task if path.nil?
28
+
26
29
  workflow.python_task_dir = path
27
30
  path.glob_names("*.py").each do |name|
28
31
  name = name.sub '.py', ''
data/python/.gitignore ADDED
@@ -0,0 +1,8 @@
1
+ __pycache__/
2
+ *.pyc
3
+ *.pyo
4
+ *.pyd
5
+ *.egg-info/
6
+ build/
7
+ dist/
8
+ .pytest_cache/
data/python/README.md ADDED
@@ -0,0 +1,105 @@
1
+ # scout-rig Python package
2
+
3
+ This directory contains the Python companion package for scout-rig.
4
+
5
+ It provides the `scout` Python module used to:
6
+
7
+ - read and write Scout-style TSV files with pandas
8
+ - run Scout workflows from Python through the standard Scout CLI
9
+ - inspect workflow metadata
10
+ - define Python functions as Scout-compatible tasks with `scout.task(...)`
11
+ - call remote workflow servers over HTTP
12
+
13
+ The Python package is meant to work together with the Ruby Scout stack.
14
+ It does not replace the Ruby runtime. Instead, it offers a convenient Python interface on top of Scout command-line workflows and PythonWorkflow integration.
15
+
16
+ ## Requirements
17
+
18
+ The package expects the Scout and Rbbt command-line tools used by the library to be available in your environment.
19
+
20
+ In particular, local workflow execution helpers use commands such as:
21
+
22
+ - `rbbt_exec.rb`
23
+ - `rbbt workflow task ...`
24
+
25
+ So, in practice, you should already have the Ruby scout-rig and related Scout packages installed and configured.
26
+
27
+ Base Python dependencies:
28
+
29
+ - `numpy`
30
+ - `pandas`
31
+
32
+ Optional dependencies:
33
+
34
+ - `requests` for the remote workflow client
35
+ - `rich` for `scout.rich(...)`
36
+
37
+ ## Install from GitHub with pip
38
+
39
+ Because this repository is primarily a Ruby project and the Python package lives under `python/`, install it with the `subdirectory` fragment:
40
+
41
+ pip install "scout-rig @ git+https://github.com/mikisvaz/scout-rig.git@main#subdirectory=python"
42
+
43
+ You can also omit the explicit package name:
44
+
45
+ pip install "git+https://github.com/mikisvaz/scout-rig.git@main#subdirectory=python"
46
+
47
+ For editable local development from a clone of the repository:
48
+
49
+ pip install -e python
50
+
51
+ ## Optional extras
52
+
53
+ For remote workflow support:
54
+
55
+ pip install "scout-rig[remote] @ git+https://github.com/mikisvaz/scout-rig.git@main#subdirectory=python"
56
+
57
+ For rich object inspection:
58
+
59
+ pip install "scout-rig[inspect] @ git+https://github.com/mikisvaz/scout-rig.git@main#subdirectory=python"
60
+
61
+ ## Quick example
62
+
63
+ import scout
64
+ import scout.workflow as sw
65
+
66
+ wf = sw.Workflow('Baking')
67
+ print(wf.tasks())
68
+ print(wf.run('bake_muffin_tray', add_blueberries=True))
69
+
70
+ ## PythonWorkflow example
71
+
72
+ import scout
73
+
74
+ def hello(name: str, excited: bool = False) -> str:
75
+ """Generate a greeting."""
76
+ return f"Hello, {name}{'!' if excited else ''}"
77
+
78
+ scout.task(hello)
79
+
80
+ Then inspect metadata with:
81
+
82
+ python hello.py --scout-metadata
83
+
84
+ ## What pip installs
85
+
86
+ The pip package installs only the Python module contained in this directory.
87
+ It does not install the Ruby scout-rig gem or the rest of the Scout stack.
88
+
89
+ That separation is intentional:
90
+
91
+ - Ruby remains responsible for workflow execution and PythonWorkflow integration
92
+ - Python provides helper functions and a convenient development interface
93
+
94
+ ## Package layout
95
+
96
+ - `scout.__init__` - TSV helpers, path helpers, workflow execution helpers
97
+ - `scout.runner` - `scout.task(...)` and metadata extraction for PythonWorkflow
98
+ - `scout.workflow` - local workflow wrapper
99
+ - `scout.workflow.remote` - remote workflow client
100
+
101
+ ## Running a simple import test
102
+
103
+ From the repository root:
104
+
105
+ PYTHONPATH=python python -c "import scout; print(scout.__file__)"
@@ -0,0 +1,49 @@
1
+ [build-system]
2
+ requires = ["setuptools>=69", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "scout-rig"
7
+ version = "0.2.4"
8
+ description = "Python helpers for Scout workflows, TSV files, and PythonWorkflow task metadata"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = { text = "MIT" }
12
+ authors = [
13
+ { name = "Miki S. Vazquez" }
14
+ ]
15
+ classifiers = [
16
+ "Development Status :: 3 - Alpha",
17
+ "Intended Audience :: Developers",
18
+ "License :: OSI Approved :: MIT License",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3.10",
21
+ "Programming Language :: Python :: 3.11",
22
+ "Programming Language :: Python :: 3.12",
23
+ "Topic :: Software Development :: Libraries :: Python Modules",
24
+ "Topic :: Scientific/Engineering :: Bio-Informatics"
25
+ ]
26
+ dependencies = [
27
+ "numpy",
28
+ "pandas"
29
+ ]
30
+
31
+ [project.optional-dependencies]
32
+ remote = [
33
+ "requests"
34
+ ]
35
+ inspect = [
36
+ "rich"
37
+ ]
38
+
39
+ [project.urls]
40
+ Homepage = "https://github.com/mikisvaz/scout-rig"
41
+ Repository = "https://github.com/mikisvaz/scout-rig"
42
+ Issues = "https://github.com/mikisvaz/scout-rig/issues"
43
+
44
+ [tool.setuptools.packages.find]
45
+ where = ["."]
46
+ include = ["scout*"]
47
+
48
+ [tool.setuptools]
49
+ include-package-data = true
@@ -188,7 +188,7 @@ def save_job_inputs(data):
188
188
  return temp_dir
189
189
 
190
190
 
191
- def run_job(workflow, task, jobname='Default', fork=False, clean=False, **kwargs):
191
+ def run_job(workflow, task, jobname='Default', fork=False, clean=False, exec=False, **kwargs):
192
192
  inputs_dir = save_job_inputs(kwargs)
193
193
  cmd = ['rbbt', 'workflow', 'task', workflow, task, '--jobname', jobname, '--load_inputs', inputs_dir, '--nocolor']
194
194
 
@@ -196,6 +196,9 @@ def run_job(workflow, task, jobname='Default', fork=False, clean=False, **kwargs
196
196
  cmd.append('--fork')
197
197
  cmd.append('--detach')
198
198
 
199
+ if exec:
200
+ cmd.append('--exec')
201
+
199
202
  if clean:
200
203
  if clean == 'recursive':
201
204
  cmd.append('--recursive_clean')
data/scout-rig.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: scout-rig 0.2.2 ruby lib
5
+ # stub: scout-rig 0.2.5 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "scout-rig".freeze
9
- s.version = "0.2.2".freeze
9
+ s.version = "0.2.5".freeze
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
@@ -36,6 +36,9 @@ Gem::Specification.new do |s|
36
36
  "lib/scout/workflow/python.rb",
37
37
  "lib/scout/workflow/python/inputs.rb",
38
38
  "lib/scout/workflow/python/task.rb",
39
+ "python/.gitignore",
40
+ "python/README.md",
41
+ "python/pyproject.toml",
39
42
  "python/scout/__init__.py",
40
43
  "python/scout/runner.py",
41
44
  "python/scout/workflow.py",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scout-rig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
@@ -62,6 +62,9 @@ files:
62
62
  - lib/scout/workflow/python.rb
63
63
  - lib/scout/workflow/python/inputs.rb
64
64
  - lib/scout/workflow/python/task.rb
65
+ - python/.gitignore
66
+ - python/README.md
67
+ - python/pyproject.toml
65
68
  - python/scout/__init__.py
66
69
  - python/scout/runner.py
67
70
  - python/scout/workflow.py