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: add C implementation for number/float32/base/signbit #3399

Merged
merged 21 commits into from
Jan 14, 2025

Conversation

Neerajpathak07
Copy link
Contributor

Resolves #3397

Description

What is the purpose of this pull request?

This pull request:

  • add C implementations for number/float32/base/signbit

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

@Planeshifter
Copy link
Member

Planeshifter commented Dec 11, 2024

@Neerajpathak07

Check out the workflow failures.

E.g., the lint step of package.json in https://github.com/stdlib-js/stdlib/actions/runs/12264198244/job/34217519484?pr=3399

ERROR: package.json in lib/node_modules/@stdlib/number/float32/base/signbit needs updates to directories and/or gypfile fields
diff --git a/lib/node_modules/@stdlib/number/float32/base/signbit/package.json b/lib/node_modules/@stdlib/number/float32/base/signbit/package.json
index 0b5a[8](https://github.com/stdlib-js/stdlib/actions/runs/12264198244/job/34217519484?pr=3399#step:10:9)f15d..1f40f6e35 100644
--- a/lib/node_modules/@stdlib/number/float32/base/signbit/package.json
+++ b/lib/node_modules/@stdlib/number/float32/base/signbit/package.json
@@ -14,11 +14,14 @@
     }
   ],
   "main": "./lib",
+  "gypfile": true,
   "directories": {
     "benchmark": "./benchmark",
     "doc": "./docs",
     "example": "./examples",
+    "include": "./include",
     "lib": "./lib",
+    "src": "./src",
     "test": "./test"
   },
   "types": "./docs/types",

tells us that several needed fields are not set and should be added.

@stdlib-bot stdlib-bot added bot: In Progress Pull request is currently awaiting automation. and removed bot: In Progress Pull request is currently awaiting automation. labels Dec 11, 2024
@stdlib-js stdlib-js deleted a comment from stdlib-bot Dec 11, 2024
@Neerajpathak07
Copy link
Contributor Author

@Planeshifter I have added the essential files in the dependency tree of package.json.
But I am having doubts on how to resolve this particular error:-

gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make[1]: Entering directory '/home/runner/work/stdlib/stdlib/lib/node_modules/@stdlib/number/float32/base/signbit/build'
  CC(target) Release/obj.target/addon/src/addon.o
../src/addon.c: In function ‘addon’:
../src/addon.c:63:18: warning: implicit declaration of function ‘napi_get_value_float’; did you mean ‘napi_get_value_bool’? [-Wimplicit-function-declaration]
   63 |         status = napi_get_value_float( env, argv[ 0 ], &value );
      |                  ^~~~~~~~~~~~~~~~~~~~
      |                  napi_get_value_bool
  CC(target) Release/obj.target/addon/src/main.o
  CC(target) Release/obj.target/addon/../to-word/src/to_word.o
  SOLINK_MODULE(target) Release/obj.target/addon.node
  COPY Release/addon.node
  ACTION Copying addon... src/addon.node
  TOUCH Release/obj.target/copy_addon.stamp
make[1]: Leaving directory '/home/runner/work/stdlib/stdlib/lib/node_modules/@stdlib/number/float32/base/signbit/build'
gyp info ok 

@stdlib-bot
Copy link
Contributor

stdlib-bot commented Dec 12, 2024

Coverage Report

Package Statements Branches Functions Lines
number/float32/base/signbit $\color{green}178/178$
$\color{green}+100.00\%$
$\color{green}7/7$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}178/178$
$\color{green}+100.00\%$

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

@Neerajpathak07
Copy link
Contributor Author

@Planeshifter All CI checks are passing pls review it. I am going to need this for implementing atan2f

@Planeshifter
Copy link
Member

@Neerajpathak07 Wil try taking a look and review tonight.

@Neerajpathak07 Neerajpathak07 marked this pull request as ready for review December 12, 2024 16:26
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Dec 12, 2024
Copy link
Member

@Planeshifter Planeshifter 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 your work on this!

Looks pretty good to me. manifest.json will need some updates. @kgryte, you mind taking final look please and then merge the PR after the comments have been addressed?

@Neerajpathak07
Copy link
Contributor Author

Neerajpathak07 commented Dec 13, 2024

@Planeshifter Thank you for the review.

@Neerajpathak07
Copy link
Contributor Author

@kgryte would really appreciate a review on this since a PR #3338 is on stand-by and awaiting this to be merged!

@kgryte kgryte added Feature Issue or pull request for adding a new feature. Math Issue or pull request specific to math functionality. C Issue involves or relates to C. and removed Needs Review A pull request which needs code review. labels Jan 14, 2025
@kgryte
Copy link
Member

kgryte commented Jan 14, 2025

/stdlib update-copyright-years

@stdlib-bot stdlib-bot added the bot: In Progress Pull request is currently awaiting automation. label Jan 14, 2025
@stdlib-bot stdlib-bot removed the bot: In Progress Pull request is currently awaiting automation. label Jan 14, 2025
@kgryte
Copy link
Member

kgryte commented Jan 14, 2025

/stdlib merge

@stdlib-bot stdlib-bot added the bot: In Progress Pull request is currently awaiting automation. label Jan 14, 2025
Copy link
Member

@kgryte kgryte left a comment

Choose a reason for hiding this comment

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

After a bit of clean-up, this PR now LGTM.

@stdlib-bot stdlib-bot removed the bot: In Progress Pull request is currently awaiting automation. label Jan 14, 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: 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_push_report
description: Results of running various checks prior to pushing changes.
report:
  - task: run_javascript_examples
    status: na
  - task: run_c_examples
    status: na
  - task: run_cpp_examples
    status: na
  - task: run_javascript_readme_examples
    status: na
  - task: run_c_benchmarks
    status: na
  - task: run_cpp_benchmarks
    status: na
  - task: run_fortran_benchmarks
    status: na
  - task: run_javascript_benchmarks
    status: na
  - task: run_julia_benchmarks
    status: na
  - task: run_python_benchmarks
    status: na
  - task: run_r_benchmarks
    status: na
  - task: run_javascript_tests
    status: na
---
@kgryte kgryte merged commit 9aaeaaa into stdlib-js:develop Jan 14, 2025
12 checks passed
@Neerajpathak07 Neerajpathak07 deleted the float32/signbit branch January 14, 2025 16:16
jalajk3004 pushed a commit to jalajk3004/stdlib that referenced this pull request Jan 14, 2025
PR-URL: stdlib-js#3399
Co-authored-by: Athan Reines <[email protected]>
Reviewed-by: Athan Reines <[email protected]> 
Reviewed-by: Philipp Burckhardt <[email protected]>
Co-authored-by: stdlib-bot <[email protected]>
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. Feature Issue or pull request for adding a new feature. Math Issue or pull request specific to math functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFC]: Add C implementation for number/float32/base/signbit
4 participants