-
-
Notifications
You must be signed in to change notification settings - Fork 10
added volume arrays #16
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -100,4 +100,34 @@ testFusionRatio().then((ratio) => { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| console.log('Fusion Ratio:\n') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| console.log(Number(ratio)) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| console.log('\n') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| async function testVolumes() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const gluon = new Gluon() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const gluonBox = await gluon.getGluonBox() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const pToNArray = await gluon.getVolumeProtonsToNeutronsArray(gluonBox) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const nToPArray = await gluon.getVolumeNeutronsToProtonsArray(gluonBox) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const accPToN = await gluon.accumulateVolumeProtonsToNeutrons(gluonBox) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const accNToP = await gluon.accumulateVolumeNeutronsToProtons(gluonBox) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const partialAccPToN = await gluon.accumulateVolumeProtonsToNeutrons(gluonBox, 5) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pToNArray, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| nToPArray, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| accPToN, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| accNToP, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| partialAccPToN | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| testVolumes().then((vols) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| console.log('Volumes:\n') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| console.log('Protons to Neutrons Array:', vols.pToNArray) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| console.log('Neutrons to Protons Array:', vols.nToPArray) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| console.log('Accumulated Protons to Neutrons:', vols.accPToN) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| console.log('Accumulated Neutrons to Protons:', vols.accNToP) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| console.log('Partial Accumulated (5 days) Protons to Neutrons:', vols.partialAccPToN) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| console.log('\n') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+125
to
133
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a In Node.js ≥ 15, an unhandled promise rejection terminates the process ( 🛡️ Proposed fix testVolumes().then((vols) => {
console.log('Volumes:\n')
console.log('Protons to Neutrons Array:', vols.pToNArray)
console.log('Neutrons to Protons Array:', vols.nToPArray)
console.log('Accumulated Protons to Neutrons:', vols.accPToN)
console.log('Accumulated Neutrons to Protons:', vols.accNToP)
console.log('Partial Accumulated (5 days) Protons to Neutrons:', vols.partialAccPToN)
console.log('\n')
+}).catch((err) => {
+ console.error('testVolumes failed:', err)
})📝 Committable suggestion
Suggested change
🤖 Prompt for AI AgentsMissing Without a rejection handler, any network error or decode failure will surface as an unhandled promise rejection — a warning in older Node.js and a process crash ( 🛡️ Proposed fix-testVolumes().then((vols) => {
+testVolumes().then((vols) => {
console.log('Volumes:\n')
console.log('Protons to Neutrons Array:', vols.pToNArray)
console.log('Neutrons to Protons Array:', vols.nToPArray)
console.log('Accumulated Protons to Neutrons:', vols.accPToN)
console.log('Accumulated Neutrons to Protons:', vols.accNToP)
console.log('Partial Accumulated (5 days) Protons to Neutrons:', vols.partialAccPToN)
console.log('\n')
+}).catch((err) => {
+ console.error('testVolumes failed:', err)
})📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, if this function is just calling gluonBox and getVolumeProtonsToNeutronsArray() is available there, then maybe the bug #5 is not really a bug in the SDK, but rather a bug in the comment in the frontend. Perhaps the frontend should just call the volume array function from gluonBox.