CCP-WSI/research-software-directory

Add solver to admin metadata for numerical test cases

glpoulter opened this issue · 4 comments

The modelling approach for test cases can be "Numerical" or "Physical".

For physical we need the facility in the admin metadata (which we already have) but for numerical test cases we need solver instead.

So:

For numerical test cases: add solver to admin metadata sidebar.

For both cases add text ("for modelling Test Cases") next to the word "Facility" or "Solver"

It's more complicated to add a solver than first thought.

It doesn't appear to be possible to add a solver to the schema and admin page without a warning message appearing on the admin page: "key "null" not found in collection "software". (It does this for Project in the Test Case schema too but it's less obvious because that is set up as an array to allow multiple projects (in error) - see #122). It's not a problem, per se, it just is an unnecessary warning message which might confuse the user.

The best semi-workaround I can think of is to set it up as an array like project is, and set the max items to 1 so it's an array which can only have 1 solver in it. This means the warning message is hidden from the initial view, and only seen if a solver is going to be added. It also has the advantage that you can delete the solver if you added it by mistake (see #1 )

Another work around required - need to add a "help" message to the contact page saying to add Solver "If Modelling Approach is numeric". But for arrays, the help message doesn't appear. To work around this, I've added it to the label section of solver as, because it's an array, we already have the label Solver at the higher level (i.e. the help label replaces what would otherwise be "foreignkey".

Just need to add a little more padding between "for Numerical Test Cases" text and the solver as there's less space with pictures than text(?!) i.e. it's not so bad between "for Physical Test Cases" and the facility name...

Closing this for now despite minor styling requirement left.