Skip to content

Adding basic input file previews when launching a calculation #26

@RaphaelRobidas

Description

@RaphaelRobidas

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 and verify_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 in frontend/tasks.py. This function normally takes a Calculation 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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions