-
Notifications
You must be signed in to change notification settings - Fork 44
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 : Python Fortran Rosetta Stone (Transfer content from fortran90.org #112) #185
Conversation
#build_preview |
This PR has been built with Sphinx and can be previewed at: https://fortran-lang.github.io/webpage/pr/185 |
@henilp105 |
#build_preview |
This PR has been built with Sphinx and can be previewed at: https://fortran-lang.github.io/webpage/pr/185 |
Here it is: https://fortran-lang.org/pr/185/en/learn/rosetta_stone/ Beautiful! |
@henilp105 thanks for porting it! The page looks great. I left a questions above regarding porting of html -> markdown, but otherwise I think this is done. Let me know how I can help. |
@certik sir, It would be great if you could please verify the output of fortran and numpy codes as at some places maybe there were some differences in output. |
Ah I see, yes. Btw, later we'll automatically generate the output, but for now we'll just do it by hand. Ping me once you port the rest of the md file to markdown from html, and I will carefully review the output to make sure it is good. |
@certik sure sir, thanks. |
#build_preview |
This PR has been built with Sphinx and can be previewed at: https://fortran-lang.github.io/webpage/pr/185 |
Awesome quick work @henilp105 ! I will read it fully on Monday. At first sight, my first question concerns esthetic: in each example, should we add blank lines in the tables in order to have exactly the same height for the Python and Fortran tables? I have no definitive opinion, although my feeling is that it is prettier when the height is the same, like in the first examples. |
Hi @vmagnin , I had been waiting for the community members to review the PR , I would be grateful if you could review it, Thanks. |
Hi @henilp105, #build_preview |
#build_preview |
This PR has been built with Sphinx and can be previewed at: https://fortran-lang.github.io/webpage/pr/185 |
1 similar comment
This PR has been built with Sphinx and can be previewed at: https://fortran-lang.github.io/webpage/pr/185 |
I can now see the new preview: https://fortran-lang.org/pr/185/en/learn/rosetta_stone/ |
@henilp105, I have read the whole page. Curiously the problem of indentation pointed by @certik on the 20th October is always present, although you did a commit to fix it (on the Fortran side). On the Fortran side, it is not really a problem, but on the Python side it is a real problem as if we copy/paste the code it won't run, the Python indentation with 4 spaces being compulsory. Is it possible to fix it? |
#build_preview |
This PR has been built with Sphinx and can be previewed at: https://fortran-lang.github.io/webpage/pr/185 |
Hi @vmagnin , Sure, I have added indentation for python ,can you please review it again. Thanks. |
Thanks @henilp105 for i in range(len(a)):
if a[i] > 5: |
For example, here you have correctly indented with 4 spaces in the r = 1
for i in range(3,8):
r *= a[i] but in the preview it appears with only one space: r = 1
for i in range(3,8):
r *= a[i] and there is only one space if I copy/paste the code in my text editor. |
Something interesting: looking at all python snippets, I have noticed that it is always the first indentation that is wrong, the second one (inside the first structure) is good. for i in range(1, 9):
if i>2:
break
print(i) It is wrong inside the |
@vmagnin It seems to be some problem with sphinx I am not sure about it will try to patch this soon. Thanks. |
Thanks! We should finish and merge this PR. (Also a real blocker for me is https://fortran-lang.discourse.group/t/fortran-lang-no-longer-in-bing/4942, which makes fortran-lang effectively undiscoverable in my search engine; but that's unrelated.) |
#build_preview |
@vmagnin , It seems that I have found a fix for the indentation issue in the python code , can you please review it again ? Here is the link : https://fortran-lang.org/pr/185/en/learn/rosetta_stone/ Thanks |
This PR has been built with Sphinx and can be previewed at: https://fortran-lang.github.io/webpage/pr/185 |
Great @henilp105 ! That was so simple, it was hard to understand and find... As commented before, there is just one Python snippet with a space to remove in the indentation (there is 5 spaces instead of 4) of a And then it can be merged. Thanks for the work on this page. As soon as it is online, you can post it into the Discourse (in the Tutorials category). |
Thanks, @vmagnin for prompt review. |
Thanks everyone for reviews , I am merging this. |
This PR adds Fortran90 content Python Fortran Rosetta Stone, We are grateful to the original owners (@certik) of the content for opensourcing it . This content has been taken from https://github.com/certik/fortran90.org . This content has been formatted with pandoc and converted to myst markdown for consistency.
NOTE: All the python 2 codes have been refactored to python 3.
This PR Resolves:
Closes #112
Thanks and Regards,
Henil
CC @awvwgk @vmagnin