-
Notifications
You must be signed in to change notification settings - Fork 20
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
Adding basic input file previews when launching a calculation #26
Comments
Hello, I would like to work on this issue, can I ? |
Great, go ahead! |
There should be a separate button just to preview the input file. The top part is not really needed, since these fields will be filled in the form itself (
Sometimes there are more lines also for specific options. This feature will be more useful for the other packages which have complex input files |
Okay, I got it. Thanks for the clarification. |
I need a few clarifications;
|
|
Hello, |
Actually, you should use |
I want to confirm; for the dummy object, a dummy class is to be created(I assume not in |
@anchalm03 You can create the class in |
I need some more clarifictaions:
|
|
Yes, I think that should be a good solution. I will try working it out and then let you know difficulties (if any) in the same. |
You should change all the object creations in At the end of the function, you should have all the objects only in memory, and then you can choose to simply return (if only verifying the parameters), generate an input file with the objects then return (if creating a preview) or saving all the objects to the database and actually launching the calculation. |
There are some code blocks starting with |
Yes, but make sure that no object is created in another function call or something like that. |
@anchalm03 It seems like Django wants objects to be saved in a specific order. If you preserve the order in which objects were created (just appending to an array should work), you can try saving the objects in that order. |
Are you sure you did not miss any of the objects created in
If every object is properly handled, you can push the code to your fork so I can have a look at it and test some things. |
Is your feature request related to a problem? Please describe.
Sometimes, the input files produced are different from the expected results. To verify that they are correct, one must launch the calculations, then go to the calculation's page to see the input. If it is incorrect, the calculation must be killed and relaunched with correct parameters.
Describe the solution you'd like
It would be very useful to have a preview of the input when launching a calculation. It could simply be a textarea at the bottom of the page. The preview would be updated through an AJAX call to the backend with the form data as parameter.
To generate the input, the form data must first be parsed and validated in the same manner as the
submit_calculation
andverify_calculation
views (frontend/views.py
). Some parameters are only parsed when submitting the calculation (_submit_calculation
function) and I do not see any easy fix. These can be ignored for now.Then, the parameters and calculation data are passed to the
calc_to_ccinput
function infrontend/tasks.py
. This function normally takes aCalculation
database object as parameter, but we don't want to create an object for each preview. As such, the preview could create a simple Python object with the appropriate fields to replace it.The text was updated successfully, but these errors were encountered: