Skip to content

Conversation

@adrivinca
Copy link
Contributor

@adrivinca adrivinca commented Jan 30, 2025

transferring code from the message_data PR#594 as I need to make it accessible to reviewers during the paper submission phase

The code includes some tests, but it relies on two external packages, of which one is IIASA private.

  • RIME, open-source IIASA package, lacking test suite
  • climate-processor , private IIASA package, with tests

Some source .nc files are still not included in the folder, due to their size. but could be included as Git LFS or reformatted

How to review

TBD

PR checklist

  • Continuous integration checks all ✅
  • Add or expand tests; coverage checks both ✅
  • Add, expand, or update documentation.
  • Update doc/whatsnew.

@adrivinca adrivinca self-assigned this Jan 30, 2025
@codecov
Copy link

codecov bot commented Jan 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.4%. Comparing base (4fd6446) to head (6593c38).
Report is 1 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main    #290   +/-   ##
=====================================
  Coverage   77.4%   77.4%           
=====================================
  Files        217     217           
  Lines      16851   16851           
=====================================
  Hits       13048   13048           
  Misses      3803    3803           
🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@khaeru
Copy link
Member

khaeru commented Sep 11, 2025

Hi, following discussion at today's MESSAGE meeting I took a quick skim of the code to see what we could do about testing this:

  • It seems the following are imported and used:
    from climate_processor import run_magicc
  • For this, we can:
    • Use the built-in Pytest 'monkeypatch' features to make a "fake" function that imitates the function. This can return whatever data structure or create whatever files the real function would create, only with empty/random values.
    • Move the import inside a function or try: / except ImportError: block, so that message_ix_models can be imported and used even if users do not have this package on their system.
  • RIME, open-source IIASA package, lacking test suite
  • It seems the following are imported and used:
    from rime.core import GMTPathway, RegionArray
    from rime.rime_functions import table_impacts_gwl
  • While the repo is open source, the package does not appear to be published on PyPI.
  • We can:
    • 'protect' the import statements in the same way as climate_processor.
    • For the automated testing of message-ix-models, install the package directly from GitHub.

Some source .nc files are still not included in the folder, due to their size. but could be included as Git LFS or reformatted

How large exactly? There are various solutions here:

  • We could store them in Git LFS in this repo or in another repo (on GitHub, on IIASA GitLab, etc.).
  • We could store them on Zenodo or elsewhere.
  • We could write a little code that generates fake/empty/random files with the proper structure, for test usage only.

I'll be happy to help with the 2 third-party packages; TBD with the data files.

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

Successfully merging this pull request may close these issues.

2 participants