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

Script generator for Perturbo #64

Merged
merged 7 commits into from
Nov 25, 2024
Merged

Script generator for Perturbo #64

merged 7 commits into from
Nov 25, 2024

Conversation

hurricane642
Copy link
Collaborator

Hello everyone!
In this PR we are adding the ability to generate Perturbo scripts inside Perturbopy. For this purpose, we have created a separate module generate_input, which contains the necessary yaml files inside, as well as the code with all the functionality. So far it seems that there is no need to split it into several separate blocks.
Script generation is done with a command that can be directly called from the command line, for example:

input_generation -c ephmat --prefix si --band_min 10

The command becomes available immediately after installing Perturbopy.
All necessary documentation is provided for the code.

@hurricane642 hurricane642 added the enhancement New feature or request label Oct 29, 2024
@hurricane642 hurricane642 self-assigned this Oct 29, 2024
None

"""
module_dir = os.path.dirname(__file__) # Папка, где находится модуль
Copy link

Choose a reason for hiding this comment

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

What does this mean?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OMG ahahahah, I definitely need to fix this, sorry, thank you a lot!

@ltan01
Copy link

ltan01 commented Nov 19, 2024

The input generation works great! I think it might be nice to change the variable INPUT_NAME to FILE_NAME? Also, in the help message, maybe we could include the default value and variable type? Maybe we could include a link to the input parameters page on the Perturbo website?

@imaliyov
Copy link
Member

One thing is that we should change the documentation accordingly, so modify both perturbo and perturbopy websites. Ideally, we should put a short announcement on perturbo and put detailed documentation on perturbopy

https://perturbo-code.github.io/mydoc_generate_input.html

@hurricane642
Copy link
Collaborator Author

One thing is that we should change the documentation accordingly, so modify both perturbo and perturbopy websites. Ideally, we should put a short announcement on perturbo and put detailed documentation on perturbopy

https://perturbo-code.github.io/mydoc_generate_input.html

Sure, sounds great! I'll add docs in this PR and open new one in the perturbo-code repo

@hurricane642
Copy link
Collaborator Author

The input generation works great! I think it might be nice to change the variable INPUT_NAME to FILE_NAME? Also, in the help message, maybe we could include the default value and variable type? Maybe we could include a link to the input parameters page on the Perturbo website?

Great, sure!

@hurricane642
Copy link
Collaborator Author

Hey guys, I've added documentation and the ideas which @ltan01 mentioned. I'll work soon on the news for the perturbo-code webpage.
One thing that left - it probably would be a good idea to have a page with the typical scripts, as it currently exists on the https://perturbo-code.github.io/mydoc_generate_input.html, but I'm not sure

@imaliyov
Copy link
Member

One thing to remember is that the interactive workflow input files are generated with this script. Therefore, if it is removed from Perturbo, then the interactive workflow one should be moved to Perturbopy too.
https://perturbo-code.github.io/mydoc_interactive_workflow.html
@hurricane642 could you try to run the interactive workflow one and to make sure it works correctly?

@hurricane642
Copy link
Collaborator Author

One thing to remember is that the interactive workflow input files are generated with this script. Therefore, if it is removed from Perturbo, then the interactive workflow one should be moved to Perturbopy too. https://perturbo-code.github.io/mydoc_interactive_workflow.html @hurricane642 could you try to run the interactive workflow one and to make sure it works correctly?

It is definitely not :(. The problem is that it's generated for the different format of documentation (for perturbopy docs and perturbo docs we use different pipelines). So, if we want to move the interactive workflow to the Perturbopy, we'll need to rewrite this script.
On the other hand, I'm not sure that we actually need to do it. It is true that the workflow itself is created with perturbopy, but in general, perturbopy is not necessary to use it. And I think it is logical to keep it on the Perturbo page, as it will be used much more often there.

@imaliyov
Copy link
Member

One thing to remember is that the interactive workflow input files are generated with this script. Therefore, if it is removed from Perturbo, then the interactive workflow one should be moved to Perturbopy too. https://perturbo-code.github.io/mydoc_interactive_workflow.html @hurricane642 could you try to run the interactive workflow one and to make sure it works correctly?

It is definitely not :(. The problem is that it's generated for the different format of documentation (for perturbopy docs and perturbo docs we use different pipelines). So, if we want to move the interactive workflow to the Perturbopy, we'll need to rewrite this script. On the other hand, I'm not sure that we actually need to do it. It is true that the workflow itself is created with perturbopy, but in general, perturbopy is not necessary to use it. And I think it is logical to keep it on the Perturbo page, as it will be used much more often there.

Interactive workflow script needs the YAML file for input parameters, and the script that generates the input files. If we move one to PerturboPy we have to move another one too...

@hurricane642
Copy link
Collaborator Author

One thing to remember is that the interactive workflow input files are generated with this script. Therefore, if it is removed from Perturbo, then the interactive workflow one should be moved to Perturbopy too. https://perturbo-code.github.io/mydoc_interactive_workflow.html @hurricane642 could you try to run the interactive workflow one and to make sure it works correctly?

It is definitely not :(. The problem is that it's generated for the different format of documentation (for perturbopy docs and perturbo docs we use different pipelines). So, if we want to move the interactive workflow to the Perturbopy, we'll need to rewrite this script. On the other hand, I'm not sure that we actually need to do it. It is true that the workflow itself is created with perturbopy, but in general, perturbopy is not necessary to use it. And I think it is logical to keep it on the Perturbo page, as it will be used much more often there.

Interactive workflow script needs the YAML file for input parameters, and the script that generates the input files. If we move one to PerturboPy we have to move another one too...

This is true, but we can generate the html itself somewhere inside perturbopy, and then transfer it to perturbo-docs. I realize it doesn't look very simple, but it's not that much different now - we generate it in perturbo and then move it to perturbo-docs.

@imaliyov
Copy link
Member

@hurricane642 yes, this is exactly what I meant, maybe was not clear about it :)
We have to generate HTML in perturbopy

@imaliyov
Copy link
Member

In any way, perturbo, perturbopy, and perturbo-code-website are three different repositories (folders), so it is not critical from which one we copy the HTML files to perturbo-code-website

@hurricane642
Copy link
Collaborator Author

Oh, ok! I thought you wanted to move the interactive workflow page itself inside perturbopy! Now I see your point, ok, I'll check it out!

@hurricane642
Copy link
Collaborator Author

Hey guys, I've moved all perturbo-docs scripts to the perturbopy repo. I'll need to separately make an update in the perturbo-docs and perturbo repos, but in the perturbopy, I think, we are done

Copy link

Choose a reason for hiding this comment

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

I noticed that this file (and input_parameters_qe2pert.yml) seems to be an older version of the file that's being removed in the Perturbo-dev repo. I'm not sure if it's updated with everyone's new variables, but can I copy over the variables from the other file?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think, we'll need to make the update after the release of Perturbo. Currently, I took the parameter files from the perturbo repo. So our dev-repo we'll be updated also after release already

Copy link
Member

@imaliyov imaliyov left a comment

Choose a reason for hiding this comment

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

I approve the PR. As soon as we can run 2 Python script (if I remember correctly), to get:

  1. input parameters HTML docs
  2. f90 autogenerated files
  3. interactive workflow

And we can updated those files in:

  1. Perturbo website,
  2. perturbo-dev source code

We should be all good as those are the sole purpose of the scripts :)

@hurricane642 hurricane642 merged commit e365d8c into main Nov 25, 2024
4 checks passed
@hurricane642 hurricane642 deleted the generation_input branch November 25, 2024 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants