kalfa 3.0.0.dev0__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.
- kalfa/__init__.py +19 -0
- kalfa/api.py +284 -0
- kalfa/board/__init__.py +1 -0
- kalfa/board/answers.py +419 -0
- kalfa/board/server.py +536 -0
- kalfa/board/static/api.js +176 -0
- kalfa/board/static/app.js +122 -0
- kalfa/board/static/board.css +228 -0
- kalfa/board/static/charts.css +46 -0
- kalfa/board/static/components/badge.js +14 -0
- kalfa/board/static/components/chart.js +204 -0
- kalfa/board/static/components/diagram.js +857 -0
- kalfa/board/static/components/error.js +17 -0
- kalfa/board/static/components/loading.js +7 -0
- kalfa/board/static/components/progress.js +25 -0
- kalfa/board/static/components/settings.js +418 -0
- kalfa/board/static/components/spark.js +43 -0
- kalfa/board/static/components/table.js +156 -0
- kalfa/board/static/diagram.css +76 -0
- kalfa/board/static/format.js +138 -0
- kalfa/board/static/index.html +34 -0
- kalfa/board/static/plot.js +594 -0
- kalfa/board/static/predictions.css +20 -0
- kalfa/board/static/store.js +215 -0
- kalfa/board/static/views/compare.js +185 -0
- kalfa/board/static/views/home.js +90 -0
- kalfa/board/static/views/record/config.js +81 -0
- kalfa/board/static/views/record/curves.js +137 -0
- kalfa/board/static/views/record/data.js +378 -0
- kalfa/board/static/views/record/files.js +128 -0
- kalfa/board/static/views/record/log.js +164 -0
- kalfa/board/static/views/record/model.js +286 -0
- kalfa/board/static/views/record/overview.js +216 -0
- kalfa/board/static/views/record/plots.js +103 -0
- kalfa/board/static/views/record/predictions.js +834 -0
- kalfa/board/static/views/record.js +179 -0
- kalfa/board/static/views/runs.js +124 -0
- kalfa/board/static/views/sweep.js +282 -0
- kalfa/board/watch.py +87 -0
- kalfa/cli.py +371 -0
- kalfa/commands/__init__.py +0 -0
- kalfa/commands/common.py +8 -0
- kalfa/commands/export.py +117 -0
- kalfa/commands/generate.py +31 -0
- kalfa/commands/guide/__init__.py +101 -0
- kalfa/commands/guide/about.py +93 -0
- kalfa/commands/guide/calls.py +102 -0
- kalfa/commands/guide/sections.py +186 -0
- kalfa/commands/guide/seen.py +307 -0
- kalfa/commands/guide/show.py +106 -0
- kalfa/commands/guide/training.py +333 -0
- kalfa/commands/guide/words.py +97 -0
- kalfa/commands/legos.py +508 -0
- kalfa/commands/plots.py +27 -0
- kalfa/commands/report/__init__.py +64 -0
- kalfa/commands/report/page.py +112 -0
- kalfa/commands/report/predictions.py +216 -0
- kalfa/commands/report/sections.py +356 -0
- kalfa/commands/stop.py +60 -0
- kalfa/commands/sweep/__init__.py +202 -0
- kalfa/commands/sweep/checks.py +98 -0
- kalfa/commands/sweep/plan.py +183 -0
- kalfa/commands/sweep/points.py +123 -0
- kalfa/commands/sweep/runner.py +100 -0
- kalfa/commands/sweep/space.py +67 -0
- kalfa/commands/sweep/strategies.py +228 -0
- kalfa/core/__init__.py +0 -0
- kalfa/core/aliases.py +229 -0
- kalfa/core/build.py +727 -0
- kalfa/core/check.py +550 -0
- kalfa/core/coerce.py +36 -0
- kalfa/core/context.py +149 -0
- kalfa/core/device.py +63 -0
- kalfa/core/errors.py +45 -0
- kalfa/core/graph.py +304 -0
- kalfa/core/history.py +70 -0
- kalfa/core/loop.py +710 -0
- kalfa/core/make.py +121 -0
- kalfa/core/plan.py +156 -0
- kalfa/core/predict.py +290 -0
- kalfa/core/protocols.py +122 -0
- kalfa/core/record.py +347 -0
- kalfa/core/refs.py +88 -0
- kalfa/core/rng.py +100 -0
- kalfa/core/rules.py +513 -0
- kalfa/core/run.py +568 -0
- kalfa/core/spec.py +413 -0
- kalfa/core/state.py +100 -0
- kalfa/core/wrap.py +671 -0
- kalfa/records/__init__.py +24 -0
- kalfa/records/compare.py +86 -0
- kalfa/records/reader.py +561 -0
- kalfa/records/stats/__init__.py +36 -0
- kalfa/records/stats/choices.py +282 -0
- kalfa/records/stats/classes.py +236 -0
- kalfa/records/stats/measures.py +144 -0
- kalfa/records/stats/pairs.py +225 -0
- kalfa/records/stats/tables.py +153 -0
- kalfa/records/sweep.py +244 -0
- kalfa/std/__init__.py +17 -0
- kalfa/std/actions.py +35 -0
- kalfa/std/common.py +56 -0
- kalfa/std/data/__init__.py +1 -0
- kalfa/std/data/base.py +45 -0
- kalfa/std/data/columns.py +190 -0
- kalfa/std/data/flow.py +317 -0
- kalfa/std/data/images.py +443 -0
- kalfa/std/data/options.py +147 -0
- kalfa/std/data/pre.py +84 -0
- kalfa/std/data/splits.py +140 -0
- kalfa/std/data/stream.py +294 -0
- kalfa/std/data/table.py +642 -0
- kalfa/std/data/text.py +436 -0
- kalfa/std/data/transforms.py +327 -0
- kalfa/std/data/weights.py +113 -0
- kalfa/std/data/window.py +135 -0
- kalfa/std/figure.py +37 -0
- kalfa/std/init.py +72 -0
- kalfa/std/loggers.py +105 -0
- kalfa/std/losses.py +161 -0
- kalfa/std/metrics.py +463 -0
- kalfa/std/models.py +122 -0
- kalfa/std/notes.py +1553 -0
- kalfa/std/objectives.py +360 -0
- kalfa/std/plots/__init__.py +75 -0
- kalfa/std/plots/classification.py +207 -0
- kalfa/std/plots/common.py +44 -0
- kalfa/std/plots/curves.py +56 -0
- kalfa/std/plots/images.py +188 -0
- kalfa/std/plots/pairs.py +66 -0
- kalfa/std/plots/predictions.py +154 -0
- kalfa/std/samplers.py +261 -0
- kalfa/std/samples.py +72 -0
- kalfa/std/schedules.py +74 -0
- kalfa/std/steps.py +133 -0
- kalfa/std/triggers.py +135 -0
- kalfa/summary.py +296 -0
- kalfa/tui/__init__.py +4 -0
- kalfa/tui/app.py +107 -0
- kalfa/tui/config.py +61 -0
- kalfa/tui/guide.py +100 -0
- kalfa/tui/jobs.py +97 -0
- kalfa/tui/legos.py +62 -0
- kalfa/tui/records.py +439 -0
- kalfa-3.0.0.dev0.dist-info/METADATA +261 -0
- kalfa-3.0.0.dev0.dist-info/RECORD +148 -0
- kalfa-3.0.0.dev0.dist-info/WHEEL +4 -0
- kalfa-3.0.0.dev0.dist-info/entry_points.txt +2 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
const IMAGES = [".png", ".jpg", ".jpeg", ".gif", ".svg"];
|
|
2
|
+
const THUMB = "display: block; width: 100%; height: 200px; object-fit: contain; cursor: zoom-in; background: #fff; border-radius: 4px";
|
|
3
|
+
const LARGE = "flex: 1; min-height: 0; width: 100%; object-fit: contain; background: #fff; border-radius: 4px";
|
|
4
|
+
|
|
5
|
+
function pathOf(item) {
|
|
6
|
+
if (typeof item === "string") return item;
|
|
7
|
+
return item && typeof item.path === "string" ? item.path : "";
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function isImage(path) {
|
|
11
|
+
const lower = path.toLowerCase();
|
|
12
|
+
return IMAGES.some(suffix => lower.endsWith(suffix));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
name: "PlotsTab",
|
|
17
|
+
props: {
|
|
18
|
+
record: { type: Object, default: null },
|
|
19
|
+
path: { type: String, default: "" },
|
|
20
|
+
api: { default: null },
|
|
21
|
+
version: { type: Number, default: 0 },
|
|
22
|
+
},
|
|
23
|
+
data() {
|
|
24
|
+
return { shown: "" };
|
|
25
|
+
},
|
|
26
|
+
computed: {
|
|
27
|
+
thumb() { return THUMB; },
|
|
28
|
+
large() { return LARGE; },
|
|
29
|
+
items() {
|
|
30
|
+
const plots = this.record && Array.isArray(this.record.plots) ? this.record.plots : [];
|
|
31
|
+
return plots.map(pathOf).filter(Boolean).map(path => {
|
|
32
|
+
const parts = path.split("/");
|
|
33
|
+
return { path, name: parts[parts.length - 1], folder: parts.length > 1 ? parts[0] : "", image: isImage(path) };
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
groups() {
|
|
37
|
+
const groups = new Map();
|
|
38
|
+
for (const item of this.items) {
|
|
39
|
+
if (!groups.has(item.folder)) groups.set(item.folder, []);
|
|
40
|
+
groups.get(item.folder).push(item);
|
|
41
|
+
}
|
|
42
|
+
return Array.from(groups, ([folder, items]) => ({ folder: folder || "record", items }));
|
|
43
|
+
},
|
|
44
|
+
images() { return this.items.filter(item => item.image); },
|
|
45
|
+
current() { return this.images.find(item => item.path === this.shown) || null; },
|
|
46
|
+
position() {
|
|
47
|
+
const index = this.images.findIndex(item => item.path === this.shown);
|
|
48
|
+
return index < 0 ? "" : (index + 1) + " of " + this.images.length;
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
mounted() { window.addEventListener("keydown", this.onKey); },
|
|
52
|
+
beforeUnmount() { window.removeEventListener("keydown", this.onKey); },
|
|
53
|
+
methods: {
|
|
54
|
+
url(path) { return this.api ? this.api.fileUrl(this.path, path) : ""; },
|
|
55
|
+
show(item) { if (item.image) this.shown = item.path; },
|
|
56
|
+
close() { this.shown = ""; },
|
|
57
|
+
step(delta) {
|
|
58
|
+
const images = this.images;
|
|
59
|
+
if (!images.length) return;
|
|
60
|
+
const index = images.findIndex(item => item.path === this.shown);
|
|
61
|
+
const next = (Math.max(index, 0) + delta + images.length) % images.length;
|
|
62
|
+
this.shown = images[next].path;
|
|
63
|
+
},
|
|
64
|
+
onKey(event) {
|
|
65
|
+
if (!this.current) return;
|
|
66
|
+
if (event.key === "Escape") this.close();
|
|
67
|
+
else if (event.key === "ArrowRight") this.step(1);
|
|
68
|
+
else if (event.key === "ArrowLeft") this.step(-1);
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
template: `
|
|
72
|
+
<div class="page pane-plots">
|
|
73
|
+
<div class="muted small">The figures the run drew under plots/ and the samples it generated under samples/. A click opens a
|
|
74
|
+
figure large; the arrow keys move between figures and escape closes.</div>
|
|
75
|
+
<div class="empty" v-if="!items.length">no figures yet; the plots section draws them when the run ends</div>
|
|
76
|
+
<template v-for="group in groups" :key="group.folder">
|
|
77
|
+
<h3 class="section-title">{{ group.folder }} <span class="muted small">{{ group.items.length }}</span></h3>
|
|
78
|
+
<div class="live-grid">
|
|
79
|
+
<figure class="card" v-for="item in group.items" :key="item.path" style="margin: 0">
|
|
80
|
+
<img v-if="item.image" :src="url(item.path)" :alt="item.name" :title="item.path" loading="lazy" :style="thumb"
|
|
81
|
+
@click="show(item)">
|
|
82
|
+
<a v-else class="tool" :href="url(item.path)" :download="item.name">save {{ item.name }}</a>
|
|
83
|
+
<figcaption class="mono muted" style="margin-top: 6px; overflow-wrap: anywhere">{{ item.name }}</figcaption>
|
|
84
|
+
</figure>
|
|
85
|
+
</div>
|
|
86
|
+
</template>
|
|
87
|
+
<div class="modal" v-if="current" @click.self="close">
|
|
88
|
+
<div class="modal-box">
|
|
89
|
+
<div class="card-head">
|
|
90
|
+
<span class="card-title mono">{{ current.path }}</span>
|
|
91
|
+
<span class="card-tools">
|
|
92
|
+
<span class="muted small">{{ position }}</span>
|
|
93
|
+
<button type="button" class="tool" @click="step(-1)">previous</button>
|
|
94
|
+
<button type="button" class="tool" @click="step(1)">next</button>
|
|
95
|
+
<a class="tool" :href="url(current.path)" :download="current.name">save</a>
|
|
96
|
+
<button type="button" class="tool" @click="close">close</button>
|
|
97
|
+
</span>
|
|
98
|
+
</div>
|
|
99
|
+
<img :src="url(current.path)" :alt="current.name" :style="large">
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
</div>`,
|
|
103
|
+
};
|