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

Should we run some basic checks after parsing a model? #242

Open
MichaelClerx opened this issue Feb 25, 2020 · 10 comments
Open

Should we run some basic checks after parsing a model? #242

MichaelClerx opened this issue Feb 25, 2020 · 10 comments

Comments

@MichaelClerx
Copy link
Contributor

MichaelClerx commented Feb 25, 2020

At the moment we have some methods to check the model makes sense:

  • Model.check_left_right_units_equal

and

  • testparser.py::check_rdf_identities(model)
  • testparser.py::check_dummy_assignment(model)

(I moved these last two into testing at one stage, as that was the only place they were used)

Should these be standard checks that occur after parsing a model? And maybe all hidden but called by some validate() method?

  • Add a (validation) check that a model has only one free variable
@MichaelClerx
Copy link
Contributor Author

Thoughts @jonc125 @MauriceHendrix @skeating ?

@MauriceHendrix
Copy link
Contributor

It's not a bad idea but I do want to be a bit careful.

Depending on the validation my tests might be harder (probably not but I'd want to test it first)
Also: will there be a performance implication?
Is there a chance of disallowing something that's perfectly legal (like unrelated metadata etc)?

In any case I'd prefer to have an option to bypass the validation if I felt like it.

@MichaelClerx
Copy link
Contributor Author

I'm guessing there won't be much of a performance hit

But we could definitely make the validation optional. Have some kind validate method that returns True or False.

I'd want that anyway for the use case where users build a model from scratch through the API, or when they modify a model after loading it

@MauriceHendrix
Copy link
Contributor

I'm guessing there won't be much of a performance hit

But we could definitely make the validation optional. Have some kind validate method that returns True or False.

I'd want that anyway for the use case where users build a model from scratch through the API, or when they modify a model after loading it

I don't might if the deaful is on for the validation

@jonc125
Copy link
Contributor

jonc125 commented Feb 26, 2020

Happy to start curating a list of possible checks, but let's not implement any yet. Some like thorough units checking would fail for most existing models, for instance... so we need to be selective!

@skeating
Copy link
Contributor

I agree this is important. Experience from libSBML would suggest having categories of tests that can be turned on/off. Some people just really dont care if something is not quite right but their model still runs and would get frustrated by a model not being read in just because of an error that they dont see as a problem.

@MauriceHendrix
Copy link
Contributor

I guess that's what warnings are for?

@skeating
Copy link
Contributor

Yes but other people who want things to be strict and fail completely if there are discrepancies. Modellers come in all shapes and sizes 😄

@MichaelClerx
Copy link
Contributor Author

Also if you're using cellmlmanip you wouldnt' want to filter warnings to see which ones to keep as warnings and which ones to show as an error to the user

@MauriceHendrix
Copy link
Contributor

Yes but other people who want things to be strict and fail completely if there are discrepancies. Modellers come in all shapes and sizes 😄

ha ha sure that's fair enough

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants