Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Rename apply to mapSlices #3357

Merged
merged 4 commits into from
Jan 30, 2025

Conversation

gwhitney
Copy link
Collaborator

This renaming conforms with the Julia name for the function formerly
called apply, and allows it to be called from the expression parser.
The previous name apply is kept as an alias for mapSlices, for
backward compatibility. This commit implements an alias metadata
property for function factories to facilitate the apply alias for
mapSlices.

As a separate bonus, this PR corrects several typos in function docs
and removes now-passing doc tests from the list of "known failing" doc
tests to get down to 45 known failures and 136 total issues in doc tests.
(Most of the excess of 136 as compared to 45 are just due to roundoff
error/slight inaccuracy of what the documentation claims the result will
be and the actual result returned by mathjs. When the 45 are eliminated,
a reasonable numeric tolerance can be decided on for doc testing and
then the doc tests can be made binding rather than advisory.

Also adds embedded docs for mapSlices, which were not present for
apply, perhaps because it could not be used from the parser.

Resolves #3041.
Resolves #3340.

  This renaming conforms with the Julia name for the function formerly
  called `apply`, and allows it to be called from the expression parser.
  The previous name `apply` is kept as an alias for `mapSlices`, for
  backward compatibility. This commit implements an `alias` metadata
  property for function factories to facilitate the `apply` alias for
  `mapSlices`.

  As a separate bonus, this PR corrects several typos in function docs
  and removes now-passing doc tests from the list of "known failing" doc
  tests to get down to 45 known failures and 136 total issues in doc tests.
  (Most of the excess of 136 as compared to 45 are just due to roundoff
  error/slight inaccuracy of what the documentation claims the result will
  be and the actual result returned by mathjs. When the 45 are eliminated,
  a reasonable numeric tolerance can be decided on for doc testing and
  then the doc tests can be made binding rather than advisory.
@gwhitney gwhitney added the category:expressions Issues about the expression parser, variable scoping etc. label Jan 25, 2025
Copy link
Owner

@josdejong josdejong left a comment

Choose a reason for hiding this comment

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

Thanks for picking this up @gwhitney . The PR mostly looks good, and I made a couple of inline comments. Can you have a look at those?

types/index.d.ts Show resolved Hide resolved
types/index.d.ts Show resolved Hide resolved
docs/core/extension.md Outdated Show resolved Hide resolved
@josdejong josdejong self-requested a review January 30, 2025 12:16
@josdejong josdejong merged commit 127ea62 into josdejong:develop Jan 30, 2025
8 checks passed
@josdejong
Copy link
Owner

Published now in v14.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:expressions Issues about the expression parser, variable scoping etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

apply not functioning in homepage repl
2 participants