Skip to content

Add zscoreFS function signature with inputs and outputs - #128

Merged
BoschiGiacomo merged 5 commits into
UniprJRC:masterfrom
matteozanettii:zscore
Sep 29, 2026
Merged

BoschiGiacomo merged 5 commits into
UniprJRC:masterfrom
matteozanettii:zscore

Conversation

@matteozanettii

@matteozanettii matteozanettii commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Proposed changes

This PR adds the configuration for the zscoreFS function to the functionSignatures.json file.

Details of changes

Mapped inputs: X, loc, scale, and dim.
Choices: Added dropdown autocomplete suggestions for the optional arguments loc ('median', 'mean') and scale ('mad', 'Qn', 'Sn', 'std', 'modmadp').
Mapped outputs: Z, mu, and sigma.
The JSON structure matches the logic of the existing functions in the file, allowing the editor to correctly display parameter suggestions and descriptions while typing.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Updated parameter 'kind' from 'optional' to 'ordered' for multiple entries and changed type from 'numeric' to 'double'. Also fixed the function signatures errors from zscore

@BoschiGiacomo BoschiGiacomo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hi @matteozanettii, thanks for your submission. There is only one problem with autocompletions that are shown twice, in the following comments you can find a quick fix and explanation.

As soon as it's fixed we can merge your work, thanks.

Comment thread toolbox/utilities/functionSignatures.json Outdated
Comment thread toolbox/utilities/functionSignatures.json
Removed redundant array structure for type definitions in function signatures.
@matteozanettii

Copy link
Copy Markdown
Contributor Author

Hi @BoschiGiacomo , thanks for the review! There are all the changes I made:

Resolved the issue of duplicated dropdown choices across all functions (including the existing getTickers, getYahoo, and getFundamentals) by merging the "char" and "string" types with their "choices" into a single, unified block.,

Then fixed the syntax errors in topPanelMode and bottomPanelMode by removing the unsupported textual descriptions from the "type" arrays and moving them into the "purpose" fields;
Replaced the deprecated "optional" keyword with "ordered" for the zscoreFS positional inputs and changed the generic "numeric" output types to "double" to successfully pass the validateFunctionSignaturesJSON check.

However, compared to what we discussed together, I preserved the original logic of this exact JSON file instead of the other fuctionsignatures files

there is the check from the validator:

image

@BoschiGiacomo BoschiGiacomo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hi Matteo, thanks for looking into the other signatures of the file as well. There is a problem introduced by your latest changes: flattening the type arrays changes their meaning from OR to AND; I have detailed it in the comment below.

From the MathWorks documentation:

To match any of multiple classes or attributes, use a list of lists of JSON strings. For the inner lists, MATLAB uses a logical AND of the values.

The same page uses "type":[["char"],["string"]] for an argument that accepts either class.

Once this is fixed, we can merge. Thanks.

Comment thread toolbox/utilities/functionSignatures.json Outdated
Comment thread toolbox/utilities/functionSignatures.json Outdated
@matteozanettii

Copy link
Copy Markdown
Contributor Author

Hi @BoschiGiacomo , thanks a lot for the explanation and for taking a detailed look at the whole file!
Also thank you for teaching me the AND/OR logic issue introduced by flattening the arrays; I hadn't known that. The brief of changes:
I restored the nested brackets ([[...], [...]]) to correctly maintain the OR logic between types.
To fix the original issue with duplicate dropdown suggestions, I isolated the choices into their own dedicated sub-array (e.g., ["choices={...}"]).
I also fixed the text in the purpose fields for topPanelMode and bottomPanelMode, reverting to the short descriptions to avoid cluttering the MATLAB suggestion popup. (I made sure this applies to the whole file). I also rechecked with the validator if everything was right and reported me 0 errors
Everything should be in order now. Feel free to take a look when you have a moment and let me know if we are good to merge! Thanks again for the help.

@BoschiGiacomo BoschiGiacomo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me. Thank you for your contribution, @matteozanettii!

I pushed a small fix removing 'modmadp' from the scale choices, since it's a placeholder and not a valid value.

@BoschiGiacomo
BoschiGiacomo merged commit b38dae4 into UniprJRC:master Sep 29, 2026
1 of 27 checks passed
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.

2 participants