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

Extend MESSAGEix-Material tests #240

Open
macflo8 opened this issue Oct 14, 2024 · 0 comments
Open

Extend MESSAGEix-Material tests #240

macflo8 opened this issue Oct 14, 2024 · 0 comments
Labels
material MESSAGEix-Materials variant

Comments

@macflo8
Copy link
Contributor

macflo8 commented Oct 14, 2024

This is a tracking issue as a follow-up of adding more tests as one of the improvement items listed in #194.

With #218 the model build of MESSAGEix-Materials has become testable, which significantly raised coverage. @glatterf42 has suggested a few more test cases, which are listed here:

  • Test MACRO calibration file updater

Typically, one would likely shorten the first sentence like this.

Also, would it be possible to get a test calling this function?

Originally posted by @glatterf42 in #218 (comment)

  • Add more parametrizations to test_build()
    [
        ("R12", "B", "B", False),
        ("R12", "B", "B", True),
    ],

A parametrization like this is great, but would likely be even more beneficial if the function parameters actually received different values. Also, this would add line 50 of this file to the tests :)

Originally posted by @glatterf42 in #218 (comment)

  • Add more parametrizations to test_make_spec()

Testing these two lines (254 and 255) might not be strictly necessary, but if you wanted to do it, I'd recommend making these lines their own function, that does just one job: take a Spec object and extend the node set. This would likely be easier to test than this whole make_spec() function as it requires less setup.

Originally posted by @glatterf42 in #218 (comment)

  • Test MESSAGEix-Materials on a MESSAGEix-GLOBIOM (R12) snapshot

Same as above: is is feasible to write a test that calls this function once with modify_existing_constraints = True and once with modify_existing_constraints = False?

Originally posted by @glatterf42 in #218 (comment)

  • Test material-ix CLI commands

This file is missing several lines from test coverage. It would be great to add a few more of them :)

Originally posted by @glatterf42 in #218 (comment)

In addition, the following model workflow parts need tests:

  • Solving a baseline build of MESSAGEix-Materials (requires either a compatible MESSAGEix-GLOBIOM snapshot or a bare RES extension)
  • Reporting of model results after solve (currently in model/report/reporting.py, refactored version is in development)
@macflo8 macflo8 added the material MESSAGEix-Materials variant label Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
material MESSAGEix-Materials variant
Projects
None yet
Development

No branches or pull requests

1 participant