Dynamfit revamp#535
Open
richardsheridan wants to merge 19 commits into
Open
Conversation
…e route
Users can now supply per-point measurement uncertainties via optional
error columns in the uploaded data file, and tune the fallback scale
when they don't. The previous behavior (y_std = 0.2 * |E*|) is
preserved as the default, so existing callers see identical fits.
* smooth_prony_fit takes explicit E_stor_std / E_loss_std arrays
* upload_init accepts 3/4/5-column frequency or temperature files
(extras: a shared 'Error' column or per-modulus 'E Storage Error' /
'E Loss Error') and 2/3-column shift files (extra 'Error' parsed but
unused).
Prevents Windows/WSL from rewriting hook shebangs to CRLF, which breaks execution in Linux containers (cannot run: No such file or directory).
…n data Add fit_wlf_coefficients and fit_hybrid_coefficients to dynamfit2.py: fit shift-model coefficients from uploaded shift-factor data (T, a_T) via scipy.optimize.curve_fit in log10(a_T) space. Caller-supplied coefficients are held fixed by excluding them from the fit (closure reparametrization, since scipy 1.10.1 rejects equal bounds; TODO to switch to lb==ub on bump). For hybrid, TL is a required upstream input (from a prior extract call), not co-fit. Expose via a fit_shift_coefficients short-circuit branch in /extract/ that returns coefficients only (no Prony/charts) and does not require the primary temp/freq file. Left as a branch with a TODO motivating a future dedicated route, per its limited inputs/outputs. Tests: WLF/hybrid round-trip recovery, param-fixing, ValueError guards, and a new route-test harness (bare Flask app + blueprint, sidestepping the in-container log-file handler) covering the branch's validation and response. Add end-to-end route tests over real shift files (agilus30 WLF both-free, VeroCyan hybrid) plus a cold-data unit test asserting convergence and the C2 bound. Full module: 158 tests.
…r fit Shift-factor files are not necessarily referenced to TL, but hybrid_shift was always 1 at TL. Now fit_hybrid_coefficients co-fits a_T_ref so even cases where TL is not aligned with the data will work.
Also fix tests.utils.test_db_utils so it passes outside docker and package services/tests/ so discovery runs
….disabled from component inline style
…namfitTransformMethod type. AlsoaAdded fetchFitShiftData action that calls
…WLF shift clamp, and manual shift-factor interpolation
…of loading the sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the remade dynamfit backend code as Tolu and I discussed. I've just gotten a local frontend working so we can work on getting it properly integrated. the backend should be ready for a code review and checking if it meets the API contract we discussed on zoom.