-
-
Notifications
You must be signed in to change notification settings - Fork 356
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
Verlet Integration: Output standardization #855
Verlet Integration: Output standardization #855
Conversation
This also fixes a previous bug, which caused the time and velocity values to not get printed correctly.
I was not able to prevent the preceding whitespaces, but they can just be trimmed.
As the original implementation only returned the time and not the velocity, the code needed to be adjusted a bit. Now it returns the two values as an array which gets deconstructed and printed.
I can do Haskell. Shall I do a PR on your branch? |
Sure, that would be nice. Thanks 😄 |
Oh, turns out I can push directly on your branch, sorry, I did it on accident.
|
@stormofice maybe you should make it an issue? Since there are multiple chapters that need standardization of output. I took a quick look some time ago, and a few that need this are:
And possibly some more. I'll make a PR for one of them later today. |
@lazyprop Do you mean creating an issue to get an overview on which chapters need to |
"Rework" would be an overstatement. I just mean an issue to get an overview on which chapter need standardization of output. Because I think standardization is really important for the AAA. We can discuss the specifics more on that issue. |
A general question I have (that might not be solved here) is about languages like Labview and Scratch with no text output. I guess we can write something to file and cat it? Can we actually write to file in scratch? |
Ok, stupid question... How did you push directly to the branch here @jiegillet? |
attempt at fix for asm
@leios I think that there are some notes on scratch in the Style Guide, but I think we should ignore them for now |
There’s a checkbox when you open a PR to allow others to push to it |
I think I just accidentally pushed to the wrong branch. I should have pushed to stormofice's remote with the branch I think I accidentally tried to push to |
Idk what branch you meant to push to but its a bunch of git magic that lets this work on Github's side as far as I can tell |
I guess I'm asking which remote to push to, or is it automatically set up to work with Sorry for derailing the convo |
Should “just work”
…________________________________
From: James Schloss ***@***.***>
Sent: Friday, September 3, 2021 8:45:35 PM
To: algorithm-archivists/algorithm-archive ***@***.***>
Cc: Nicholas Tindle ***@***.***>; Comment ***@***.***>
Subject: Re: [algorithm-archivists/algorithm-archive] Verlet Integration: Output standardization (#855)
I guess I'm asking which remote to push to, or is it automatically set up to work with git push with no config?
Sorry for derailing the convo
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#855 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACDPQKJRID3BLXRDXEQZMC3UAF237ANCNFSM5DK4JKWA>.
|
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.
Everything seems to be good! Thanks for the hard work here!
@@ -91,18 +91,27 @@ SUBROUTINE velocity_verlet(pos, acc, dt, time, vel) | |||
! Verlet | |||
CALL verlet(pos, acc, dt, time) | |||
|
|||
WRITE(*,*) 'Time for Verlet integration: ', time | |||
WRITE(*,*) '[#] Time for Verlet integration:' |
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.
At least with gfortran
, this seems to add extra spaces at the start of the line, is this ok?
output looks like this:
[#] Time for Verlet integration:
1.0000000000000007
[#] Time for Stormer Verlet integration:
1.0000000000000007
[#] Velocity for Stormer Verlet integration:
-9.9999999999999805
[#] Time for velocity Verlet integration:
1.0100000000000007
[#] Velocity for velocity Verlet integration:
-10.099999999999980
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.
I was told that these spaces can be ignored
No, you can write to screen, or write to a list and right click on it to export it to a text file but... Is it worth it? :)
I used GitHub's CLI suggested when you clock "Open with" at the top right of this page and used |
* pep8ify python * rename Tree_example.py * standardize python output * standardize c output * standardize c++ output * standardize rust output * standardize javascript output * standardize julia output * Standardized Coconut output * fix coconut * standardize go output * standardize common lisp output * Verlet Integration: Output standardization (#855) * Standardize julia output * Standardize kotlin output This also fixes a previous bug, which caused the time and velocity values to not get printed correctly. * Standardized c output * Standardized cpp output * Standardized lisp output * Standardized fortran output I was not able to prevent the preceding whitespaces, but they can just be trimmed. * Standardized go output * Standardized java output * Standardize javascript output * Standardize nim output * Standardize python output * Standardize ruby output As the original implementation only returned the time and not the velocity, the code needed to be adjusted a bit. Now it returns the two values as an array which gets deconstructed and printed. * Standardize rust output * Standardize swift output * Standardized haskell output * Standardized haskell output (no quote marks) * attempt at fix for asm Co-authored-by: Jérémie Gillet <[email protected]> Co-authored-by: James Schloss <[email protected]> * standardize php output * standardize swift output * removed outdated comments in Coconut implementation * standardize haskell output * Fix asm exit codes (#858) * standardize crystal output * Flood fill in Coconut (#836) * Added Barnsley fern in Coconut (+ .editorconfig for Coconut) (#814) * Added the Jarvis march in Coconut (#734) * Fix minor typo * Change folder structure of convolutions (#861) This puts every chapters' code into its own directory, which is useful for automatic validation. * standardize csharp output * standardize java output * fix php line numbers and python filename * fix coconut and python line numbers * fix minor bug in C * fix labels and minor bug in go * minor label fix in python * Huffman encoding in Coconut (#732) * Update README.md Changing readme link to reflect change in twitch url * Add C# implemenation for 1D Convolutions (#846) * Add C# implemenation for 1D Convolutions * Fix off by one error and julia line numbers * Fix off by one error for linear convolutions * Fix trailing zero * Update contents/convolutions/code/csharp/1DConvolution.cs Co-authored-by: Trashtalk217 <[email protected]> * Update contents/convolutions/code/csharp/1DConvolution.cs Co-authored-by: Trashtalk217 <[email protected]> * Update contents/convolutions/code/csharp/1DConvolution.cs Co-authored-by: Trashtalk217 <[email protected]> * Update contents/convolutions/code/csharp/1DConvolution.cs Co-authored-by: Trashtalk217 <[email protected]> * Update contents/convolutions/code/csharp/1DConvolution.cs Co-authored-by: Trashtalk217 <[email protected]> * Update contents/convolutions/code/csharp/1DConvolution.cs Co-authored-by: Trashtalk217 <[email protected]> * Update contents/convolutions/code/csharp/1DConvolution.cs Co-authored-by: Trashtalk217 <[email protected]> * Update contents/convolutions/code/csharp/1DConvolution.cs Co-authored-by: Trashtalk217 <[email protected]> * Update contents/convolutions/code/csharp/1DConvolution.cs Co-authored-by: Trashtalk217 <[email protected]> * Update contents/convolutions/code/csharp/1DConvolution.cs Co-authored-by: Trashtalk217 <[email protected]> * Update contents/convolutions/code/csharp/1DConvolution.cs Co-authored-by: Trashtalk217 <[email protected]> * Update contents/convolutions/code/csharp/1DConvolution.cs Co-authored-by: Trashtalk217 <[email protected]> * Update contents/convolutions/code/csharp/1DConvolution.cs Co-authored-by: Trashtalk217 <[email protected]> * Add trailing new line Co-authored-by: Trashtalk217 <[email protected]> * IFS Common Lisp implementation (#722) * first working version * cleaned up the chaos-game function and added some helpfull comments * changed the .md file and upped iterations * Skeleton of the final solution * Update contents/IFS/IFS.md Co-authored-by: Eric Berquist <[email protected]> Co-authored-by: James Schloss <[email protected]> Co-authored-by: Eric Berquist <[email protected]> * added MonteCarlo in PowerShell (#760) * Add Rust implementation for The Barnsley Fern (#818) * Add Rust implementation for The Barnsley Fern * Change operators constants and add Cargo.toml * Fix bug in matrix multiplication Co-authored-by: James Schloss <[email protected]> * changing barnsley.md to read the correct coconut file (#867) * added approximate counting implementation in python (#866) * added approximate counting implementation in python * Update approximate_counting.py * updating approximate_counting.py * removed redundancies * fixing linking issues in convolution chapter (#868) * Add initial devcontainer (#862) * small changes to convolutional theorem chapter and code to make things more reproduceable (#872) * added convolutional theorem implementation in python (#869) * added convolutional theorem implementation in python * fixed chapter linking * added comments to the code * changed random distribution to sawtooth * corrected previous commit * fixed comments Co-authored-by: James Schloss <[email protected]> * Use `[#]\n` instead of `[#]` for human readable output (#873) * Add approximate counting algorithm in C (#844) * Add approximate counting algorithm in C * Fix typo Co-authored-by: stormofice <[email protected]> Co-authored-by: stormofice <[email protected]> Co-authored-by: James Schloss <[email protected]> * added 1d convolution implementation in python (#874) * added 1d convolution implementation in python * fixed some mistakes in the code so it outputs correct results * making the code look better * spacing code properly for readability * fixing 1d convolution markdown file (#879) * Add racket setup to devcontainer (#875) * Normalize inputs for scheme euclid algorithm (#878) Change inputs to make it consistent with other examples. * Add initial setup for Swift in devcontainer (#880) * Add scheme setup to devcontainer (#876) * Clean up Monte Carlo integration in Racket (#781) * Clean up Monte Carlo integration in Racket * Add blank lines in Monte Carlo integration in Clojure * Change Racket lang include from lisp to racket * Add C++ code for Flood Fill algorithm (#860) * fixing chapter to use split-op code (#888) * use [#]\n for readability * Implemented stacks and queues in Java (#897) * Java tree traversal: updated dfsRecursiveInOrderBinary (#899) * Tree traversal in smalltalk (#453) * fixed print statements (#901) * Fixes in PATH that make dlang, emojicode and factor usable (#890) * fixing huffman encoding for Julia and adding Test (#828) * JavaScript tree traversal: updated dfsInorder (#902) * julia: change printf to print * pep8ify python * rename Tree_example.py * standardize python output * standardize c output * standardize c++ output * standardize rust output * standardize javascript output Resolved conflict with master (by Amaras) * standardize julia output Resolved conflict with master (by Amaras) * Standardized Coconut output * fix coconut * standardize go output * standardize common lisp output * standardize php output * standardize swift output * removed outdated comments in Coconut implementation * standardize haskell output * standardize crystal output * standardize csharp output * standardize java output Resolved the conflict with fixing dfs * fix php line numbers and python filename * fix coconut and python line numbers * fix minor bug in C * fix labels and minor bug in go * minor label fix in python * use [#]\n for readability * julia: change printf to print * update Tree.java. remove MainClass.java Co-authored-by: Sammy Plat <[email protected]> Co-authored-by: stormofice <[email protected]> Co-authored-by: Jérémie Gillet <[email protected]> Co-authored-by: James Schloss <[email protected]> Co-authored-by: Eric Berquist <[email protected]> Co-authored-by: Trashtalk217 <[email protected]> Co-authored-by: PaddyKe <[email protected]> Co-authored-by: Dimitri Belopopsky <[email protected]> Co-authored-by: Ayman Lafaz <[email protected]> Co-authored-by: Nicholas Tindle <[email protected]> Co-authored-by: Mahdi <[email protected]> Co-authored-by: Henrik Christensen <[email protected]> Co-authored-by: Neverik <[email protected]>
This PR tries to standardize the different kinds of outputs to use the ones outlined in #824.
The following implementations are not [yet] standardized:
asm-x64(done thanks to @leios)haskell(done thanks to @jiegillet)As I am not comfortable enough changing the asm/haskell code, someone else should take a look at these implementations.
I can confirm that every (standardized) implementation now produces the same [numerical] results as the julia one and that no
md
files need to be modified here.Please review this carefully, as this kind of output standardization needs to be done for every chapter and this PR sets the ground rules for future optimizations.