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

feat: formulas implemented #2496

Closed
wants to merge 33 commits into from
Closed

Conversation

abdelrahman830a
Copy link

close #xxx

Pull Request Checklist

  • Related tickets or issues have been linked in the PR description (or missing issue).
  • Naming convention is followed (do please check it especially when you created new plugins, commands and resources).
  • Unit tests have been added for the changes (if applicable).
  • Breaking changes have been documented (or no breaking changes introduced in this PR).

expect(result.getValue()).toBe(0);
});

it('Value is array', () => {
Copy link
Member

Choose a reason for hiding this comment

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

Do not remove any existing test cases

expect(result.getValue()).toBe(0);
});

it('Value is array', () => {
Copy link
Member

Choose a reason for hiding this comment

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

same above

import { ErrorType } from '../../../../basics/error-type';
import { ErrorValueObject } from '../../../../engine/value-object/base-value-object';

describe('Test acoth function', () => {
Copy link
Member

Choose a reason for hiding this comment

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

Need to support tests for array formulas

import { ErrorType } from '../../../../basics/error-type';
import { ErrorValueObject } from '../../../../engine/value-object/base-value-object';

describe('Test asin function', () => {
Copy link
Member

Choose a reason for hiding this comment

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

Need to support tests for array formulas

@Dushusir
Copy link
Member

Please make sure all CI passes

}

// Assuming variant1 and variant2 can be arrays of different lengths
let array1 = Array.isArray(variant1) ? variant1 : [variant1];
Copy link
Member

Choose a reason for hiding this comment

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

The row length and column lenth of two 2D arrays may be different. Both row and column need to be expanded to be consistent. You cannot just process the row length. Please refer to the usage of expandArrayValueObject in the source code for expansion.

import { ErrorType } from '../../../../basics/error-type';
import { ErrorValueObject } from '../../../../engine/value-object/base-value-object';

describe('Test atan2 function', () => {
Copy link
Member

Choose a reason for hiding this comment

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

There is no test for array parameters of different sizes. Multiple combinations are required, such as testing numbers and arrays, strings and arrays, numbers and strings, arrays and arrays, etc.

number1: { name: 'number1', detail: 'first' },
number2: { name: 'number2', detail: 'second' },
number1: { name: 'number1', detail: 'The real number for which you want to calculate the hyperbolic cosine.' },
number2: { name: 'number2', detail: 'Optional. A second real number.' },
Copy link
Member

Choose a reason for hiding this comment

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

no second param

number1: { name: 'number1', detail: 'first' },
number2: { name: 'number2', detail: 'second' },
number1: { name: 'number1', detail: 'The angle in radians for which you want to calculate the cotangent.' },
number2: { name: 'number2', detail: 'Optional. A second angle.' },
Copy link
Member

Choose a reason for hiding this comment

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

no second param

@@ -144,6 +144,7 @@ export const FUNCTION_LIST_MATH: IFunctionInfo[] = [
},
],
Copy link
Member

Choose a reason for hiding this comment

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

need handle functionParameter in function-list, you can test in UI

Copy link
Member

@Dushusir Dushusir left a comment

Choose a reason for hiding this comment

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

needs improvement

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.

None yet

2 participants