-
-
Notifications
You must be signed in to change notification settings - Fork 595
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
[RFC]: Improve doctests for complex number typed arrays in documentation examples #4833
Comments
👋 Important: PLEASE READ 👋This issue has been labeled as a good first issue and is available for anyone to work on. If this is your first time contributing to an open source project, some aspects of the development process may seem unusual, arcane, or some combination of both.
Before working on this issue and opening a pull request, please read the project's contributing guidelines. These guidelines and the associated development guide provide important information, including links to stdlib's Code of Conduct, license policy, and steps for setting up your local development environment. To reiterate, we strongly encourage you to refer to our contributing guides before beginning work on this issue. Failure to follow our guidelines significantly decreases the likelihood that you'll successfully contribute to stdlib and may result in automatic closure of a pull request without review. Setting up your local development environment is a critical first step, as doing so ensures that automated development processes for linting, license verification, and unit testing can run prior to authoring commits and pushing changes. If you would prefer to avoid manual setup, we provide pre-configured development containers for use locally or in GitHub Codespaces. We place a high value on consistency throughout the stdlib codebase. We encourage you to closely examine other packages in stdlib and attempt to emulate the practices and conventions found therein.
In short, the more effort you put in to ensure that your contribution looks and feels like stdlib—including variables names, bracket spacing, line breaks, etc—the more likely that your contribution will be reviewed and ultimately accepted. We encourage you to closely study the codebase before beginning work on this issue. ✨ Thank you again for your interest in stdlib, and we look forward to reviewing your future contributions. ✨ |
hello can i solve this by doing the things like 1 Remove imports for realf and imagf: var realf = require( '@stdlib/complex/float32/real' );
Edit @kgryte please review and suggest me that can i solve it like this |
@gautam-krishna-sharma What you describe is essentially what I wrote in the OP. The only thing I will add is that whether you use |
Description
This RFC proposes improving doctests for complex number typed arrays in documentation examples. This is best conveyed through an example.
Consider the following JSDoc example in
blas/base/ccopy
:Compare to a similar example from
blas/base/dcopy
.Notice how, for
dcopy
, we use the doctest return annotation// y => <Float64Array>[ ... ]
; however, forccopy
, we need to retrieve an individual element and then decompose into real and imaginary components.As may be observed, the
dcopy
doctest is much more compact and conveys much more clearly the expected behavior. For the complex number typed array case, in order to show the expected behavior for the entire typed array, we'd need to extract and decompose each individual element. This is both more tedious when authoring documentation and less effective as a means of conveying expected behavior.Accordingly, this RFC seeks to leverage recent improvements in our doctest framework which now supports typed array instance notation for complex number typed arrays (e.g.,
<Complex64Array>[ 1.0, 2.0, 3.0, 4.0 ]
), where previously it did not; hence, the more verbose decomposition logic.Revisiting
ccopy
above to use typed array instance notation would yieldNotice the removal of
realf
andimagf
imports and element decomposition and the insertion of// y => <Complex64Array>[ ... ]
.Given the relatively widespread practice of decomposing a complex number typed array into individual components, this RFC aims to be an open call for any contributor wanting to contributor to the project to do the following:
<Complex64Array>[ ... ]
,<Complex128Array>[ ... ]
, etc). Examples may be found in the packagePlease do NOT make extraneous changes to examples. We are not interested in changing examples wholesale. We are only interested in replacing decomposition logic with typed array instance notation.
Related Issues
None.
Questions
No.
Other
Checklist
RFC:
.The text was updated successfully, but these errors were encountered: