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

Use cases for math #65

Closed
nickerso opened this issue Apr 5, 2016 · 8 comments
Closed

Use cases for math #65

nickerso opened this issue Apr 5, 2016 · 8 comments

Comments

@nickerso
Copy link
Contributor

nickerso commented Apr 5, 2016

It would be useful to add use-cases for math to the current list (i.e., 1.xii and 1.xiii in the current list at http://libcellml.readthedocs.org/en/latest/usecases.html)

@jonc125
Copy link
Contributor

jonc125 commented Apr 5, 2016

Where you have just maths & variables, I guess things like:

  • a = 1 ms
  • a = b
  • For each (CellML subset) MathML operator, a separate test case of the simplest possible equation involving it
  • A few more complex cases with several operators and levels of nesting
  • A simple ODE, e.g. dV/dt = 1 mV/ms
  • A simple system of equations, e.g. a=1, a=b+c, b=2

Since we're just checking construction and serialisation at this stage this is perhaps slightly overkill (the last in particular) but they're the sort of thing we'll need when considering units conversions, math evaluation, etc.

With connections, a few of the simple multi-variable cases above, but where the variables come from different components. Again, since we're not yet evaluating, handling source variables several connections away is probably overkill.

@dladd
Copy link
Contributor

dladd commented May 5, 2016

From the discussion on pull #66 and resulting changes to the current thinking doc, the consensus was to move forward with treating MathML as a string.

Some possible testing permutations would then be:

  • A model with valid/invalid maths in a component
    • with no/one/multiple connections
      • with valid/invalid/no variable(s)
        • with valid/invalid/dimensionless/no units

I propose modifying the use-cases document to explicitly capture a few of these (more permutations will also be tested).

  • 1.xiii. a model with maths and variables
    • a. model from 1.xi.d.1 and define invalid maths
    • b. model from 1.xi.d.1 and define valid maths using the two variables with units dimensionless
  • 1.xiv. a model with maths, variables and connections
    • a. model with two components, each containing two variables, maths, and one connection
    • b. model from 1.vi.a and define valid maths on variables in child and parent components with one connection

@nickerso
Copy link
Contributor Author

nickerso commented May 5, 2016

seems like a good idea to me.

@jonc125
Copy link
Contributor

jonc125 commented May 5, 2016

If we're just treating maths as opaque strings and not resolving variables or units references, those cases seem... difficult to distinguish? And we're not doing validation at all yet. Although I agree they're the sort of thing that would be useful longer term!

@dladd
Copy link
Contributor

dladd commented May 5, 2016

True, this may be overkill for the current "Create" step with maths strings- we can cull some (or all but one) of my proposed cases if you think that is more appropriate. But, as you say, these use-cases are recycled in the subsequent "Modify/Load/Validate" steps and could be tests for more complete MathML handling downstream. So it might not hurt to flesh them out now.

@agarny
Copy link
Contributor

agarny commented May 6, 2016

If I recall correctly (from a previous issue/PR), we only want to have tests that refer to what we are currently working on. If, down the line, we realise that we need more tests (as we will clearly need here at some point), then we add those tests. (@hsorby, I believe I remember this from one of your comments, so please feel free to correct me if I got/remember it wrong.)

@hsorby
Copy link
Contributor

hsorby commented May 7, 2016

Yes @agarny you are right, we only want to write tests for what we are currently doing and not what we think we will do.

@dladd
Copy link
Contributor

dladd commented May 8, 2016

OK that sounds reasonable. Should we pare the use-cases back to just the "a"s on each item above? I.e.,

  • 1.xiii. a model with maths and variables
    • a. model from 1.xi.d.1 and define invalid maths
  • 1.xiv. a model with maths, variables and connections
    • a. model with two components, each containing two variables, maths, and one connection

nickerso pushed a commit to nickerso/libcellml that referenced this issue Mar 8, 2021
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

5 participants