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

Integration of LPdiag tool #704

Merged
merged 72 commits into from
Nov 30, 2023
Merged

Commits on Nov 24, 2023

  1. Initial commit of MCA tool

    Please find the original repo at https://github.com/marek-iiasa/MCA/tree/master
    Note that e.g. the reading material has not yet been included here
    glatterf42 authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    9797a99 View commit details
    Browse the repository at this point in the history
  2. LPdiag enhancements

    Counter of coeffs having different magnitudes was added. Order and wordings of printouts was improved. Comments  added to the code, including modified TODO comments.
    marek-iiasa authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    c05ba51 View commit details
    Browse the repository at this point in the history
  3. Move lp_diag files to better locations

    * Move README.textile to doc/tools/lp_diag_README.textile for now
    * This needs to be converted to rst later on
    glatterf42 authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    7fea85e View commit details
    Browse the repository at this point in the history
  4. [lp_diag] Add several features

    Counters of outliers added. Order of printouts improved, wording in printouts improved, comments in the core improved, including updated TODOs, which summarize possible further enhancements.
    marek-iiasa authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    6981156 View commit details
    Browse the repository at this point in the history
  5. [lp_diag] Update readme.txt

    to reflect the new location of the tool
    marek-iiasa authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    3a3a4e9 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    65d00c4 View commit details
    Browse the repository at this point in the history
  7. [lp_diag] Add temporary doc

    The doc/tools/lp_diag_README.textile contains a brief description of the tool.
    marek-iiasa authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    b1ac60d View commit details
    Browse the repository at this point in the history
  8. Remove old file structure

    glatterf42 authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    8a7f080 View commit details
    Browse the repository at this point in the history
  9. Apply black, isort, flake8, mypy

    glatterf42 authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    c7ecebd View commit details
    Browse the repository at this point in the history
  10. Resolve some flake8 errors

    glatterf42 authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    3c63dbe View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    2a4765e View commit details
    Browse the repository at this point in the history
  12. Avoid overwriting cli args passed to the script

    Set some rather arbitrary defaults for the args, please change them
    as necessary. Uncomment later lines (~80) to retain old behaviour.
    glatterf42 authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    1f61d0f View commit details
    Browse the repository at this point in the history
  13. Enforce max line length of 88

    glatterf42 authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    1f64fbb View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    df55828 View commit details
    Browse the repository at this point in the history
  15. Use LPdiag to satisfy flake8

    glatterf42 authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    eebaa46 View commit details
    Browse the repository at this point in the history
  16. Change import to maybe satisfy mypy

    glatterf42 authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    1186320 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    1b3f2a2 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    fe1fbea View commit details
    Browse the repository at this point in the history
  19. [lp_diag] Update .gitignore

    to refrain from committing working dirs and *.swp files
    marek-iiasa authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    e71517b View commit details
    Browse the repository at this point in the history
  20. [lp_diag] Refactor rd_mps()

    Processing of each MPS section organized into the corresponding functions. Thus the, previously large and complex rd_mps() is now compact and much simpler.
    marek-iiasa authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    00616a3 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    421f884 View commit details
    Browse the repository at this point in the history
  22. [lp_diag] Reduce complexity to satisfy flake8

    lpdiag.py modified substantially in order to conform to the complexity limit of flake8. The new version was checked with flake8 and run through black
    marek-iiasa authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    c65931f View commit details
    Browse the repository at this point in the history
  23. [lp_diag] Adjust main.py

    main.py modified to ease running it locally (without message_ix env) and fast testing. The committed version is prepared for running in message_ix env.
    marek-iiasa authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    3d96563 View commit details
    Browse the repository at this point in the history
  24. [lp_diag] Satisfy mypy per fn_out, f_out

    main.py: corrected the defaults for fn_out, f_out (inconsistency of types detected by mypy)
    lpdiag.py: removed duplicated defs of sections[]
    marek-iiasa authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    e8d4ae5 View commit details
    Browse the repository at this point in the history
  25. [lp_diag] Satisfy mypy & pycharm in main.py

    in main.py, only to satisfy diagnostics of both mypy and pycharm
    marek-iiasa authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    3bb81d5 View commit details
    Browse the repository at this point in the history
  26. [lp_diag] Add initial draft of docs

    Far from worth to read, committed as a back-up only.
    marek-iiasa authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    f1a9ec2 View commit details
    Browse the repository at this point in the history
  27. [lp_diag] Diverse improvements

    This is an intermediate working version. Please wait with comments until a stable version will be committed.
    marek-iiasa authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    c6f0808 View commit details
    Browse the repository at this point in the history
  28. [lp_diag] Change location of test-mps files

    The new location simplifies the access.
    marek-iiasa authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    d448604 View commit details
    Browse the repository at this point in the history
  29. [lp_diag] Refactor and improveme

    The file names changed in order to provide a clearer use. CL options changed also to improve usage. Info on actual working directory added, as well as check of readability of the required MPS file. The default run (i.e., without the CL params) uses one of small test MPS. Moreover, a number of improvements in comments, including removal of redundant comments.
    marek-iiasa authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    1237431 View commit details
    Browse the repository at this point in the history
  30. [lp_diag] Conform to flake8

    Comments shorten to conform to the line-length limit
    marek-iiasa authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    0b0229d View commit details
    Browse the repository at this point in the history
  31. [lp_diag] Sort import statements

    To please the (really picky) isort test of lint.
    marek-iiasa authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    cba978d View commit details
    Browse the repository at this point in the history
  32. [lp_diag] Improve work-dir diagnostics

    Diagnostics of possible problems with wrong working directory improved, as well as the corresponding tip on dealing with the problem.
    marek-iiasa authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    8ca4457 View commit details
    Browse the repository at this point in the history
  33. [lp_diag] Add to message_ix/cli.py

    I 've added two lines (10 and 158) trying to make it possible to run lpdiag from the CL. Note: lpdiag.py is the main function of lpdiag.
    
    This does not work; therefore both lines are commented in order to not cause possible problems.
    marek-iiasa authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    cd2c57c View commit details
    Browse the repository at this point in the history
  34. [lp_diag] Modify message_ix/cli.py

    Uncomment import  message_ix.tools.lp_diag.lpdiag
    and added:
    main.add_command(message_ix.tools.lp_diag.lpdiag)
    marek-iiasa authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    0cdb467 View commit details
    Browse the repository at this point in the history
  35. [lp_diag] Comment pieces of message_ix/cli.py

    The commented pieces were attempts to make lpdiag callable in message-ix env, from any place. These don't work with the current set-up of lpdiag.
    marek-iiasa authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    011407c View commit details
    Browse the repository at this point in the history
  36. Correct typos in output generation

    Several typos in the text generated during the execution were corrected.
    marek-iiasa authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    637cf26 View commit details
    Browse the repository at this point in the history
  37. [lp_diag] First complete version of the doc embedded in the message-i…

    …x doc
    
    Posted as the Readme.rst located in message-ix/message-ix/tools/lp_diag directory, and linked to the message-ix/doc/tools/lp_diag.rst; thus it is embedded in the message-ix doc.
    marek-iiasa authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    dd434f1 View commit details
    Browse the repository at this point in the history
  38. [lp_diag] Correct spelling in doc

    Spelling corrected in Readme.rst.
    marek-iiasa authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    4df0b37 View commit details
    Browse the repository at this point in the history
  39. [lp_diag] Correct typo

    Corrected in the text of diagnostics message..
    marek-iiasa authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    70c49b8 View commit details
    Browse the repository at this point in the history
  40. [lp_diag] Reformat to satisfy black

    To conform to the black test, which failed after adding a single space.
    marek-iiasa authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    929a9b3 View commit details
    Browse the repository at this point in the history
  41. [lp_diag] Satisfy flake8

    Just to please the new version (thus more picky) version of flake8; no changes in the functionality.
    marek-iiasa authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    d2227d7 View commit details
    Browse the repository at this point in the history
  42. Configuration menu
    Copy the full SHA
    fbe04f0 View commit details
    Browse the repository at this point in the history
  43. Remove scratch code

    measrainsey authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    0d78269 View commit details
    Browse the repository at this point in the history
  44. Fix for linting

    measrainsey authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    82c94a6 View commit details
    Browse the repository at this point in the history
  45. Configuration menu
    Copy the full SHA
    faf1f63 View commit details
    Browse the repository at this point in the history
  46. Shorten too long lines

    glatterf42 authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    5c24d98 View commit details
    Browse the repository at this point in the history
  47. Shorten more too long lines

    glatterf42 authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    841ef96 View commit details
    Browse the repository at this point in the history
  48. Enhance LPdiag tool

    * Add test coverage
    * Add some type hints
    * Clarify function names
    * Remove some outdated comments
    glatterf42 authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    fd96495 View commit details
    Browse the repository at this point in the history
  49. Satisfy mypy by renaming variables

    Re-enable pre-commit mypy hook.
    glatterf42 authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    ce27097 View commit details
    Browse the repository at this point in the history
  50. Add more tests including necessary data

    glatterf42 authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    c0a8a2f View commit details
    Browse the repository at this point in the history
  51. Cover some more lines with tests

    glatterf42 authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    84ab118 View commit details
    Browse the repository at this point in the history
  52. Update documentation

    glatterf42 authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    3780215 View commit details
    Browse the repository at this point in the history
  53. Add iiasa#704 to release notes

    glatterf42 authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    e48cf16 View commit details
    Browse the repository at this point in the history
  54. Restructure test data

    glatterf42 authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    5d14049 View commit details
    Browse the repository at this point in the history
  55. Consolidate LPdiag .gitignore at top level

    * Remove the markers:
    * message_ix/tools/lp_diag/data/mps/of_*
    * message_ix/tools/lp_diag/Bak/
    * message_ix/tools/lp_diag/doc/
    * message_ix/tools/lp_diag/sph/
    * Use .git/info/exclude for such personal markers!
    glatterf42 authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    7e49e61 View commit details
    Browse the repository at this point in the history
  56. Configuration menu
    Copy the full SHA
    4b255de View commit details
    Browse the repository at this point in the history
  57. Ensure tests work as intended

    glatterf42 authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    802af83 View commit details
    Browse the repository at this point in the history
  58. Update lp_diag.py to correctly identify columns

    * Changing `"col":self.mat_row` to `"col":self.mat_col` when generating self.mat DataFrame to allow the tool to correctly identify columns with bad coefficients
    * Thanks, @ywpratama
    glatterf42 authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    82d3ba6 View commit details
    Browse the repository at this point in the history
  59. Remove duplicate key in coverage config

    glatterf42 authored and khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    e75a081 View commit details
    Browse the repository at this point in the history
  60. Add tests/tools/__init__.py

    khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    cc3435f View commit details
    Browse the repository at this point in the history
  61. Configuration menu
    Copy the full SHA
    922fa6e View commit details
    Browse the repository at this point in the history
  62. Configuration menu
    Copy the full SHA
    f292aae View commit details
    Browse the repository at this point in the history
  63. Configuration menu
    Copy the full SHA
    1bfce5c View commit details
    Browse the repository at this point in the history
  64. Rename lp_diag/lp_diag.py → lp_diag/__init__.py

    Adjust references
    khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    12b2c73 View commit details
    Browse the repository at this point in the history
  65. Rename test_lpdiag → test_lp_diag

    Match the module name
    khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    daeccb2 View commit details
    Browse the repository at this point in the history
  66. Convert lp_diag.cli.main to a click.Command

    - Integrate with top-level CLI as "message-ix lp-diag".
    - Use click option processing; remove read_args().
    - Use click.Path and pathlib for checks.
    - Reflow comments and code for readability.
    khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    f17f727 View commit details
    Browse the repository at this point in the history
  67. Apply numpydoc style to docstrings in .lp_diag

    - Fix typos in some string literals.
    khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    deb771a View commit details
    Browse the repository at this point in the history
  68. Add § "API reference" to doc/tools/lp_diag

    - Use heading order (*, =, -) consistent with other docs.
    - Correct a malformed reference.
    - Add a `.. contents::` directive.
    khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    1e688f5 View commit details
    Browse the repository at this point in the history
  69. Un-hard-wrap lines in doc/tools/lp_diag.rst

    Also:
    - Replace "python lp_diag.py" with "message-ix lp-diag".
    - use :program: role to document CLI options; use lower case to match
      the actual option names.
    - use :file: role where appropriate
    - Remove comments in cli.py that duplicated docs text.
    khaeru committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    46e5e07 View commit details
    Browse the repository at this point in the history
  70. Configuration menu
    Copy the full SHA
    51fdfa3 View commit details
    Browse the repository at this point in the history
  71. Configuration menu
    Copy the full SHA
    50dce2a View commit details
    Browse the repository at this point in the history
  72. Configuration menu
    Copy the full SHA
    2a6c423 View commit details
    Browse the repository at this point in the history