Conversation

ShabiShett07

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: passed
  • task: lint_javascript_cli status: na
  • task: lint_javascript_examples status: na
  • task: lint_javascript_tests status: passed
  • task: lint_javascript_benchmarks status: passed
  • task: lint_python status: na
  • task: lint_r status: na
  • task: lint_c_src status: missing_dependencies
  • 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 ---

none

Description

What is the purpose of this pull request?

This pull request:

  • Adds native addon and refactor the implementation for complex/float64/conj

Related Issues

Does this pull request have any related issues?

This pull request:

  • none

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

---
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: passed
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: passed
  - task: lint_javascript_benchmarks
    status: passed
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: missing_dependencies
  - 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
---
@stdlib-botstdlib-bot added the Needs ReviewA pull request which needs code review.label Jun 10, 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: 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
---
@stdlib-bot

Coverage Report

PackageStatementsBranchesFunctionsLines
complex/float64/conj$\color{green}143/143$
$\color{green}+100.00\%$
$\color{green}5/5$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}143/143$
$\color{green}+100.00\%$

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

@ShabiShett07

/stdlib update-copyright-years

@stdlib-botstdlib-bot added the bot: In ProgressPull request is currently awaiting automation.label Jun 10, 2025
@stdlib-botstdlib-bot removed the bot: In ProgressPull request is currently awaiting automation.label Jun 10, 2025
@ShabiShett07

/stdlib merge

@ShabiShett07ShabiShett07 requested a review from kgryte June 10, 2025 06:06
@stdlib-botstdlib-bot added the bot: In ProgressPull request is currently awaiting automation.label Jun 10, 2025
@stdlib-botstdlib-bot removed the bot: In ProgressPull request is currently awaiting automation.label Jun 10, 2025
@ShabiShett07ShabiShett07 added GSoCGoogle Summer of Code.gsoc: 2025Google Summer of Code (2025).labels Jun 15, 2025
@@ -33,7 +39,7 @@
* // returns <Complex128>[ 5.0, -3.0 ]
*/
function conj( z ) {
return new z.constructor( z.re, -z.im );
return new Complex128( real( z ), -imag( z ) );
Copy link
Member

Choose a reason for hiding this comment

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

Yes, I think this makes sense now. There is some history here in why z.constructor was used. Namely, when this package was complex/conj, we wanted to preserve input instance type. However, now that this package is in complex/float64, I think we are fine always returning a Complex128 instance.

kgryte
kgryte previously approved these changes Jun 20, 2025
@kgrytekgryte added Needs ChangesPull request which needs changes before being merged.and removedA pull request which needs code review.labels Jun 20, 2025
@kgryte

@ShabiShett07 In order for the native add-on to compile, you need to add the *.gyp files. This was why the addon.c bug was not caught.

@kgryte

...once those files are added and the tests pass, this PR can be merged.

---
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
---
@ShabiShett07

/stdlib update-copyright-years

@stdlib-botstdlib-bot added the bot: In ProgressPull request is currently awaiting automation.label Jun 21, 2025
@stdlib-botstdlib-bot removed the bot: In ProgressPull request is currently awaiting automation.label Jun 21, 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: na
  - 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: 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
---
@ShabiShett07ShabiShett07 requested a review from kgryte June 21, 2025 17:19
@stdlib-botstdlib-bot added the Needs ReviewA pull request which needs code review.label Jun 21, 2025
@ShabiShett07

Added gyp files to this, just needed confirmation for the structure and got it from @kgryte

@kgrytekgryte changed the title feat: refactor and native addons for complex/float64/conj feat: refactor and add native addon for complex/float64/conj Jun 21, 2025
@kgrytekgryte added CIssue involves or relates to C.and removed Needs ReviewA pull request which needs code review.Needs ChangesPull request which needs changes before being merged.labels Jun 21, 2025
@kgrytekgryte merged commit 40373c5 into stdlib-js:develop Jun 21, 2025
33 checks passed
Sign up for free to join this conversation on . Already have an account? Sign in to comment
CIssue involves or relates to C.GSoCGoogle Summer of Code.gsoc: 2025Google Summer of Code (2025).
None yet

Successfully merging this pull request may close these issues.