boulder 0.6.1__py3-none-any.whl
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.
- boulder/__init__.py +46 -0
- boulder/_frontend/assets/SankeyTab-D_7pX8ns.js +1 -0
- boulder/_frontend/assets/ThermoReportTab-B1AsQ0LC.js +1 -0
- boulder/_frontend/assets/index-4YpGN-6Y.js +4117 -0
- boulder/_frontend/assets/index-CxKeOVn3.css +1 -0
- boulder/_frontend/assets/index-HWgOWN26.js +11 -0
- boulder/_frontend/index.html +14 -0
- boulder/_frontend/vite.svg +1 -0
- boulder/api/__init__.py +1 -0
- boulder/api/main.py +348 -0
- boulder/api/routes/__init__.py +1 -0
- boulder/api/routes/configs.py +231 -0
- boulder/api/routes/graph.py +38 -0
- boulder/api/routes/gui_actions.py +143 -0
- boulder/api/routes/mechanisms.py +21 -0
- boulder/api/routes/plugins.py +94 -0
- boulder/api/routes/scenarios.py +204 -0
- boulder/api/routes/simulations.py +424 -0
- boulder/api/routes/sweep.py +251 -0
- boulder/api/routes/ui.py +49 -0
- boulder/api/sse.py +94 -0
- boulder/bindings.py +315 -0
- boulder/cantera_converter.py +2342 -0
- boulder/cli.py +805 -0
- boulder/config.py +2814 -0
- boulder/ctutils.py +285 -0
- boulder/data/sample_config.yaml +45 -0
- boulder/download_script_emitter.py +840 -0
- boulder/export.py +145 -0
- boulder/gui_actions.py +120 -0
- boulder/lagrangian.py +334 -0
- boulder/live_simulation.py +85 -0
- boulder/network_plugin.py +164 -0
- boulder/output_pane_plugins.py +194 -0
- boulder/output_summary.py +224 -0
- boulder/parser/__init__.py +13 -0
- boulder/parser/py_to_yaml.py +266 -0
- boulder/payload_store.py +485 -0
- boulder/reactor_energy.py +89 -0
- boulder/reactor_sizing.py +83 -0
- boulder/result_cache.py +836 -0
- boulder/runner.py +847 -0
- boulder/sankey.py +689 -0
- boulder/schema_registry.py +326 -0
- boulder/scopes.py +269 -0
- boulder/signals.py +365 -0
- boulder/sim2stone.py +1140 -0
- boulder/sim2stone_ast.py +794 -0
- boulder/sim2stone_cli.py +233 -0
- boulder/sim2stone_trace.py +157 -0
- boulder/simulation_result.py +190 -0
- boulder/simulation_worker.py +632 -0
- boulder/spatial_inference.py +176 -0
- boulder/stage_network.py +63 -0
- boulder/staged_network.py +127 -0
- boulder/staged_solver.py +1483 -0
- boulder/stone2sim_cli.py +89 -0
- boulder/styles.py +246 -0
- boulder/summary_builder.py +237 -0
- boulder/tests/test_build_isolated_reactor.py +63 -0
- boulder/tests/test_reactor_energy.py +53 -0
- boulder/utils.py +650 -0
- boulder/validation.py +536 -0
- boulder/verbose_utils.py +81 -0
- boulder/version.py +2 -0
- boulder/yaml_unit_map.py +321 -0
- boulder-0.6.1.dist-info/METADATA +249 -0
- boulder-0.6.1.dist-info/RECORD +74 -0
- boulder-0.6.1.dist-info/WHEEL +5 -0
- boulder-0.6.1.dist-info/entry_points.txt +4 -0
- boulder-0.6.1.dist-info/licenses/LICENSE +21 -0
- boulder-0.6.1.dist-info/scm_file_list.json +289 -0
- boulder-0.6.1.dist-info/scm_version.json +8 -0
- boulder-0.6.1.dist-info/top_level.txt +1 -0
boulder/__init__.py
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"""Boulder - A Cantera ReactorNet Visualization Tool."""
|
|
2
|
+
|
|
3
|
+
__version__ = "0.5.0"
|
|
4
|
+
|
|
5
|
+
from .lagrangian import LagrangianTrajectory
|
|
6
|
+
from .runner import BoulderRunner
|
|
7
|
+
from .schema_registry import (
|
|
8
|
+
ReactorSchemaEntry,
|
|
9
|
+
describe_kind,
|
|
10
|
+
get_report_metadata_for_config,
|
|
11
|
+
get_schema_entry,
|
|
12
|
+
register_reactor_builder,
|
|
13
|
+
register_reactor_unfolder,
|
|
14
|
+
registered_kinds,
|
|
15
|
+
validate_against_plugin_schemas,
|
|
16
|
+
)
|
|
17
|
+
from .simulation_result import SimulationResult, make_simulation_result
|
|
18
|
+
from .stage_network import CustomStageNetwork
|
|
19
|
+
from .staged_network import StagedReactorNet
|
|
20
|
+
from .validation import (
|
|
21
|
+
METADATA_ALLOWED_KEYS,
|
|
22
|
+
METADATA_MANDATORY_KEYS,
|
|
23
|
+
METADATA_OPTIONAL_KEYS,
|
|
24
|
+
MetadataModel,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
__all__ = [
|
|
28
|
+
"BoulderRunner",
|
|
29
|
+
"LagrangianTrajectory",
|
|
30
|
+
"CustomStageNetwork",
|
|
31
|
+
"METADATA_ALLOWED_KEYS",
|
|
32
|
+
"METADATA_MANDATORY_KEYS",
|
|
33
|
+
"METADATA_OPTIONAL_KEYS",
|
|
34
|
+
"MetadataModel",
|
|
35
|
+
"ReactorSchemaEntry",
|
|
36
|
+
"SimulationResult",
|
|
37
|
+
"StagedReactorNet",
|
|
38
|
+
"describe_kind",
|
|
39
|
+
"get_report_metadata_for_config",
|
|
40
|
+
"get_schema_entry",
|
|
41
|
+
"make_simulation_result",
|
|
42
|
+
"register_reactor_builder",
|
|
43
|
+
"register_reactor_unfolder",
|
|
44
|
+
"registered_kinds",
|
|
45
|
+
"validate_against_plugin_schemas",
|
|
46
|
+
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as k,j as f,P as g}from"./index-4YpGN-6Y.js";const u=300,_=2273,b={light:{low:"#00bfff",high:"#ff6347"},dark:{low:"#4A90E2",high:"#E94B3C"}};function h(t){const o=t.replace("#",""),n=parseInt(o,16);return[n>>16&255,n>>8&255,n&255]}function C(t,o,n){return`#${[t,o,n].map(e=>Math.round(e).toString(16).padStart(2,"0")).join("")}`}function T(t,o,n){const e=h(t),r=h(o),a=Math.max(0,Math.min(1,n));return C(e[0]+(r[0]-e[0])*a,e[1]+(r[1]-e[1])*a,e[2]+(r[2]-e[2])*a)}function S(t,o){const{low:n,high:e}=b[o],r=_-u,a=(t-u)/r;return T(n,e,a)}function x(t,o,n){const e=o?.[t];if(typeof e?.T=="number")return e.T;const a=n?.find(s=>s.id===t)?.properties?.temperature;return typeof a=="number"?a:u}function A(t,o,n,e){return t.map(r=>S(x(r,o,n),e))}const L={mass:"pink",enthalpy:"purple",heat:"#D3D3D3"},N={mass:"#B0B0B0",enthalpy:"#4A90E2",heat:"#D3D3D3"};function E(t){return t.startsWith("#")||t.startsWith("rgb")}function O(t,o){if(!t?.length)return;const n=o==="dark"?N:L;return t.map(e=>typeof e!="string"?"grey":E(e)?e:n[e]??"grey")}function D({results:t}){const o=k(y=>y.theme);if(!t.sankey_links||!t.sankey_nodes)return f.jsx("p",{className:"text-sm text-muted-foreground",children:"No Sankey data available."});const n=t.sankey_links,e=n.source??[],r=n.target??[],a=n.value??[],s=e.length,i=n.label,p=Array.isArray(i)&&i.length===s?i:void 0,c=n.color,d=Array.isArray(c)&&c.length===s?O(c,o):void 0,l={source:e,target:r,value:a};p&&(l.label=p),d&&(l.color=d);const m=A(t.sankey_nodes,t.reactor_reports,t.updated_nodes,o);return f.jsx(g,{data:[{type:"sankey",node:{label:t.sankey_nodes,color:m,pad:15,thickness:20},link:l}],layout:{paper_bgcolor:"transparent",font:{color:o==="dark"?"#ccc":"#333"},margin:{t:20,b:20,l:20,r:20},height:400},config:{responsive:!0,displayModeBar:!1},useResizeHandler:!0,className:"w-full"})}export{D as SankeyTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as N,b as w,j as e,f as l,k as _}from"./index-4YpGN-6Y.js";function y({results:d}){const t=N(n=>n.selectedElement),g=w(n=>n.config),c=d.reactor_reports;if(t?.type==="edge"&&String(t.data.type)==="MassFlowController"){const n=String(t.data.id),u=String(t.data.source),j=String(t.data.target),x=g.connections.find(s=>s.id===n)?.properties??{},a=d.connection_reports?.[n],f=typeof a?.mass_flow_rate=="number"?a.mass_flow_rate:typeof x.mass_flow_rate=="number"?x.mass_flow_rate:void 0,p=typeof a?.volumetric_flow_real_m3_s=="number"?a.volumetric_flow_real_m3_s:void 0,h=typeof a?.volumetric_flow_normal_m3_s=="number"?a.volumetric_flow_normal_m3_s:void 0,r=c?.[u];return e.jsx("div",{className:"space-y-4 max-h-96 overflow-y-auto",children:e.jsxs("div",{className:"rounded border border-border p-3",children:[e.jsxs("h4",{className:"text-sm font-medium text-foreground mb-2",children:[n," ",e.jsx("span",{className:"text-muted-foreground font-normal",children:"(Mass Flow Controller)"})]}),e.jsxs("p",{className:"text-xs text-muted-foreground mb-2",children:[u," → ",j]}),e.jsxs("div",{className:"space-y-2 text-xs",children:[e.jsxs("div",{className:"flex justify-between gap-2",children:[e.jsx("span",{className:"text-muted-foreground",children:"Mass flow rate"}),e.jsx("span",{className:"font-mono text-foreground",children:f!=null?`${l(f)} kg/s`:"—"})]}),p!=null&&e.jsxs("div",{className:"flex justify-between gap-2",children:[e.jsx("span",{className:"text-muted-foreground",children:"Volumetric flow (real)"}),e.jsxs("span",{className:"font-mono text-foreground",children:[l(p,6)," m³/s"]})]}),h!=null&&e.jsxs("div",{className:"flex justify-between gap-2",children:[e.jsx("span",{className:"text-muted-foreground",children:"Volumetric flow (normal, DIN 1343)"}),e.jsxs("span",{className:"font-mono text-foreground",children:[l(h,6)," m³/s"]})]}),r?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex justify-between gap-2",children:[e.jsx("span",{className:"text-muted-foreground",children:"Temperature (source)"}),e.jsx("span",{className:"font-mono text-foreground",children:typeof r.T=="number"?`${l(_(r.T),2)} °C`:"—"})]}),e.jsxs("div",{className:"flex justify-between gap-2",children:[e.jsx("span",{className:"text-muted-foreground",children:"Pressure (source)"}),e.jsx("span",{className:"font-mono text-foreground",children:typeof r.P=="number"?`${l(Number(r.P),2)} Pa`:"—"})]}),r.X&&typeof r.X=="object"&&!Array.isArray(r.X)?e.jsxs("div",{className:"pt-1",children:[e.jsx("span",{className:"text-muted-foreground block mb-1",children:"Gas composition (mole fractions, source)"}),e.jsx("div",{className:"flex flex-wrap gap-x-3 gap-y-0.5 font-mono text-foreground",children:Object.entries(r.X).filter(([,s])=>Number(s)>1e-10).sort((s,m)=>m[1]-s[1]).map(([s,m])=>e.jsxs("span",{children:[s,": ",l(m,4)]},s))})]}):null]}):e.jsx("p",{className:"text-muted-foreground italic",children:"Run simulation to see temperature, pressure and composition from source reactor."})]})]})})}if(!c||Object.keys(c).length===0)return e.jsx("p",{className:"text-sm text-muted-foreground",children:t?"No thermo reports. Run a simulation to see details.":"Select a node or Mass Flow Controller to view thermo details."});if(t?.type!=="node")return e.jsx("p",{className:"text-sm text-muted-foreground",children:"Select a node or Mass Flow Controller to view thermo details."});const i=String(t.data.id),o=c[i];return o?e.jsx("div",{className:"space-y-4 max-h-96 overflow-y-auto",children:e.jsxs("div",{className:"rounded border border-border p-3",children:[e.jsx("h4",{className:"text-sm font-medium text-foreground mb-2",children:i}),o.reactor_report&&typeof o.reactor_report=="string"?e.jsx("pre",{className:"text-xs text-muted-foreground whitespace-pre-wrap mb-2",children:o.reactor_report}):null,o.thermo_report&&typeof o.thermo_report=="string"?e.jsxs("details",{className:"text-xs",children:[e.jsx("summary",{className:"cursor-pointer text-muted-foreground hover:text-foreground",children:"Full thermo report"}),e.jsx("pre",{className:"mt-1 text-xs text-muted-foreground whitespace-pre-wrap",children:o.thermo_report})]}):null]})}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Select a node or Mass Flow Controller to view thermo details."})}export{y as ThermoReportTab};
|