quantized-lab 0.8.0__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.
- quantized_lab-0.8.0/.gitignore +58 -0
- quantized_lab-0.8.0/LICENSE +201 -0
- quantized_lab-0.8.0/NOTICE +11 -0
- quantized_lab-0.8.0/PKG-INFO +122 -0
- quantized_lab-0.8.0/README.md +88 -0
- quantized_lab-0.8.0/pyproject.toml +158 -0
- quantized_lab-0.8.0/src/quantized/__init__.py +11 -0
- quantized_lab-0.8.0/src/quantized/__main__.py +14 -0
- quantized_lab-0.8.0/src/quantized/api.py +220 -0
- quantized_lab-0.8.0/src/quantized/app.py +206 -0
- quantized_lab-0.8.0/src/quantized/calc/__init__.py +8 -0
- quantized_lab-0.8.0/src/quantized/calc/_clipfit.py +76 -0
- quantized_lab-0.8.0/src/quantized/calc/_natural_neighbor.py +219 -0
- quantized_lab-0.8.0/src/quantized/calc/aggregate.py +159 -0
- quantized_lab-0.8.0/src/quantized/calc/backgrounds.py +353 -0
- quantized_lab-0.8.0/src/quantized/calc/baseline.py +349 -0
- quantized_lab-0.8.0/src/quantized/calc/batch_fit.py +148 -0
- quantized_lab-0.8.0/src/quantized/calc/constants.py +27 -0
- quantized_lab-0.8.0/src/quantized/calc/corrections.py +192 -0
- quantized_lab-0.8.0/src/quantized/calc/crystallography.py +400 -0
- quantized_lab-0.8.0/src/quantized/calc/diffusion.py +120 -0
- quantized_lab-0.8.0/src/quantized/calc/electrical.py +248 -0
- quantized_lab-0.8.0/src/quantized/calc/electrochemistry.py +176 -0
- quantized_lab-0.8.0/src/quantized/calc/element_data.json +1 -0
- quantized_lab-0.8.0/src/quantized/calc/element_data.py +59 -0
- quantized_lab-0.8.0/src/quantized/calc/errors.py +246 -0
- quantized_lab-0.8.0/src/quantized/calc/figure.py +417 -0
- quantized_lab-0.8.0/src/quantized/calc/figure_break.py +152 -0
- quantized_lab-0.8.0/src/quantized/calc/figure_categorical.py +156 -0
- quantized_lab-0.8.0/src/quantized/calc/figure_corner.py +229 -0
- quantized_lab-0.8.0/src/quantized/calc/figure_facets.py +127 -0
- quantized_lab-0.8.0/src/quantized/calc/figure_field.py +137 -0
- quantized_lab-0.8.0/src/quantized/calc/figure_hitmap.py +116 -0
- quantized_lab-0.8.0/src/quantized/calc/figure_labels.py +62 -0
- quantized_lab-0.8.0/src/quantized/calc/figure_map.py +287 -0
- quantized_lab-0.8.0/src/quantized/calc/figure_overrides.py +159 -0
- quantized_lab-0.8.0/src/quantized/calc/figure_page.py +266 -0
- quantized_lab-0.8.0/src/quantized/calc/figure_scale.py +125 -0
- quantized_lab-0.8.0/src/quantized/calc/figure_statplots.py +167 -0
- quantized_lab-0.8.0/src/quantized/calc/figure_styles.py +131 -0
- quantized_lab-0.8.0/src/quantized/calc/figure_ternary.py +239 -0
- quantized_lab-0.8.0/src/quantized/calc/figure_ticks.py +217 -0
- quantized_lab-0.8.0/src/quantized/calc/fit_autoguess.py +156 -0
- quantized_lab-0.8.0/src/quantized/calc/fit_bootstrap.py +163 -0
- quantized_lab-0.8.0/src/quantized/calc/fit_bumps.py +258 -0
- quantized_lab-0.8.0/src/quantized/calc/fit_constraints.py +114 -0
- quantized_lab-0.8.0/src/quantized/calc/fit_equation.py +264 -0
- quantized_lab-0.8.0/src/quantized/calc/fit_findxy.py +80 -0
- quantized_lab-0.8.0/src/quantized/calc/fit_models.py +195 -0
- quantized_lab-0.8.0/src/quantized/calc/fit_models_special.py +189 -0
- quantized_lab-0.8.0/src/quantized/calc/fit_odr.py +99 -0
- quantized_lab-0.8.0/src/quantized/calc/fit_scan.py +243 -0
- quantized_lab-0.8.0/src/quantized/calc/fit_stats.py +215 -0
- quantized_lab-0.8.0/src/quantized/calc/fitting.py +199 -0
- quantized_lab-0.8.0/src/quantized/calc/formula.py +90 -0
- quantized_lab-0.8.0/src/quantized/calc/global_curve_fit.py +305 -0
- quantized_lab-0.8.0/src/quantized/calc/global_fit.py +181 -0
- quantized_lab-0.8.0/src/quantized/calc/interp2d.py +260 -0
- quantized_lab-0.8.0/src/quantized/calc/linecut.py +269 -0
- quantized_lab-0.8.0/src/quantized/calc/magnetic.py +414 -0
- quantized_lab-0.8.0/src/quantized/calc/magnetometry.py +464 -0
- quantized_lab-0.8.0/src/quantized/calc/map.py +228 -0
- quantized_lab-0.8.0/src/quantized/calc/mcmc.py +177 -0
- quantized_lab-0.8.0/src/quantized/calc/optics.py +228 -0
- quantized_lab-0.8.0/src/quantized/calc/pawley.py +251 -0
- quantized_lab-0.8.0/src/quantized/calc/peak_batch.py +128 -0
- quantized_lab-0.8.0/src/quantized/calc/peak_fit.py +259 -0
- quantized_lab-0.8.0/src/quantized/calc/peak_integrate.py +104 -0
- quantized_lab-0.8.0/src/quantized/calc/peak_multifit.py +260 -0
- quantized_lab-0.8.0/src/quantized/calc/peak_track.py +134 -0
- quantized_lab-0.8.0/src/quantized/calc/peaks.py +298 -0
- quantized_lab-0.8.0/src/quantized/calc/peakshapes.py +85 -0
- quantized_lab-0.8.0/src/quantized/calc/plotting.py +147 -0
- quantized_lab-0.8.0/src/quantized/calc/processing.py +232 -0
- quantized_lab-0.8.0/src/quantized/calc/qspace.py +48 -0
- quantized_lab-0.8.0/src/quantized/calc/reductions.py +155 -0
- quantized_lab-0.8.0/src/quantized/calc/reductions_fft.py +383 -0
- quantized_lab-0.8.0/src/quantized/calc/refl_sld_presets.json +1 -0
- quantized_lab-0.8.0/src/quantized/calc/reflectivity.py +80 -0
- quantized_lab-0.8.0/src/quantized/calc/registry.py +303 -0
- quantized_lab-0.8.0/src/quantized/calc/relaxation.py +119 -0
- quantized_lab-0.8.0/src/quantized/calc/report.py +253 -0
- quantized_lab-0.8.0/src/quantized/calc/report_emit.py +227 -0
- quantized_lab-0.8.0/src/quantized/calc/resample.py +142 -0
- quantized_lab-0.8.0/src/quantized/calc/rsm.py +91 -0
- quantized_lab-0.8.0/src/quantized/calc/rsm_analyze.py +245 -0
- quantized_lab-0.8.0/src/quantized/calc/semiconductor.py +488 -0
- quantized_lab-0.8.0/src/quantized/calc/sld.py +131 -0
- quantized_lab-0.8.0/src/quantized/calc/sld_formula.py +138 -0
- quantized_lab-0.8.0/src/quantized/calc/spectral.py +357 -0
- quantized_lab-0.8.0/src/quantized/calc/statplots.py +214 -0
- quantized_lab-0.8.0/src/quantized/calc/stats.py +399 -0
- quantized_lab-0.8.0/src/quantized/calc/stats_anova2.py +202 -0
- quantized_lab-0.8.0/src/quantized/calc/stats_anova_ext.py +338 -0
- quantized_lab-0.8.0/src/quantized/calc/stats_dist.py +196 -0
- quantized_lab-0.8.0/src/quantized/calc/stats_glm.py +245 -0
- quantized_lab-0.8.0/src/quantized/calc/stats_multivar.py +289 -0
- quantized_lab-0.8.0/src/quantized/calc/stats_roc.py +157 -0
- quantized_lab-0.8.0/src/quantized/calc/stats_survival.py +261 -0
- quantized_lab-0.8.0/src/quantized/calc/stats_tests.py +380 -0
- quantized_lab-0.8.0/src/quantized/calc/substrates.py +181 -0
- quantized_lab-0.8.0/src/quantized/calc/superconductor.py +359 -0
- quantized_lab-0.8.0/src/quantized/calc/surface_fit.py +290 -0
- quantized_lab-0.8.0/src/quantized/calc/surface_models.py +156 -0
- quantized_lab-0.8.0/src/quantized/calc/thermal.py +119 -0
- quantized_lab-0.8.0/src/quantized/calc/thin_film.py +425 -0
- quantized_lab-0.8.0/src/quantized/calc/unit_convert.py +259 -0
- quantized_lab-0.8.0/src/quantized/calc/units.py +80 -0
- quantized_lab-0.8.0/src/quantized/calc/vacuum.py +290 -0
- quantized_lab-0.8.0/src/quantized/calc/xray.py +169 -0
- quantized_lab-0.8.0/src/quantized/cli.py +214 -0
- quantized_lab-0.8.0/src/quantized/datastruct.py +153 -0
- quantized_lab-0.8.0/src/quantized/io/__init__.py +11 -0
- quantized_lab-0.8.0/src/quantized/io/_hdf5_layout.py +308 -0
- quantized_lab-0.8.0/src/quantized/io/_jcamp_asdf.py +135 -0
- quantized_lab-0.8.0/src/quantized/io/_xrdml_scan.py +291 -0
- quantized_lab-0.8.0/src/quantized/io/base.py +82 -0
- quantized_lab-0.8.0/src/quantized/io/bruker_brml.py +177 -0
- quantized_lab-0.8.0/src/quantized/io/bruker_raw.py +158 -0
- quantized_lab-0.8.0/src/quantized/io/cif.py +266 -0
- quantized_lab-0.8.0/src/quantized/io/consolidated.py +122 -0
- quantized_lab-0.8.0/src/quantized/io/delimited.py +222 -0
- quantized_lab-0.8.0/src/quantized/io/excel.py +135 -0
- quantized_lab-0.8.0/src/quantized/io/hdf5.py +192 -0
- quantized_lab-0.8.0/src/quantized/io/import_filters.py +178 -0
- quantized_lab-0.8.0/src/quantized/io/import_preview.py +262 -0
- quantized_lab-0.8.0/src/quantized/io/jcamp.py +179 -0
- quantized_lab-0.8.0/src/quantized/io/lakeshore.py +163 -0
- quantized_lab-0.8.0/src/quantized/io/ncnr.py +278 -0
- quantized_lab-0.8.0/src/quantized/io/netcdf.py +195 -0
- quantized_lab-0.8.0/src/quantized/io/opus.py +231 -0
- quantized_lab-0.8.0/src/quantized/io/origin.py +346 -0
- quantized_lab-0.8.0/src/quantized/io/origin_com.py +194 -0
- quantized_lab-0.8.0/src/quantized/io/origin_project/__init__.py +221 -0
- quantized_lab-0.8.0/src/quantized/io/origin_project/annotation_marks.py +288 -0
- quantized_lab-0.8.0/src/quantized/io/origin_project/container.py +262 -0
- quantized_lab-0.8.0/src/quantized/io/origin_project/curve_style_color.py +359 -0
- quantized_lab-0.8.0/src/quantized/io/origin_project/figure_geometry.py +108 -0
- quantized_lab-0.8.0/src/quantized/io/origin_project/figure_layers.py +333 -0
- quantized_lab-0.8.0/src/quantized/io/origin_project/figure_text.py +258 -0
- quantized_lab-0.8.0/src/quantized/io/origin_project/figures.py +210 -0
- quantized_lab-0.8.0/src/quantized/io/origin_project/figures_opju.py +440 -0
- quantized_lab-0.8.0/src/quantized/io/origin_project/notes.py +302 -0
- quantized_lab-0.8.0/src/quantized/io/origin_project/opj.py +459 -0
- quantized_lab-0.8.0/src/quantized/io/origin_project/opj_curves.py +297 -0
- quantized_lab-0.8.0/src/quantized/io/origin_project/opj_shapes.py +148 -0
- quantized_lab-0.8.0/src/quantized/io/origin_project/opju.py +146 -0
- quantized_lab-0.8.0/src/quantized/io/origin_project/opju_axis_real_form.py +418 -0
- quantized_lab-0.8.0/src/quantized/io/origin_project/opju_axis_specimen_form.py +167 -0
- quantized_lab-0.8.0/src/quantized/io/origin_project/opju_codec.py +370 -0
- quantized_lab-0.8.0/src/quantized/io/origin_project/opju_curves.py +497 -0
- quantized_lab-0.8.0/src/quantized/io/origin_project/opju_curves_allcols.py +258 -0
- quantized_lab-0.8.0/src/quantized/io/origin_project/opju_figure_curves.py +302 -0
- quantized_lab-0.8.0/src/quantized/io/origin_project/opju_figure_text.py +245 -0
- quantized_lab-0.8.0/src/quantized/io/origin_project/opju_reports.py +129 -0
- quantized_lab-0.8.0/src/quantized/io/origin_project/origin_richtext.py +145 -0
- quantized_lab-0.8.0/src/quantized/io/origin_project/preview.py +132 -0
- quantized_lab-0.8.0/src/quantized/io/origin_project/templates.py +314 -0
- quantized_lab-0.8.0/src/quantized/io/origin_project/tree.py +379 -0
- quantized_lab-0.8.0/src/quantized/io/origin_project/tree_opju.py +228 -0
- quantized_lab-0.8.0/src/quantized/io/origin_project/windows.py +238 -0
- quantized_lab-0.8.0/src/quantized/io/origin_project/windows_opju.py +393 -0
- quantized_lab-0.8.0/src/quantized/io/origin_project/writer.py +156 -0
- quantized_lab-0.8.0/src/quantized/io/origin_project/writer_blocks.py +282 -0
- quantized_lab-0.8.0/src/quantized/io/qd.py +380 -0
- quantized_lab-0.8.0/src/quantized/io/refl1d.py +132 -0
- quantized_lab-0.8.0/src/quantized/io/registry.py +210 -0
- quantized_lab-0.8.0/src/quantized/io/report_export.py +347 -0
- quantized_lab-0.8.0/src/quantized/io/rigaku.py +100 -0
- quantized_lab-0.8.0/src/quantized/io/sims.py +398 -0
- quantized_lab-0.8.0/src/quantized/io/spc.py +311 -0
- quantized_lab-0.8.0/src/quantized/io/xrd_csv.py +308 -0
- quantized_lab-0.8.0/src/quantized/io/xrdml.py +394 -0
- quantized_lab-0.8.0/src/quantized/jobs.py +173 -0
- quantized_lab-0.8.0/src/quantized/plugins/__init__.py +50 -0
- quantized_lab-0.8.0/src/quantized/plugins/contract.py +111 -0
- quantized_lab-0.8.0/src/quantized/plugins/loader.py +394 -0
- quantized_lab-0.8.0/src/quantized/plugins/steps.py +90 -0
- quantized_lab-0.8.0/src/quantized/routes/__init__.py +7 -0
- quantized_lab-0.8.0/src/quantized/routes/_bookcache.py +62 -0
- quantized_lab-0.8.0/src/quantized/routes/_export_common.py +27 -0
- quantized_lab-0.8.0/src/quantized/routes/_payload.py +58 -0
- quantized_lab-0.8.0/src/quantized/routes/_uploadcache.py +59 -0
- quantized_lab-0.8.0/src/quantized/routes/aggregate.py +46 -0
- quantized_lab-0.8.0/src/quantized/routes/baseline.py +210 -0
- quantized_lab-0.8.0/src/quantized/routes/books.py +117 -0
- quantized_lab-0.8.0/src/quantized/routes/calc.py +56 -0
- quantized_lab-0.8.0/src/quantized/routes/corrections.py +78 -0
- quantized_lab-0.8.0/src/quantized/routes/crystallography.py +80 -0
- quantized_lab-0.8.0/src/quantized/routes/diffusion.py +58 -0
- quantized_lab-0.8.0/src/quantized/routes/electrical.py +101 -0
- quantized_lab-0.8.0/src/quantized/routes/electrochemistry.py +83 -0
- quantized_lab-0.8.0/src/quantized/routes/export.py +280 -0
- quantized_lab-0.8.0/src/quantized/routes/export_facets.py +83 -0
- quantized_lab-0.8.0/src/quantized/routes/export_figures.py +471 -0
- quantized_lab-0.8.0/src/quantized/routes/export_page.py +125 -0
- quantized_lab-0.8.0/src/quantized/routes/fitting.py +379 -0
- quantized_lab-0.8.0/src/quantized/routes/fitting_bumps.py +97 -0
- quantized_lab-0.8.0/src/quantized/routes/import_template.py +97 -0
- quantized_lab-0.8.0/src/quantized/routes/import_wizard.py +150 -0
- quantized_lab-0.8.0/src/quantized/routes/jobs_api.py +59 -0
- quantized_lab-0.8.0/src/quantized/routes/magnetic.py +135 -0
- quantized_lab-0.8.0/src/quantized/routes/magnetometry.py +133 -0
- quantized_lab-0.8.0/src/quantized/routes/optics.py +98 -0
- quantized_lab-0.8.0/src/quantized/routes/parsers.py +281 -0
- quantized_lab-0.8.0/src/quantized/routes/peaks.py +184 -0
- quantized_lab-0.8.0/src/quantized/routes/plot.py +103 -0
- quantized_lab-0.8.0/src/quantized/routes/reductions.py +121 -0
- quantized_lab-0.8.0/src/quantized/routes/reference.py +58 -0
- quantized_lab-0.8.0/src/quantized/routes/reflectivity.py +91 -0
- quantized_lab-0.8.0/src/quantized/routes/report_export.py +119 -0
- quantized_lab-0.8.0/src/quantized/routes/rsm.py +136 -0
- quantized_lab-0.8.0/src/quantized/routes/samples.py +32 -0
- quantized_lab-0.8.0/src/quantized/routes/semiconductor.py +207 -0
- quantized_lab-0.8.0/src/quantized/routes/sld.py +42 -0
- quantized_lab-0.8.0/src/quantized/routes/spectral.py +54 -0
- quantized_lab-0.8.0/src/quantized/routes/statplots.py +99 -0
- quantized_lab-0.8.0/src/quantized/routes/stats.py +418 -0
- quantized_lab-0.8.0/src/quantized/routes/stats_design.py +321 -0
- quantized_lab-0.8.0/src/quantized/routes/substrates.py +46 -0
- quantized_lab-0.8.0/src/quantized/routes/superconductor.py +139 -0
- quantized_lab-0.8.0/src/quantized/routes/thermal.py +57 -0
- quantized_lab-0.8.0/src/quantized/routes/thin_film.py +153 -0
- quantized_lab-0.8.0/src/quantized/routes/vacuum.py +113 -0
- quantized_lab-0.8.0/src/quantized/routes/xray.py +32 -0
- quantized_lab-0.8.0/src/quantized/samples/demo_vsm.csv +42 -0
- quantized_lab-0.8.0/src/quantized/server_launch.py +251 -0
- quantized_lab-0.8.0/src/quantized/web/assets/JetBrainsMono-Bold-CUogYd9I.woff2 +0 -0
- quantized_lab-0.8.0/src/quantized/web/assets/JetBrainsMono-Regular-CA-Os4ii.woff2 +0 -0
- quantized_lab-0.8.0/src/quantized/web/assets/index-BHmmCL-x.js +27 -0
- quantized_lab-0.8.0/src/quantized/web/assets/index-BiZzN7J6.css +1 -0
- quantized_lab-0.8.0/src/quantized/web/index.html +13 -0
- quantized_lab-0.8.0/src/quantized/web/loading.html +69 -0
- quantized_lab-0.8.0/tools/origin_compare/README.md +150 -0
- quantized_lab-0.8.0/tools/visual/README.md +142 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# ── Python ────────────────────────────────────────────────────────────
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
.venv/
|
|
5
|
+
.uv/
|
|
6
|
+
*.egg-info/
|
|
7
|
+
.pytest_cache/
|
|
8
|
+
.mypy_cache/
|
|
9
|
+
.ruff_cache/
|
|
10
|
+
dist/
|
|
11
|
+
build/
|
|
12
|
+
dist-sidecar/
|
|
13
|
+
|
|
14
|
+
# ── Node / frontend ───────────────────────────────────────────────────
|
|
15
|
+
node_modules/
|
|
16
|
+
frontend/dist/
|
|
17
|
+
*.tsbuildinfo
|
|
18
|
+
|
|
19
|
+
# ── Tauri / desktop ───────────────────────────────────────────────────
|
|
20
|
+
src-tauri/target/
|
|
21
|
+
|
|
22
|
+
# ── Local-only research corpus (never commit instrument data) ─────────
|
|
23
|
+
tests/realdata/
|
|
24
|
+
**/*.dat
|
|
25
|
+
**/*.xrdml
|
|
26
|
+
**/*.raw
|
|
27
|
+
# Exception: small committed golden-corpus fixtures (inline comments are
|
|
28
|
+
# NOT supported in .gitignore, so this note must be on its own line).
|
|
29
|
+
!tests/fixtures/**
|
|
30
|
+
|
|
31
|
+
# ── OS / editor ───────────────────────────────────────────────────────
|
|
32
|
+
.DS_Store
|
|
33
|
+
Thumbs.db
|
|
34
|
+
.idea/
|
|
35
|
+
.vscode/
|
|
36
|
+
|
|
37
|
+
# ── Claude private working area (per-machine, not shared) ─────────────
|
|
38
|
+
.claude/
|
|
39
|
+
CLAUDE.local.md
|
|
40
|
+
|
|
41
|
+
# NOTE: plans/ is TRACKED in this repo for now (founding design docs).
|
|
42
|
+
# Once active development starts we may adopt the sibling-repo convention
|
|
43
|
+
# (gitignore plans/, track a BACKLOG.md dashboard) — see CLAUDE.md.
|
|
44
|
+
|
|
45
|
+
# Built SPA (vite build output, served by FastAPI in prod)
|
|
46
|
+
src/quantized/web/
|
|
47
|
+
|
|
48
|
+
# Beautiful-defaults audit renders (tools/audit_defaults.py) -- regenerate
|
|
49
|
+
# locally, never commit the PNG grid
|
|
50
|
+
tools/audit_defaults_out/
|
|
51
|
+
|
|
52
|
+
# OneDrive conflict copies — when two machines edit the same file, OneDrive
|
|
53
|
+
# saves a duplicate named "<file>-<Device>.<ext>". Never commit these.
|
|
54
|
+
*MacBook*
|
|
55
|
+
*-DESKTOP-*
|
|
56
|
+
|
|
57
|
+
# OneDrive sync-conflict copies ("<name>-<machine>.<ext>") — never commit
|
|
58
|
+
*MacBook Air*
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or Derivative
|
|
95
|
+
Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Paige Quarterman
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
quantized
|
|
2
|
+
Copyright 2026 Paige Quarterman
|
|
3
|
+
|
|
4
|
+
This product includes software developed as a clean-architecture port of
|
|
5
|
+
the quantized_matlab toolbox.
|
|
6
|
+
|
|
7
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
|
8
|
+
use this file except in compliance with the License. You may obtain a copy
|
|
9
|
+
of the License at
|
|
10
|
+
|
|
11
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: quantized-lab
|
|
3
|
+
Version: 0.8.0
|
|
4
|
+
Summary: Clean-architecture Python + React port of the quantized_matlab scientific toolbox (magnetometry / XRD / lab data).
|
|
5
|
+
Author: Paige Quarterman
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
License-File: NOTICE
|
|
9
|
+
Requires-Python: >=3.11
|
|
10
|
+
Requires-Dist: fastapi>=0.139.0
|
|
11
|
+
Requires-Dist: h5py>=3.10
|
|
12
|
+
Requires-Dist: matplotlib>=3.11.0
|
|
13
|
+
Requires-Dist: numpy>=1.26
|
|
14
|
+
Requires-Dist: openpyxl>=3.1
|
|
15
|
+
Requires-Dist: periodictable>=1.7
|
|
16
|
+
Requires-Dist: platformdirs>=4.10.0
|
|
17
|
+
Requires-Dist: pydantic>=2.7
|
|
18
|
+
Requires-Dist: python-multipart>=0.0.32
|
|
19
|
+
Requires-Dist: scipy>=1.11
|
|
20
|
+
Requires-Dist: uvicorn[standard]>=0.51.0
|
|
21
|
+
Provides-Extra: bumps
|
|
22
|
+
Requires-Dist: bumps>=1.0; extra == 'bumps'
|
|
23
|
+
Provides-Extra: desktop
|
|
24
|
+
Requires-Dist: pywebview>=5.1; extra == 'desktop'
|
|
25
|
+
Provides-Extra: office
|
|
26
|
+
Requires-Dist: python-docx>=1.1; extra == 'office'
|
|
27
|
+
Requires-Dist: python-pptx>=1.0; extra == 'office'
|
|
28
|
+
Provides-Extra: origin-com
|
|
29
|
+
Requires-Dist: pywin32; (sys_platform == 'win32') and extra == 'origin-com'
|
|
30
|
+
Provides-Extra: stats
|
|
31
|
+
Requires-Dist: lifelines>=0.27; extra == 'stats'
|
|
32
|
+
Requires-Dist: statsmodels>=0.14; extra == 'stats'
|
|
33
|
+
Description-Content-Type: text/markdown
|
|
34
|
+
|
|
35
|
+
# quantized
|
|
36
|
+
|
|
37
|
+
A clean-architecture Python + React port of the
|
|
38
|
+
[`quantized_matlab`](../quantized_matlab) scientific data toolbox for
|
|
39
|
+
magnetometry, X-ray/neutron diffraction, and generic lab data.
|
|
40
|
+
|
|
41
|
+
- **Backend parity** with the MATLAB toolbox: parsers, corrections,
|
|
42
|
+
plotting, peak & curve fitting, materials calculators (DiraCulator),
|
|
43
|
+
and a spreadsheet workspace (DataWorkspace).
|
|
44
|
+
- **Revamped GUI** built fresh in React, sharing the look-and-feel and
|
|
45
|
+
component conventions of the sibling [`fermiviewer`](../fermiviewer)
|
|
46
|
+
Python app.
|
|
47
|
+
- **Architecture that holds the line:** pure `io/` + `calc/` libraries,
|
|
48
|
+
thin FastAPI `routes/`, a 500-line per-module ceiling, and golden tests
|
|
49
|
+
that freeze MATLAB outputs as the parity oracle — so this port never
|
|
50
|
+
grows the god-scripts the MATLAB original accumulated.
|
|
51
|
+
|
|
52
|
+
> Status: **active development** — backend + GUI are functional; native
|
|
53
|
+
> installers and PyPI packages publish from tagged releases (see
|
|
54
|
+
> [`RELEASE.md`](RELEASE.md)). See [`plans/PORT_PLAN.md`](plans/PORT_PLAN.md)
|
|
55
|
+
> for the detailed workstream plan, and [`CLAUDE.md`](CLAUDE.md) for the
|
|
56
|
+
> architecture hard-rules.
|
|
57
|
+
|
|
58
|
+
## Scope
|
|
59
|
+
|
|
60
|
+
Magnetometry / XRD / lab-data analysis (parity with `quantized_matlab`).
|
|
61
|
+
Electron-microscopy tooling (Fermi viewer, EELS/EDS, imaging) is **out of
|
|
62
|
+
scope** and lives in the separate `fermiviewer` project.
|
|
63
|
+
|
|
64
|
+
## Run it
|
|
65
|
+
|
|
66
|
+
**Install matrix** — pick whichever fits your workflow:
|
|
67
|
+
|
|
68
|
+
| Method | Command | Notes |
|
|
69
|
+
|--------|---------|-------|
|
|
70
|
+
| pipx (recommended) | `pipx install quantized-lab && qz` | isolated env, `qz` on PATH, no dev tools needed |
|
|
71
|
+
| uv tool | `uv tool install quantized-lab && qz` | same idea, via `uv` |
|
|
72
|
+
| pip | `pip install quantized-lab && qz` | into whatever env is active |
|
|
73
|
+
| Native installer | download from [Releases](https://github.com/pquarterman17/quantized/releases) | Windows `.exe` (NSIS, auto-updates), macOS `.dmg`, Linux `.deb` — no Python required, see [`RELEASE.md`](RELEASE.md) |
|
|
74
|
+
| From source | see below | for development |
|
|
75
|
+
|
|
76
|
+
Once installed, `qz` serves the app at `http://127.0.0.1:8000` and opens a
|
|
77
|
+
browser tab. An empty library shows a **"Drop files here, or use ⊞ to import
|
|
78
|
+
/ ✚ for a demo"** hint — click **✚** for an instant synthetic dataset (built
|
|
79
|
+
client-side), or hit `GET /api/samples/demo` for a bundled sample dataset
|
|
80
|
+
parsed server-side through the normal import path — so a fresh install has
|
|
81
|
+
something to plot within seconds, no data file required.
|
|
82
|
+
|
|
83
|
+
**From source — double-click a launcher** (builds the UI + installs deps on
|
|
84
|
+
first run, then opens the app in your browser):
|
|
85
|
+
|
|
86
|
+
- **Windows:** double-click [`run.cmd`](run.cmd)
|
|
87
|
+
- **macOS:** double-click [`run.command`](run.command) (first time:
|
|
88
|
+
right-click → Open)
|
|
89
|
+
|
|
90
|
+
**Or one command** (after `uv` + Node.js are installed):
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# first time only: build the UI bundle the app serves
|
|
94
|
+
cd frontend && npm install && npm run build && cd ..
|
|
95
|
+
|
|
96
|
+
uv run qz # serve on :8000 and open a browser tab
|
|
97
|
+
uv run qz --port 9000 # different port
|
|
98
|
+
uv run qz --no-browser # headless (don't open a tab; never auto-exits)
|
|
99
|
+
uv run qz --desktop # native window (needs: pip install quantized-lab[desktop])
|
|
100
|
+
uv run qz --dev # contributor mode: Vite HMR + reloading backend
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
The default mode behaves like an app: closing the last browser tab shuts
|
|
104
|
+
the server down (a page refresh doesn't). Set `QZ_AUTO_SHUTDOWN=0` to opt
|
|
105
|
+
out, use `--no-browser` for a persistent/headless server, or stop any mode
|
|
106
|
+
with **Ctrl+C** in its window.
|
|
107
|
+
|
|
108
|
+
Building your own wheel/sdist (e.g. for `pip install .`)? Build the frontend
|
|
109
|
+
**first** — `cd frontend && npm ci && npm run build` — before `uv build` /
|
|
110
|
+
`python -m build`, or the wheel ships without a UI (`qz` still runs; it just
|
|
111
|
+
prints a "UI not built" warning instead of serving one).
|
|
112
|
+
|
|
113
|
+
## Develop
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
uv sync --group dev # backend deps
|
|
117
|
+
uv run pytest # backend tests (+ `-m golden` for MATLAB parity)
|
|
118
|
+
uv run ruff check src tests && uv run mypy src
|
|
119
|
+
cd frontend && npm test && npm run build
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
License: Apache-2.0.
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# quantized
|
|
2
|
+
|
|
3
|
+
A clean-architecture Python + React port of the
|
|
4
|
+
[`quantized_matlab`](../quantized_matlab) scientific data toolbox for
|
|
5
|
+
magnetometry, X-ray/neutron diffraction, and generic lab data.
|
|
6
|
+
|
|
7
|
+
- **Backend parity** with the MATLAB toolbox: parsers, corrections,
|
|
8
|
+
plotting, peak & curve fitting, materials calculators (DiraCulator),
|
|
9
|
+
and a spreadsheet workspace (DataWorkspace).
|
|
10
|
+
- **Revamped GUI** built fresh in React, sharing the look-and-feel and
|
|
11
|
+
component conventions of the sibling [`fermiviewer`](../fermiviewer)
|
|
12
|
+
Python app.
|
|
13
|
+
- **Architecture that holds the line:** pure `io/` + `calc/` libraries,
|
|
14
|
+
thin FastAPI `routes/`, a 500-line per-module ceiling, and golden tests
|
|
15
|
+
that freeze MATLAB outputs as the parity oracle — so this port never
|
|
16
|
+
grows the god-scripts the MATLAB original accumulated.
|
|
17
|
+
|
|
18
|
+
> Status: **active development** — backend + GUI are functional; native
|
|
19
|
+
> installers and PyPI packages publish from tagged releases (see
|
|
20
|
+
> [`RELEASE.md`](RELEASE.md)). See [`plans/PORT_PLAN.md`](plans/PORT_PLAN.md)
|
|
21
|
+
> for the detailed workstream plan, and [`CLAUDE.md`](CLAUDE.md) for the
|
|
22
|
+
> architecture hard-rules.
|
|
23
|
+
|
|
24
|
+
## Scope
|
|
25
|
+
|
|
26
|
+
Magnetometry / XRD / lab-data analysis (parity with `quantized_matlab`).
|
|
27
|
+
Electron-microscopy tooling (Fermi viewer, EELS/EDS, imaging) is **out of
|
|
28
|
+
scope** and lives in the separate `fermiviewer` project.
|
|
29
|
+
|
|
30
|
+
## Run it
|
|
31
|
+
|
|
32
|
+
**Install matrix** — pick whichever fits your workflow:
|
|
33
|
+
|
|
34
|
+
| Method | Command | Notes |
|
|
35
|
+
|--------|---------|-------|
|
|
36
|
+
| pipx (recommended) | `pipx install quantized-lab && qz` | isolated env, `qz` on PATH, no dev tools needed |
|
|
37
|
+
| uv tool | `uv tool install quantized-lab && qz` | same idea, via `uv` |
|
|
38
|
+
| pip | `pip install quantized-lab && qz` | into whatever env is active |
|
|
39
|
+
| Native installer | download from [Releases](https://github.com/pquarterman17/quantized/releases) | Windows `.exe` (NSIS, auto-updates), macOS `.dmg`, Linux `.deb` — no Python required, see [`RELEASE.md`](RELEASE.md) |
|
|
40
|
+
| From source | see below | for development |
|
|
41
|
+
|
|
42
|
+
Once installed, `qz` serves the app at `http://127.0.0.1:8000` and opens a
|
|
43
|
+
browser tab. An empty library shows a **"Drop files here, or use ⊞ to import
|
|
44
|
+
/ ✚ for a demo"** hint — click **✚** for an instant synthetic dataset (built
|
|
45
|
+
client-side), or hit `GET /api/samples/demo` for a bundled sample dataset
|
|
46
|
+
parsed server-side through the normal import path — so a fresh install has
|
|
47
|
+
something to plot within seconds, no data file required.
|
|
48
|
+
|
|
49
|
+
**From source — double-click a launcher** (builds the UI + installs deps on
|
|
50
|
+
first run, then opens the app in your browser):
|
|
51
|
+
|
|
52
|
+
- **Windows:** double-click [`run.cmd`](run.cmd)
|
|
53
|
+
- **macOS:** double-click [`run.command`](run.command) (first time:
|
|
54
|
+
right-click → Open)
|
|
55
|
+
|
|
56
|
+
**Or one command** (after `uv` + Node.js are installed):
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# first time only: build the UI bundle the app serves
|
|
60
|
+
cd frontend && npm install && npm run build && cd ..
|
|
61
|
+
|
|
62
|
+
uv run qz # serve on :8000 and open a browser tab
|
|
63
|
+
uv run qz --port 9000 # different port
|
|
64
|
+
uv run qz --no-browser # headless (don't open a tab; never auto-exits)
|
|
65
|
+
uv run qz --desktop # native window (needs: pip install quantized-lab[desktop])
|
|
66
|
+
uv run qz --dev # contributor mode: Vite HMR + reloading backend
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
The default mode behaves like an app: closing the last browser tab shuts
|
|
70
|
+
the server down (a page refresh doesn't). Set `QZ_AUTO_SHUTDOWN=0` to opt
|
|
71
|
+
out, use `--no-browser` for a persistent/headless server, or stop any mode
|
|
72
|
+
with **Ctrl+C** in its window.
|
|
73
|
+
|
|
74
|
+
Building your own wheel/sdist (e.g. for `pip install .`)? Build the frontend
|
|
75
|
+
**first** — `cd frontend && npm ci && npm run build` — before `uv build` /
|
|
76
|
+
`python -m build`, or the wheel ships without a UI (`qz` still runs; it just
|
|
77
|
+
prints a "UI not built" warning instead of serving one).
|
|
78
|
+
|
|
79
|
+
## Develop
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
uv sync --group dev # backend deps
|
|
83
|
+
uv run pytest # backend tests (+ `-m golden` for MATLAB parity)
|
|
84
|
+
uv run ruff check src tests && uv run mypy src
|
|
85
|
+
cd frontend && npm test && npm run build
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
License: Apache-2.0.
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "quantized-lab"
|
|
3
|
+
version = "0.8.0"
|
|
4
|
+
description = "Clean-architecture Python + React port of the quantized_matlab scientific toolbox (magnetometry / XRD / lab data)."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.11"
|
|
7
|
+
license = "Apache-2.0"
|
|
8
|
+
authors = [{ name = "Paige Quarterman" }]
|
|
9
|
+
dependencies = [
|
|
10
|
+
"fastapi>=0.139.0",
|
|
11
|
+
"uvicorn[standard]>=0.51.0",
|
|
12
|
+
"numpy>=1.26",
|
|
13
|
+
"scipy>=1.11",
|
|
14
|
+
"pydantic>=2.7",
|
|
15
|
+
"openpyxl>=3.1",
|
|
16
|
+
"h5py>=3.10",
|
|
17
|
+
"python-multipart>=0.0.32",
|
|
18
|
+
"matplotlib>=3.11.0",
|
|
19
|
+
"periodictable>=1.7",
|
|
20
|
+
"platformdirs>=4.10.0",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
[project.scripts]
|
|
24
|
+
qz = "quantized.cli:main"
|
|
25
|
+
quantized = "quantized.cli:main"
|
|
26
|
+
diraculator = "quantized.cli:main_calc"
|
|
27
|
+
|
|
28
|
+
[project.optional-dependencies]
|
|
29
|
+
# Word/PowerPoint report export (#37). MIT-licensed, pure-python. Optional so
|
|
30
|
+
# the core install stays lean — io/report_export.py guards these imports and
|
|
31
|
+
# LaTeX/HTML export always work; `pip install quantized[office]` enables .docx/.pptx.
|
|
32
|
+
office = [
|
|
33
|
+
"python-docx>=1.1",
|
|
34
|
+
"python-pptx>=1.0",
|
|
35
|
+
]
|
|
36
|
+
# COM "Send to Origin" (item 25) — Windows-only optional, behind QZ_ORIGIN_COM=1
|
|
37
|
+
# (architecture guard #10: never a hard dependency, never a CI requirement).
|
|
38
|
+
# io/origin_com.py imports win32com lazily and guards its absence; the
|
|
39
|
+
# cross-platform fallback (Origin-ASCII / .ogs, always available) is
|
|
40
|
+
# io/origin.py. `pip install quantized[origin-com]` adds the live COM path.
|
|
41
|
+
origin-com = [
|
|
42
|
+
"pywin32; sys_platform == 'win32'",
|
|
43
|
+
]
|
|
44
|
+
# `qz --desktop` native window (PORT_PLAN #3): pure-Python pywebview shell for
|
|
45
|
+
# dev/daily use; the Tauri shell (src-tauri/) stays the packaged path (W8).
|
|
46
|
+
# BSD-3 licensed. server_launch.py guards the import — without this extra,
|
|
47
|
+
# `qz --desktop` prints an install hint and every other mode works normally.
|
|
48
|
+
desktop = [
|
|
49
|
+
"pywebview>=5.1",
|
|
50
|
+
]
|
|
51
|
+
# Advanced statistics: GLM, survival analysis, Cox PH (gap #30). BSD-3 / MIT
|
|
52
|
+
# licensed. Optional so core install stays lean — calc/stats_glm.py and
|
|
53
|
+
# calc/stats_survival.py guard these imports; ROC is pure numpy and always
|
|
54
|
+
# available. `pip install quantized[stats]` enables GLM/survival methods.
|
|
55
|
+
stats = [
|
|
56
|
+
"statsmodels>=0.14",
|
|
57
|
+
"lifelines>=0.27",
|
|
58
|
+
]
|
|
59
|
+
# Optional bumps fit engine (GOTO #10). BSD-3 licensed. calc/fit_bumps.py
|
|
60
|
+
# guards the import — the MATLAB-parity fitter (calc/fitting.py, golden-locked)
|
|
61
|
+
# stays the default engine everywhere; bumps adds amoeba/lm/de/dream as an
|
|
62
|
+
# ADDITIONAL engine. `pip install quantized[bumps]` enables it.
|
|
63
|
+
bumps = [
|
|
64
|
+
"bumps>=1.0",
|
|
65
|
+
]
|
|
66
|
+
|
|
67
|
+
[dependency-groups]
|
|
68
|
+
dev = [
|
|
69
|
+
"pytest>=8",
|
|
70
|
+
"httpx>=0.27",
|
|
71
|
+
"ruff>=0.15.21",
|
|
72
|
+
"mypy>=2.2.0",
|
|
73
|
+
# exercise the optional office exporters (#37) in CI
|
|
74
|
+
"python-docx>=1.1",
|
|
75
|
+
"python-pptx>=1.0",
|
|
76
|
+
# exercise the optional stats methods (GLM/survival/Cox) in CI
|
|
77
|
+
"statsmodels>=0.14",
|
|
78
|
+
"lifelines>=0.27",
|
|
79
|
+
# exercise the optional bumps fit engine (GOTO #10) in CI
|
|
80
|
+
"bumps>=1.0",
|
|
81
|
+
]
|
|
82
|
+
# Desktop packaging only — used by the release workflow to freeze the server
|
|
83
|
+
# into a self-contained sidecar (tools/bundle/qz-server.spec). Never a runtime
|
|
84
|
+
# dependency; CI installs it with `uv sync --group bundle`.
|
|
85
|
+
bundle = [
|
|
86
|
+
"pyinstaller>=6.10",
|
|
87
|
+
]
|
|
88
|
+
|
|
89
|
+
[build-system]
|
|
90
|
+
requires = ["hatchling"]
|
|
91
|
+
build-backend = "hatchling.build"
|
|
92
|
+
|
|
93
|
+
# Hatchling's default sdist has no include/exclude list, so it sweeps in the
|
|
94
|
+
# whole repo (frontend/node_modules alone is 5000+ files) — scope it to just
|
|
95
|
+
# what a build needs: the package sources (including src/quantized/web/, the
|
|
96
|
+
# gitignored Vite build output, and src/quantized/samples/, the bundled demo
|
|
97
|
+
# dataset — both walked from disk, not from git, so they're picked up when
|
|
98
|
+
# present) plus top-level metadata. Build the SPA BEFORE `uv build` / `python
|
|
99
|
+
# -m build` (`cd frontend && npm ci && npm run build`) or the wheel ships
|
|
100
|
+
# without a UI (qz still runs — see cli.py's "UI not built" warning).
|
|
101
|
+
[tool.hatch.build.targets.sdist]
|
|
102
|
+
include = ["src/quantized", "README.md", "LICENSE", "NOTICE"]
|
|
103
|
+
# Hatchling force-includes LICENSE*/README*-named files project-wide by
|
|
104
|
+
# default (a footgun here: every vendored npm package under
|
|
105
|
+
# frontend/node_modules ships its own LICENSE + README.md) — exclude wins
|
|
106
|
+
# over that default, so this is required even with the include list above.
|
|
107
|
+
exclude = ["frontend/**"]
|
|
108
|
+
# The Vite SPA output (src/quantized/web/**) is gitignored, so hatchling's
|
|
109
|
+
# VCS-aware sdist drops it even though it's under the `include` path above.
|
|
110
|
+
# `uv build`/`python -m build` build the WHEEL FROM THIS SDIST, so if the SPA
|
|
111
|
+
# is missing here it's missing from the wheel too (the wheel target's own
|
|
112
|
+
# artifacts= can't re-add what the sdist never carried). Force-include it in
|
|
113
|
+
# BOTH targets. (Regression fixed 2026-07-08: v0.5.0's wheel shipped UI-less.)
|
|
114
|
+
artifacts = ["src/quantized/web/**"]
|
|
115
|
+
|
|
116
|
+
[tool.hatch.build.targets.wheel]
|
|
117
|
+
packages = ["src/quantized"]
|
|
118
|
+
# `packages` alone only reliably ships src/quantized/web/ when hatchling
|
|
119
|
+
# builds directly against a live git checkout; building the wheel FROM an
|
|
120
|
+
# sdist (what `uv build`/`python -m build` do by default, and what the
|
|
121
|
+
# publish workflow does) drops it, since that step can't see this repo's
|
|
122
|
+
# .git and treats the gitignored build output as excluded. `artifacts` is
|
|
123
|
+
# hatchling's explicit "include this even though it looks ignored" escape
|
|
124
|
+
# hatch — force it so the SPA ships in both the direct-build and
|
|
125
|
+
# build-from-sdist paths.
|
|
126
|
+
artifacts = ["src/quantized/web/**"]
|
|
127
|
+
|
|
128
|
+
[tool.ruff]
|
|
129
|
+
line-length = 100
|
|
130
|
+
target-version = "py311"
|
|
131
|
+
src = ["src", "tests"]
|
|
132
|
+
|
|
133
|
+
[tool.ruff.lint]
|
|
134
|
+
select = ["E", "F", "I", "UP", "B"]
|
|
135
|
+
|
|
136
|
+
[tool.ruff.lint.per-file-ignores]
|
|
137
|
+
# Miller indices are conventionally named h, k, l — `l` is unavoidable and clear
|
|
138
|
+
# in crystallographic context (E741 "ambiguous variable name").
|
|
139
|
+
"src/quantized/calc/crystallography.py" = ["E741"]
|
|
140
|
+
"src/quantized/routes/crystallography.py" = ["E741"]
|
|
141
|
+
"tests/test_crystallography.py" = ["E741"]
|
|
142
|
+
"tests/test_calc_planespacings.py" = ["E741"]
|
|
143
|
+
|
|
144
|
+
[tool.mypy]
|
|
145
|
+
python_version = "3.11"
|
|
146
|
+
strict = true
|
|
147
|
+
|
|
148
|
+
[[tool.mypy.overrides]]
|
|
149
|
+
# Third-party libs without bundled type stubs — skeleton-safe.
|
|
150
|
+
module = ["scipy.*", "uvicorn.*", "openpyxl.*", "h5py.*", "periodictable.*", "docx.*", "pptx.*", "mpl_toolkits.*", "win32com.*", "statsmodels.*", "lifelines.*", "pandas.*", "webview.*", "bumps.*"]
|
|
151
|
+
ignore_missing_imports = true
|
|
152
|
+
|
|
153
|
+
[tool.pytest.ini_options]
|
|
154
|
+
markers = [
|
|
155
|
+
"golden: compares output against frozen quantized_matlab reference values",
|
|
156
|
+
"realdata: needs the local-only instrument corpus (auto-skips when absent)",
|
|
157
|
+
"perf: wall-time regression tripwires with generous ceilings (not benchmarks)",
|
|
158
|
+
]
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"""quantized — Python backend for the quantized toolbox port.
|
|
2
|
+
|
|
3
|
+
Layered, enforced architecture (see CLAUDE.md):
|
|
4
|
+
- ``datastruct`` + ``io`` + ``calc`` are pure libraries (no web imports).
|
|
5
|
+
- ``routes`` are thin FastAPI adapters.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
__version__ = "0.7.0"
|
|
11
|
+
__all__ = ["__version__"]
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""Enable ``python -m quantized`` → runs the ``qz`` CLI.
|
|
2
|
+
|
|
3
|
+
The Tauri desktop shell's dev fallback spawns the server as
|
|
4
|
+
``python -m quantized --no-browser`` (so ``kill()`` reaches uvicorn directly,
|
|
5
|
+
not an orphaned launcher). Keeping this module trivial means the entry point
|
|
6
|
+
stays stable regardless of how ``cli.main`` evolves.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
from quantized.cli import main
|
|
12
|
+
|
|
13
|
+
if __name__ == "__main__":
|
|
14
|
+
main()
|