Skip to content

Preparation for ivscc apfrequency operation#2730

Merged
t-b merged 12 commits into
mainfrom
feature/2730-prepare_ivscc_apfrequency
Jul 6, 2026
Merged

Preparation for ivscc apfrequency operation#2730
t-b merged 12 commits into
mainfrom
feature/2730-prepare_ivscc_apfrequency

Conversation

@MichaelHuth

@MichaelHuth MichaelHuth commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

This PR pulls out the following three components from PR #2599 :

  • SF plotter support für ErrorBar Style and display AxisPercentage of plot
  • operation GetMeta
  • operation preparefit
  • operation fit2

with tests and docu

close #2731

@MichaelHuth MichaelHuth self-assigned this Jun 22, 2026
Copilot AI review requested due to automatic review settings June 22, 2026 13:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prepares the SweepFormula subsystem for the upcoming ivscc_apfrequency operation by adding reusable operations (getmeta, preparefit, fit2) and enhancing SweepFormula plotting metadata (error bar styles + axis offsets/percent display), along with tests and documentation.

Changes:

  • Added SweepFormula operations: getmeta, preparefit, and fit2 (plus executor wiring and new constants/meta keys).
  • Extended SF plotter support for error bar styling and axis offset/percentage metadata.
  • Added automated tests and updated SweepFormula documentation for the new operations.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
Packages/tests/UTF_DataGenerators.ipf Adds a test data generator for integrated Igor fit function names.
Packages/tests/Basic/UTF_SweepFormula_Operations.ipf Adds extensive tests for getmeta, preparefit, and fit2 (success + failure cases).
Packages/MIES/MIES_WaveDataFolderGetters.ipf Extends plot metadata wave shape; introduces errorbar-style wave factory; adds preparefit output wave creator.
Packages/MIES/MIES_Utilities_SFHCheckers.ipf Adds new checker helpers for integer/non-negative arguments and preparefit hold-string validation.
Packages/MIES/MIES_SweepFormula.ipf Extends plot metadata filling, adds axis property application, and plumbs errorbar-style metadata into plotting.
Packages/MIES/MIES_SweepFormula_Operations.ipf Implements getmeta, preparefit, and fit2 including fit metadata emission and error bar generation.
Packages/MIES/MIES_SweepFormula_Helpers.ipf Adds helper to set fit trace styling + errorbar-style metadata for plotted fit output.
Packages/MIES/MIES_SweepFormula_Executor.ipf Registers the new operations with the SweepFormula executor.
Packages/MIES/MIES_Constants.ipf Adds new SF operation names, meta keys (fit + plotting), preparefit constants, and fit error/quit reason codes.
Packages/doc/SweepFormula.rst Documents getmeta, preparefit, and fit2 usage and fit metadata keys.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Packages/MIES/MIES_SweepFormula_Operations.ipf Outdated
Comment thread Packages/doc/SweepFormula.rst Outdated
Comment thread Packages/doc/SweepFormula.rst Outdated
Comment thread Packages/MIES/MIES_SweepFormula.ipf Outdated
@MichaelHuth MichaelHuth force-pushed the feature/2730-prepare_ivscc_apfrequency branch from 05bd0c6 to de67fef Compare June 22, 2026 14:23
Copilot AI review requested due to automatic review settings June 22, 2026 17:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.

Comment thread Packages/tests/UTF_DataGenerators.ipf Outdated
Comment thread Packages/MIES/MIES_SweepFormula_Operations.ipf Outdated
@MichaelHuth MichaelHuth force-pushed the feature/2730-prepare_ivscc_apfrequency branch from 99c1655 to 487b685 Compare June 23, 2026 13:30
Copilot AI review requested due to automatic review settings June 23, 2026 13:33
@MichaelHuth MichaelHuth force-pushed the feature/2730-prepare_ivscc_apfrequency branch from 487b685 to f8a5bf6 Compare June 23, 2026 13:33
@MichaelHuth MichaelHuth assigned t-b and unassigned MichaelHuth Jun 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 12 changed files in this pull request and generated 2 comments.

Comment thread Packages/MIES/MIES_SweepFormula_Operations.ipf
Comment thread Packages/MIES/MIES_SweepFormula_Operations.ipf Outdated
@MichaelHuth MichaelHuth assigned MichaelHuth and unassigned t-b Jun 25, 2026
@MichaelHuth MichaelHuth force-pushed the feature/2730-prepare_ivscc_apfrequency branch from f8a5bf6 to 97d6b31 Compare June 26, 2026 12:53
@MichaelHuth MichaelHuth assigned t-b and unassigned MichaelHuth Jun 26, 2026
Copilot AI review requested due to automatic review settings June 26, 2026 16:03
@MichaelHuth MichaelHuth force-pushed the feature/2730-prepare_ivscc_apfrequency branch from 97d6b31 to 016c5ec Compare June 26, 2026 16:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 12 changed files in this pull request and generated 2 comments.

Comment thread Packages/MIES/MIES_SweepFormula.ipf
Comment thread Packages/doc/SweepFormula.rst Outdated
@MichaelHuth MichaelHuth force-pushed the feature/2730-prepare_ivscc_apfrequency branch from 016c5ec to 73dfcad Compare June 26, 2026 16:23
@t-b

t-b commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

@claude review

1 similar comment
@t-b

t-b commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

@claude review

@MichaelHuth

Copy link
Copy Markdown
Collaborator Author

Hmm for me claude is not in the reviewers list and I can not choose it.

@MichaelHuth MichaelHuth assigned MichaelHuth and unassigned t-b Jul 6, 2026
@t-b t-b self-requested a review July 6, 2026 15:10
@t-b

t-b commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

@MichaelHuth Can the copilot comments being dismissed? If yes please do so.

@MichaelHuth MichaelHuth force-pushed the feature/2730-prepare_ivscc_apfrequency branch from 97f563a to dd8c83a Compare July 6, 2026 15:26
@MichaelHuth MichaelHuth assigned t-b and unassigned MichaelHuth Jul 6, 2026
t-b
t-b previously approved these changes Jul 6, 2026
@MichaelHuth

Copy link
Copy Markdown
Collaborator Author

@t-b Sorry, I have to push once more, as the number of coefficient change for poly n that Copilot suggested is actually wrong. I need to revert that. So for poly n, the n refers to the number of terms, whereas for poly2D n refers to the degree of the polynomial.

@t-b t-b enabled auto-merge July 6, 2026 16:04
@t-b t-b disabled auto-merge July 6, 2026 16:04
Preparefit allows to create a fitting profile for a subsequent fit.

This profile is currently used by the operation fit2 as argument.

preparefit([fitFuncName, length, errorbarType, errorbarStyle, confLevel, coefs, holdStr, range, constraints])

When called without arguments the resulting profile is set to NO_FIT and
fit2 will return an null wave.

The profile allows to set a fit function name, that can be an Igor Pro
integrated or user fit function.
The length argument sets the number of point in the fit result. When set
the zero the number of points equals the number of input points.
errorbarType, errorbarStyle, confLevel define which information is
returned as errorbar with style hints for displaying.
coefs, holdStr, range, constraints are technically the same arguments
that CurveFit takes. holdStr was changed from a 01 syntax to OX to allow
easy input as quoteless string.
coefs, range and constraints are arrays.

The operation returns a types result, such that a consuming function can
verify the origin. Some aspects of the input are checked by Preparefit
itself, e.g. existence of user fit function, number of coefficient,
number of elements in holdStr.
fit2 is a operation that allows to run a fit on input data. The design
is rather generic.

The call can be either written with an x-wave or without:

fit2(wvY, preparefit)

fit2(wvY, wvX, preparefit)

preparefit is a fit profile from the operation preparefit.

Errorbar meta information from wvY and wvX is used a standard deviation
for the input. If there is a standard deviation for x-values an ODR fit
is run.

The fit2 function returns the fitted data and all additional generated
data as meta data that can be retrieved with getmeta. It also sets the
errorbars of the result according to the specification from the fit
profile from preparefit.

If the fit fails a zero sized wave is returned where from the meta data,
e.g. with the key from SF_META_FITERROR the error code can be retrieved.
The function SFH_IsArray does a check if the WaveRef wave has a single
row.
If yes then it refers further to an array.
If it has multiple rows, then it must be datasets and no array.

The brackets were set wrong for this check.

Since:
50ce1f5 (SFH: Introduce function SFH_MoveDatasetHigherIfCompatible, 2024-06-11)
Copilot AI review requested due to automatic review settings July 6, 2026 16:06
@MichaelHuth MichaelHuth force-pushed the feature/2730-prepare_ivscc_apfrequency branch from dd8c83a to 8ab4683 Compare July 6, 2026 16:06
@t-b t-b self-requested a review July 6, 2026 16:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.

Comment thread Packages/MIES/MIES_Constants.ipf
@t-b t-b enabled auto-merge July 6, 2026 17:10
@t-b t-b removed their assignment Jul 6, 2026
@t-b t-b merged commit 4e4ee36 into main Jul 6, 2026
23 of 24 checks passed
@t-b t-b deleted the feature/2730-prepare_ivscc_apfrequency branch July 6, 2026 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Get standard deviation in x for ODR plot from SF fit2 operation

3 participants