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 : Python Fortran Rosetta Stone (Transfer content from fortran90.org #112) #185

Merged
merged 30 commits into from
Jun 3, 2023

Conversation

henilp105
Copy link
Member

@henilp105 henilp105 commented Oct 8, 2022

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

@henilp105
Copy link
Member Author

#build_preview

@github-actions
Copy link

github-actions bot commented Oct 8, 2022

This PR has been built with Sphinx and can be previewed at: https://fortran-lang.github.io/webpage/pr/185

@vmagnin
Copy link
Member

vmagnin commented Oct 8, 2022

@henilp105
It's great you have shown we can have syntax coloring for both languages!
(Don't forget the upper case F of Fortran)

@henilp105
Copy link
Member Author

#build_preview

@github-actions
Copy link

github-actions bot commented Oct 8, 2022

This PR has been built with Sphinx and can be previewed at: https://fortran-lang.github.io/webpage/pr/185

@certik
Copy link
Member

certik commented Oct 8, 2022

Here it is: https://fortran-lang.org/pr/185/en/learn/rosetta_stone/

Beautiful!

@certik
Copy link
Member

certik commented Oct 8, 2022

@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.

@henilp105
Copy link
Member Author

@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.

@certik
Copy link
Member

certik commented Oct 8, 2022

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.

@henilp105
Copy link
Member Author

@certik sure sir, thanks.

source/learn/rosetta_stone.md Outdated Show resolved Hide resolved
source/learn/rosetta_stone.md Outdated Show resolved Hide resolved
@henilp105
Copy link
Member Author

#build_preview

@github-actions
Copy link

github-actions bot commented Oct 8, 2022

This PR has been built with Sphinx and can be previewed at: https://fortran-lang.github.io/webpage/pr/185

@henilp105
Copy link
Member Author

@vmagnin @zmoon @certik I have completed the porting of entire Rosetta stone to myst-markdown . Would like to request review the ported doc.

Thanks and Regards,
Henil

@henilp105 henilp105 requested a review from certik October 8, 2022 17:05
@vmagnin
Copy link
Member

vmagnin commented Oct 8, 2022

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.

@henilp105
Copy link
Member Author

Hi @vmagnin , I had been waiting for the community members to review the PR , I would be grateful if you could review it, Thanks.

@henilp105 henilp105 requested a review from vmagnin May 6, 2023 12:57
@vmagnin
Copy link
Member

vmagnin commented May 6, 2023

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,
I will review it in the next days.
Curiously, the link https://fortran-lang.github.io/webpage/pr/185 now gives me an error 404. Maybe it is too old (October).
Let's see if I can regenerate it myself:

#build_preview

@vmagnin
Copy link
Member

vmagnin commented May 6, 2023

#build_preview

@github-actions
Copy link

github-actions bot commented May 6, 2023

This PR has been built with Sphinx and can be previewed at: https://fortran-lang.github.io/webpage/pr/185

1 similar comment
@github-actions
Copy link

github-actions bot commented May 6, 2023

This PR has been built with Sphinx and can be previewed at: https://fortran-lang.github.io/webpage/pr/185

@vmagnin
Copy link
Member

vmagnin commented May 6, 2023

I can now see the new preview: https://fortran-lang.org/pr/185/en/learn/rosetta_stone/

@vmagnin
Copy link
Member

vmagnin commented May 8, 2023

@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?

@henilp105
Copy link
Member Author

#build_preview

@github-actions
Copy link

github-actions bot commented May 8, 2023

This PR has been built with Sphinx and can be previewed at: https://fortran-lang.github.io/webpage/pr/185

@henilp105
Copy link
Member Author

Hi @vmagnin , Sure, I have added indentation for python ,can you please review it again. Thanks.

@vmagnin
Copy link
Member

vmagnin commented May 8, 2023

Thanks @henilp105
it is weird, there are still problems in indentation although you edited it. For example the first loop:

for i in range(len(a)):                 
  if a[i] > 5:

@vmagnin
Copy link
Member

vmagnin commented May 8, 2023

For example, here you have correctly indented with 4 spaces in the .md file:

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.

@vmagnin
Copy link
Member

vmagnin commented May 8, 2023

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 example:

for i in range(1, 9):                  
 if i>2:                                       
     break                       
 print(i)

It is wrong inside the for but good inside the if.

@henilp105
Copy link
Member Author

@vmagnin It seems to be some problem with sphinx I am not sure about it will try to patch this soon. Thanks.

@certik
Copy link
Member

certik commented May 8, 2023

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.)

@henilp105
Copy link
Member Author

#build_preview

@henilp105
Copy link
Member Author

henilp105 commented Jun 3, 2023

@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

@github-actions
Copy link

github-actions bot commented Jun 3, 2023

This PR has been built with Sphinx and can be previewed at: https://fortran-lang.github.io/webpage/pr/185

@vmagnin
Copy link
Member

vmagnin commented Jun 3, 2023

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 for.

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).

@henilp105
Copy link
Member Author

Thanks, @vmagnin for prompt review.

@henilp105
Copy link
Member Author

Thanks everyone for reviews , I am merging this.
Thanks,
Henil

@henilp105 henilp105 merged commit 3f1b2bb into fortran-lang:main Jun 3, 2023
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.

Transfer fortran90.org content
5 participants