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

Add JSdoc comments for api wrapped functions #36

Merged
merged 8 commits into from
Aug 31, 2021

Conversation

qur786
Copy link
Contributor

@qur786 qur786 commented Aug 31, 2021

No description provided.

@qur786 qur786 self-assigned this Aug 31, 2021
src/api.ts Outdated
Comment on lines 322 to 333
* CheckINCHI
* Description: Check if the string represents valid InChI/standard InChI
* Input: takes two argument
* input - source InChI string ,
* strict (optional) - if false, just briefly check for proper layout (prefix, version, etc.)
* Output: Returns code -1 , 0 , 1 , 2 , 3 , 4
* -1: InChI is valid and non-standard
* 0: InChI is valid and standard
* 1: InChI has invalid prefix
* 2: InChI has invalid version number (not equal to 1)
* 3: InChI has invalid layout
* 4: Checking InChI through InChI2InChI either failed or produced a result which does not match the source InChI string
Copy link
Contributor

@maneetgoyal maneetgoyal Aug 31, 2021

Choose a reason for hiding this comment

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

Study my last few commits and update accordingly.

Upon hovering over the function name, nicely formatted text should appear.

Example:

Screenshot 2021-08-31 at 4 02 35 PM

@maneetgoyal maneetgoyal added this to the Upgrade 2.0 milestone Aug 31, 2021
src/api.ts Outdated
* - 4: Checking InChI through InChI2InChI either failed or produced a result which does not match the source InChI string
* @example
* ```ts
* const status = CheckINCHI("InChI=1S/C3H5NO/c1-2-5-3-4-1/h3H,1-2H2/p+1",false);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* const status = CheckINCHI("InChI=1S/C3H5NO/c1-2-5-3-4-1/h3H,1-2H2/p+1",false);
* const status = CheckINCHI("InChI=1S/C3H5NO/c1-2-5-3-4-1/h3H,1-2H2/p+1", false);

src/api.ts Outdated
* ```ts
* const status = CheckINCHI("InChI=1S/C3H5NO/c1-2-5-3-4-1/h3H,1-2H2/p+1",false);
* console.log(status);
* //0
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* //0
* // 0

src/api.ts Outdated
* ```ts
* const length = GetStringLength("VNWKTOKETHGBQD-UHFFFAOYSA-N");
* console.log(length);
* //27
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* //27
* // 27

src/api.ts Outdated
Comment on lines 383 to 393
* ```ts
* const output = GetStructFromINCHI("InChI=1S/C2H6O/c1-2-3/h3H,2H2,1H3");
* console.log(output.status);
* //0
* console.log(output.data.atom.x);
* //0
* console.log(output.data.atom.y);
* //0
* console.log(output.data.atom.z);
* //0
* ```
Copy link
Contributor

Choose a reason for hiding this comment

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

Handle spacing properly. (Same as previous comments)

src/api.ts Outdated
Comment on lines 367 to 379
* @param {object} options (optional) An object containing chosen options as key and their values as true
* @returns output is an object containing status and data
* - status - The returned code
* - data - data contains structure created from input (Inchi) string
* -- atom - Array of atom objects which contains various data like atom co-ordinates (x,y,z) , neighbor, bondType , bondStereo, elName, numBonds, numIsoh, isotopicMass, radical, charge
* -- stereo0D - array of num_stereo0D 0D stereo elements or NULL
* -- numAtoms - number of atoms in the structure
* -- numStereo0D - number of 0D stereo elements
* -- szMessage - A string containing Error/warning ASCIIZ message
* -- szLog - log-file ASCIIZ string, contains a human-readable list of recognized options and possibly an Error/warn message
* -- warningFlags - A 2d Array conataining warnings , [x][y]:
* -- x=0 => Reconnected if present in InChI otherwise Disconnected/Normal
* -- x=1 => Disconnected layer if Reconn. layer is present
Copy link
Contributor

Choose a reason for hiding this comment

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

Please post a snapshot of how it looks upon hover.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

src/api.ts Outdated
Comment on lines 368 to 379
* @returns output is an object containing status and data
* - status - The returned code
* - data - data contains structure created from input (Inchi) string
* -- atom - Array of atom objects which contains various data like atom co-ordinates (x,y,z) , neighbor, bondType , bondStereo, elName, numBonds, numIsoh, isotopicMass, radical, charge
* -- stereo0D - array of num_stereo0D 0D stereo elements or NULL
* -- numAtoms - number of atoms in the structure
* -- numStereo0D - number of 0D stereo elements
* -- szMessage - A string containing Error/warning ASCIIZ message
* -- szLog - log-file ASCIIZ string, contains a human-readable list of recognized options and possibly an Error/warn message
* -- warningFlags - A 2d Array conataining warnings , [x][y]:
* -- x=0 => Reconnected if present in InChI otherwise Disconnected/Normal
* -- x=1 => Disconnected layer if Reconn. layer is present
Copy link
Contributor

Choose a reason for hiding this comment

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

You can completely remove this comment. JSDoc style comment are processed by the TypeDoc library. TypeDoc is already aware of the various type definition so it'll auto-hyperlink the output type.

Screenshot 2021-08-31 at 6 34 01 PM

Focus more on function description and example usage. Rest should be auto-handled by TypeDoc.

@maneetgoyal maneetgoyal merged commit 3803804 into main Aug 31, 2021
@maneetgoyal maneetgoyal deleted the qur786/#27-Add-JSdoc-Comments-to-Api-functions branch August 31, 2021 18:59
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.

2 participants