Skip to content

feat: add math/base/special/lucasf #6223

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

Merged
merged 38 commits into from
Apr 17, 2025
Merged

Conversation

hrshya
Copy link
Contributor

@hrshya hrshya commented Mar 20, 2025

Resolves none .

Description

What is the purpose of this pull request?

This pull request:

  • adds math/base/special/lucasf .

Related Issues

Does this pull request have any related issues?

This pull request:

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.


@stdlib-js/reviewers

@stdlib-bot stdlib-bot added Math Issue or pull request specific to math functionality. Needs Review A pull request which needs code review. labels Mar 20, 2025
@hrshya hrshya marked this pull request as draft March 20, 2025 09:09
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Mar 20, 2025
@stdlib-bot
Copy link
Contributor

stdlib-bot commented Mar 20, 2025

Coverage Report

Package Statements Branches Functions Lines
math/base/special/lucasf $\color{green}224/224$
$\color{green}+100.00\%$
$\color{green}10/10$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}224/224$
$\color{green}+100.00\%$

The above coverage report was generated for the changes in this PR.

@hrshya hrshya marked this pull request as ready for review March 20, 2025 11:40
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Mar 20, 2025
Signed-off-by: Harsh <149176984+hrshya@users.noreply.github.com>
@hrshya
Copy link
Contributor Author

hrshya commented Mar 22, 2025

@anandkaranubc could you please review this PR?

@anandkaranubc anandkaranubc self-requested a review March 22, 2025 19:24
Signed-off-by: Harsh <149176984+hrshya@users.noreply.github.com>
@anandkaranubc anandkaranubc changed the title feat: add math/base/special/lucasf feat: add math/base/special/lucasf Mar 23, 2025
@kgryte
Copy link
Member

kgryte commented Apr 2, 2025

@anandkaranubc Would you mind taking a look at this PR?

@anandkaranubc
Copy link
Contributor

/stdlib merge

@stdlib-bot stdlib-bot added the bot: In Progress Pull request is currently awaiting automation. label Apr 5, 2025
@stdlib-bot stdlib-bot removed the bot: In Progress Pull request is currently awaiting automation. label Apr 5, 2025
Copy link
Contributor

@anandkaranubc anandkaranubc left a comment

Choose a reason for hiding this comment

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

Hi @hrshya, thanks for your work on this! I’ve added some comments on the PR. A few areas need improvement.


#### lucasf( n )

Computes the nth [Lucas number][lucas-number] in single-precision floating-point format.
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment

<!-- eslint no-undef: "error" -->

```javascript
var lucasf = require( '@stdlib/math/base/special/lucasf' );
Copy link
Contributor

Choose a reason for hiding this comment

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

This should also be refactored to use logEachMap

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Shouldn't we use array/base/linspace here to get the lucasf values in an increasing order like lucasf( 0 ) till n as compared to using a discreteUniform here which would give us random lucasf values.

cc: @anandkaranubc

Copy link
Contributor

Choose a reason for hiding this comment

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

@hrshya Either is fine, I believe. The goal is to showcase a working code example. I changed it to use discreteUniform to align with the other refactoring being done in math/base/special. Another reason is that you were using linspace with four arguments, including opts, which linspace doesn't require.

function linspace( x1, x2, len ) {

If you think this change was accidentally propagated to other packages, a PR is probably needed for that.


#### stdlib_base_lucasf( n )

Computes the nth [Lucas number][lucas-number] in single-precision floating-point format.
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment

@anandkaranubc anandkaranubc added JavaScript Issue involves or relates to JavaScript. C Issue involves or relates to C. Needs Changes Pull request which needs changes before being merged. and removed Needs Review A pull request which needs code review. labels Apr 5, 2025
hrshya and others added 5 commits April 5, 2025 16:44
Co-authored-by: Karan Anand <119553199+anandkaranubc@users.noreply.github.com>
Signed-off-by: Harsh <149176984+hrshya@users.noreply.github.com>
Co-authored-by: Karan Anand <119553199+anandkaranubc@users.noreply.github.com>
Signed-off-by: Harsh <149176984+hrshya@users.noreply.github.com>
…xample.c

Co-authored-by: Karan Anand <119553199+anandkaranubc@users.noreply.github.com>
Signed-off-by: Harsh <149176984+hrshya@users.noreply.github.com>
Co-authored-by: Karan Anand <119553199+anandkaranubc@users.noreply.github.com>
Signed-off-by: Harsh <149176984+hrshya@users.noreply.github.com>
Co-authored-by: Karan Anand <119553199+anandkaranubc@users.noreply.github.com>
Signed-off-by: Harsh <149176984+hrshya@users.noreply.github.com>
@anandkaranubc
Copy link
Contributor

/stdlib lint-autofix

@stdlib-bot stdlib-bot added the bot: In Progress Pull request is currently awaiting automation. label Apr 6, 2025
@stdlib-bot
Copy link
Contributor

/stdlib lint-autofix

@anandkaranubc, the slash command failed to complete. Please check the workflow logs for details.

View workflow run

@stdlib-bot stdlib-bot removed the bot: In Progress Pull request is currently awaiting automation. label Apr 6, 2025
Comment on lines 69 to 72

// TODO: replace with `powf` when available
return roundf( pow( PHI, n ) );
}
Copy link
Contributor

@anandkaranubc anandkaranubc Apr 6, 2025

Choose a reason for hiding this comment

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

@hrshya, this needs to be fixed. There is a missing function implementation. This is the primary reason why the CI/CD workflows are failing. It's a good practice to run the benchmarks locally first to confirm if nothing is broken.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did ran the benchmarks when I first created the PR but not this time because there were any major changes in those files.

@anandkaranubc
Copy link
Contributor

anandkaranubc commented Apr 6, 2025

As a side note, always make sure your feature branch is in sync with the develop branch. This was the reason why there were many unrelated file changes in your previous commits.

Discussion

@hrshya
Copy link
Contributor Author

hrshya commented Apr 6, 2025

As a side note, always make sure your feature branch is in sync with the develop branch. This was the reason why there were many unrelated file changes in your previous commits.

Discussion

Actually it was in sync but the thing was I didn't have this branch locally so I pulled it from origin and i thought as my develop branch is in sync so this branch would also be but i was wrong and i should have checked it before commiting

hrshya added 3 commits April 6, 2025 22:31
Signed-off-by: Harsh <149176984+hrshya@users.noreply.github.com>
Signed-off-by: Harsh <149176984+hrshya@users.noreply.github.com>
Signed-off-by: Harsh <149176984+hrshya@users.noreply.github.com>
@hrshya
Copy link
Contributor Author

hrshya commented Apr 6, 2025

@anandkaranubc All the issues have been resolved. Can you give it a quick review.

@anandkaranubc anandkaranubc self-requested a review April 16, 2025 01:48
@anandkaranubc
Copy link
Contributor

/stdlib merge

@stdlib-bot stdlib-bot added Needs Review A pull request which needs code review. bot: In Progress Pull request is currently awaiting automation. labels Apr 16, 2025
@stdlib-bot
Copy link
Contributor

/stdlib merge

@anandkaranubc, the slash command failed to complete. Please check the workflow logs for details.

View workflow run

@stdlib-bot stdlib-bot removed the bot: In Progress Pull request is currently awaiting automation. label Apr 16, 2025
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown
    status: passed
  - task: lint_package_json
    status: passed
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: na
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: passed
  - task: lint_javascript_tests
    status: na
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: na
  - task: lint_c_examples
    status: passed
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: na
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: na
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: na
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: na
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: na
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: na
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: na
  - task: lint_javascript_benchmarks
    status: passed
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: na
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: passed
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: na
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: na
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: na
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: passed
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: na
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: na
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: na
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: passed
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: na
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: na
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: passed
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: na
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: na
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown
    status: passed
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: na
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: na
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: na
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: na
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
Copy link
Contributor

@anandkaranubc anandkaranubc left a comment

Choose a reason for hiding this comment

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

Good to go! Thanks @hrshya.

@anandkaranubc anandkaranubc removed the Needs Changes Pull request which needs changes before being merged. label Apr 17, 2025
@Planeshifter Planeshifter added the Ready To Merge A pull request which is ready to be merged. label Apr 17, 2025
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Apr 17, 2025
@Planeshifter Planeshifter merged commit 3656652 into stdlib-js:develop Apr 17, 2025
30 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C Issue involves or relates to C. JavaScript Issue involves or relates to JavaScript. Math Issue or pull request specific to math functionality. Ready To Merge A pull request which is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants