Skip to content

Improve parameter acceptance and validation in prepareDatahandleForIntegration #10

@Schlevidon

Description

@Schlevidon

Summary

There are a few improvements in the interface of prepareDatahandleForIntegration which we would like to implement.

  • Rename the parameter that accepts a numerical integrator from solver to integrator.

Caution

Don't forget to also adjust the documentation, in particular the readme and github-pages website! There may also be other pieces of documentation aside from the ones mentioned here, so try to be as thorough as possible to ensure consistency across the board.

  • Make the integrator parameter accept both function handles and char arrays as inputs.
  • Add user warnings for unrecognized or unused parameters.

Proposed solutions

  • Check if integrator parameter is a function handle using isa(x, 'function_handle' ). If so, then convert it to a char array using func2str(x).
  • Use optionlists for parameter validation. This functionality is bundled with IFDIFF and can be found in the Tools folder of the project.
    • We do not use MATLABs native argument validation because this feature was only introduced recently (2019b) and we want to stay backwards compatible (to a reasonable degree, so stick to around MATLAB2014 if possible).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions