process-bigraph 1.8.2__tar.gz → 1.8.3__tar.gz

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.
Files changed (62) hide show
  1. {process_bigraph-1.8.2/process_bigraph.egg-info → process_bigraph-1.8.3}/PKG-INFO +1 -1
  2. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/__init__.py +1 -0
  3. process_bigraph-1.8.3/process_bigraph/draft_process.py +135 -0
  4. {process_bigraph-1.8.2 → process_bigraph-1.8.3/process_bigraph.egg-info}/PKG-INFO +1 -1
  5. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph.egg-info/SOURCES.txt +1 -0
  6. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/pyproject.toml +1 -1
  7. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/AUTHORS.md +0 -0
  8. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/LICENSE +0 -0
  9. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/README.md +0 -0
  10. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/artifacts.py +0 -0
  11. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/bundle.py +0 -0
  12. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/composite.py +0 -0
  13. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/composite_discovery.py +0 -0
  14. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/composite_generator.py +0 -0
  15. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/composite_spec.py +0 -0
  16. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/config_helpers.py +0 -0
  17. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/core_introspection.py +0 -0
  18. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/emitter.py +0 -0
  19. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/experiments/__init__.py +0 -0
  20. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/experiments/minimal_gillespie.py +0 -0
  21. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/nextflow.py +0 -0
  22. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/plumbing.py +0 -0
  23. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/processes/__init__.py +0 -0
  24. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/processes/bigraphical_reactive_system.py +0 -0
  25. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/processes/cached.py +0 -0
  26. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/processes/dynamic_structure.py +0 -0
  27. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/processes/examples.py +0 -0
  28. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/processes/growth_division.py +0 -0
  29. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/processes/parameter_scan.py +0 -0
  30. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/processes/reaction.py +0 -0
  31. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/processes/simulation.py +0 -0
  32. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/protocols/__init__.py +0 -0
  33. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/protocols/_git_worker.py +0 -0
  34. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/protocols/clusters/__init__.py +0 -0
  35. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/protocols/clusters/ec2_ssm.py +0 -0
  36. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/protocols/git.py +0 -0
  37. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/protocols/parallel.py +0 -0
  38. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/protocols/pool.py +0 -0
  39. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/protocols/ray.py +0 -0
  40. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/protocols/rest.py +0 -0
  41. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/protocols/session.py +0 -0
  42. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/run.py +0 -0
  43. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/run_step.py +0 -0
  44. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/scheduling.py +0 -0
  45. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/server/__init__.py +0 -0
  46. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/server/rest.py +0 -0
  47. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/server/start.py +0 -0
  48. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/templates.py +0 -0
  49. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/types/__init__.py +0 -0
  50. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/types/process.py +0 -0
  51. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/visualization.py +0 -0
  52. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/visualizations/__init__.py +0 -0
  53. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/visualizations/distribution.py +0 -0
  54. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/visualizations/heatmap.py +0 -0
  55. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/visualizations/param_vs_observable.py +0 -0
  56. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/visualizations/phase_space.py +0 -0
  57. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/visualizations/time_series.py +0 -0
  58. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph/visualizations/timeseries_from_observables.py +0 -0
  59. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph.egg-info/dependency_links.txt +0 -0
  60. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph.egg-info/requires.txt +0 -0
  61. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/process_bigraph.egg-info/top_level.txt +0 -0
  62. {process_bigraph-1.8.2 → process_bigraph-1.8.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: process-bigraph
3
- Version: 1.8.2
3
+ Version: 1.8.3
4
4
  Summary: protocol and execution for compositional systems biology
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -24,6 +24,7 @@ from process_bigraph.composite_spec import ( # noqa: F401
24
24
  normalize_type, CANONICAL_TYPES,
25
25
  )
26
26
  from process_bigraph.bundle import load_bundle # noqa: F401
27
+ from process_bigraph.draft_process import DraftProcess, draft_process # noqa: F401
27
28
  from process_bigraph.emitter import Emitter, gather_emitter_results, generate_emitter_state # noqa: F401
28
29
  from process_bigraph.types import StepLink, ProcessLink, CompositeLink # noqa: F401
29
30
  from process_bigraph import core_introspection # noqa: F401
@@ -0,0 +1,135 @@
1
+ """DraftProcess — a placeholder / draft process.
2
+
3
+ A *draft* process declares a **contract** — its input and output ports (names +
4
+ bigraph types) plus a human-readable description of the transformation it is
5
+ *intended* to perform — but has **no update dynamics yet**. It lets the model
6
+ topology (which process connects which stores) be designed and reviewed
7
+ *before* anyone commits to a mechanism.
8
+
9
+ Define a concrete, registrable draft with the :func:`draft_process` decorator::
10
+
11
+ from process_bigraph import DraftProcess, draft_process
12
+
13
+ @draft_process(
14
+ name="PTH secretion",
15
+ inputs={"ca_sense": "float"},
16
+ outputs={"pth_out": "float"},
17
+ contract={
18
+ "summary": "Chief cells synthesize PTH de novo and secrete it ...",
19
+ "makes": "PTH (de novo) -> parathyroid vessel",
20
+ "senses": "parathyroid vessel Ca2+",
21
+ "regulation": "inversely Ca2+-dependent ...",
22
+ },
23
+ )
24
+ class PTHSecretion(DraftProcess):
25
+ pass
26
+
27
+ Because it is a ``Process`` subclass defined at module scope, discovery that
28
+ walks a package and registers every Process/Step (e.g. a workspace
29
+ ``build_core()``) auto-registers it. It therefore shows up in registry-driven
30
+ tooling *by name*, with its ports, and — because ``describe()`` renders the
31
+ whole contract prefixed ``DRAFT —`` — its contract text and a DRAFT marker.
32
+
33
+ There is intentionally no ``update`` override: a draft inherits the base
34
+ ``Process.update`` no-op (returns ``{}``). It builds and renders but is inert if
35
+ stepped — it never fabricates dynamics it does not have.
36
+ """
37
+ from __future__ import annotations
38
+
39
+ from typing import Any, Dict
40
+
41
+ from process_bigraph.composite import Process
42
+
43
+ #: Contract fields, in the order ``describe()`` / ``_render_contract`` render them.
44
+ _CONTRACT_FIELDS = ("summary", "makes", "moves", "senses", "holds", "regulation", "status")
45
+
46
+ #: Default status stamped onto every draft's contract.
47
+ _DRAFT_STATUS = "draft - no update dynamics yet"
48
+
49
+
50
+ class DraftProcess(Process):
51
+ """Interface-only placeholder process: ports + contract, no dynamics.
52
+
53
+ Concrete drafts are ``DraftProcess`` subclasses carrying class-level
54
+ ``DRAFT_INPUTS`` / ``DRAFT_OUTPUTS`` / ``contract`` (normally injected by the
55
+ :func:`draft_process` decorator). Registry-style introspection reads the
56
+ class uninitialized — it calls ``inputs()``/``outputs()`` with the *class*
57
+ as ``self`` and ``describe()`` on an ``__new__``'d instance — so every
58
+ method here reads class attributes and never requires a configured instance.
59
+ """
60
+
61
+ # Filled by @draft_process (or overridden on a subclass).
62
+ DRAFT_NAME: str = ""
63
+ DRAFT_INPUTS: Dict[str, Any] = {}
64
+ DRAFT_OUTPUTS: Dict[str, Any] = {}
65
+ #: Class-level contract dict (also the ``.contract`` convention used by
66
+ #: other processes to advertise their intended interface).
67
+ contract: Dict[str, Any] = {}
68
+
69
+ # A draft has no config beyond a nominal (unused) interval.
70
+ config_schema = {"interval": {"_type": "float", "_default": 1.0}}
71
+
72
+ def inputs(self) -> Dict[str, Any]:
73
+ return dict(self.DRAFT_INPUTS or {})
74
+
75
+ def outputs(self) -> Dict[str, Any]:
76
+ return dict(self.DRAFT_OUTPUTS or {})
77
+
78
+ def describe(self) -> str:
79
+ """A ``DRAFT —`` prefixed rendering of the whole contract.
80
+
81
+ Registry tooling surfaces this as the process's description, so the whole
82
+ contract (and the DRAFT marker) is visible wherever the description is.
83
+ """
84
+ contract = self.contract if isinstance(self.contract, dict) else {}
85
+ label = self.DRAFT_NAME or type(self).__name__
86
+ return _render_contract(label, contract)
87
+
88
+ # No ``update`` override on purpose — draft. Inherits the base no-op.
89
+
90
+
91
+ def _render_contract(label: str, contract: Dict[str, Any]) -> str:
92
+ """One-line ``DRAFT — summary · key: value · …`` rendering of a contract.
93
+
94
+ A single line (fields joined by "·") so it stays readable in a registry
95
+ card whether or not the surrounding markup preserves newlines.
96
+ """
97
+ parts = ["DRAFT — " + (contract.get("summary") or label)]
98
+ for key in _CONTRACT_FIELDS:
99
+ if key == "summary":
100
+ continue
101
+ value = contract.get(key)
102
+ if value:
103
+ parts.append(f"{key}: {value}")
104
+ return " · ".join(parts)
105
+
106
+
107
+ def draft_process(
108
+ *,
109
+ name: str,
110
+ inputs: Dict[str, Any],
111
+ outputs: Dict[str, Any],
112
+ contract: Dict[str, Any],
113
+ ):
114
+ """Class decorator turning a bare ``DraftProcess`` subclass into a
115
+ registrable draft with fixed ports + contract.
116
+
117
+ Args:
118
+ name: Human-readable draft name (shown in ``describe()``).
119
+ inputs / outputs: ``{port_name: bigraph_type}`` port schemas.
120
+ contract: Free-form contract dict (``summary`` + optional ``makes`` /
121
+ ``moves`` / ``senses`` / ``holds`` / ``regulation``). A ``status``
122
+ of "draft" is stamped in automatically.
123
+ """
124
+
125
+ def decorate(cls):
126
+ if not (isinstance(cls, type) and issubclass(cls, DraftProcess)):
127
+ raise TypeError("@draft_process can only decorate DraftProcess subclasses")
128
+ cls.DRAFT_NAME = name
129
+ cls.DRAFT_INPUTS = dict(inputs)
130
+ cls.DRAFT_OUTPUTS = dict(outputs)
131
+ cls.contract = {"status": _DRAFT_STATUS, **dict(contract)}
132
+ cls.description = _render_contract(name, cls.contract)
133
+ return cls
134
+
135
+ return decorate
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: process-bigraph
3
- Version: 1.8.2
3
+ Version: 1.8.3
4
4
  Summary: protocol and execution for compositional systems biology
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -11,6 +11,7 @@ process_bigraph/composite_generator.py
11
11
  process_bigraph/composite_spec.py
12
12
  process_bigraph/config_helpers.py
13
13
  process_bigraph/core_introspection.py
14
+ process_bigraph/draft_process.py
14
15
  process_bigraph/emitter.py
15
16
  process_bigraph/nextflow.py
16
17
  process_bigraph/plumbing.py
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "process-bigraph"
7
- version = "1.8.2"
7
+ version = "1.8.3"
8
8
  description = "protocol and execution for compositional systems biology"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
File without changes