STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
__init__.py
Go to the documentation of this file.
1"""Phase 11: the drawing is the document.
2
3pid-designer stores a P&ID as ``{"nodes": [...], "edges": [...]}`` with every
4hardware number in :class:`feedtwin.model.Param`'s exact shape -- value, unit,
5source, reference. This package reads that and builds a solvable network from
6it, so a system is drawn once and analysed where it was drawn::
7
8 from feedtwin.pid import build_network, load_diagram
9
10 drawing = load_diagram("stand.json")
11 built = build_network(drawing)
12 solve_steady(built.network)
13
14Two graphs, two shapes. A P&ID carries hardware on symbols *and* on lines; a
15network carries pressures on nodes and hardware on branches only. The rewrite
16between them is :mod:`feedtwin.pid.network`, and the case that matters is the
17inline symbol -- a valve becomes a branch with a node spliced either side.
18"""
19
20from __future__ import annotations
21
22from feedtwin.pid.document import (
23 ANNOTATION_TYPES,
24 INLINE_TYPES,
25 INSTRUMENT_TYPES,
26 SOURCE_TYPES,
27 Diagram,
28 DiagramError,
29 PidEdge,
30 PidNode,
31 load_diagram,
32 read_diagram,
33)
34from feedtwin.pid.segments import read_segments
35from feedtwin.pid.network import (
36 BRANCH_KINDS,
37 FALLBACKS,
38 LINE_KINDS,
39 BuiltNetwork,
40 Instrument,
41 Placement,
42 build_network,
43)
44
45__all__ = [
46 "ANNOTATION_TYPES",
47 "BRANCH_KINDS",
48 "BuiltNetwork",
49 "Diagram",
50 "DiagramError",
51 "FALLBACKS",
52 "INLINE_TYPES",
53 "INSTRUMENT_TYPES",
54 "Instrument",
55 "LINE_KINDS",
56 "Placement",
57 "PidEdge",
58 "PidNode",
59 "SOURCE_TYPES",
60 "build_network",
61 "load_diagram",
62 "read_segments",
63 "read_diagram",
64]