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

Config Comparing Table #298

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open

Conversation

lawrence-hwang
Copy link
Contributor

New Feature: Generate a table to compare the configuration of multiple models of the same type.

@lawrence-hwang lawrence-hwang added this to the v1.4 milestone May 12, 2022
@lawrence-hwang lawrence-hwang self-assigned this May 12, 2022
@lawrence-hwang lawrence-hwang linked an issue May 12, 2022 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented May 12, 2022

Codecov Report

Merging #298 (9daf85c) into dev (cc8e7c0) will decrease coverage by 1.03%.
The diff coverage is 32.05%.

@@            Coverage Diff             @@
##              dev     #298      +/-   ##
==========================================
- Coverage   91.28%   90.24%   -1.04%     
==========================================
  Files          58       59       +1     
  Lines        4383     4461      +78     
==========================================
+ Hits         4001     4026      +25     
- Misses        382      435      +53     
Impacted Files Coverage Δ
src/prog_models/utils/table.py 12.76% <12.76%> (ø)
tests/test_base_models.py 90.50% <47.61%> (-0.93%) ⬇️
src/prog_models/utils/parameters.py 89.33% <88.88%> (-0.07%) ⬇️
src/prog_models/utils/__init__.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cc8e7c0...9daf85c. Read the comment docs.

@lgtm-com
Copy link

lgtm-com bot commented May 12, 2022

This pull request introduces 1 alert when merging 9242104 into cc8e7c0 - view on LGTM.com

new alerts:

  • 1 for Wrong number of arguments in a call

@lawrence-hwang
Copy link
Contributor Author

lawrence-hwang commented May 13, 2022

LEAVING OFF NOTES

This issue and PR are unfinished due to not having enough time to complete before the end of my internship with the Diagnostics and Prognostics group. In this comment, I will convey the work I have done towards a solution and where I left off in hopes that this issue will be picked up and completed at a later date.

Completed

  • A table is represented by a list of strings, where each string is a row. The 0th row is the first line of the table, and the ith string the ith row. Tables are formulated by iterating over attributes and appending new rows to the table, which is then finally printed at the end using something like print(*table_list, sep='\n')
  • Method created in PrognosticsModelParameters of parameters.py, compare, that takes any number of other parameter objects with attributes to print
  • Testing structure created in test_base_models.py, unittest test_config_table()
  • Elementary table printing logic implemented, currently only printing rows with attributes

Recommended Next Steps

  • Format the table in a prettier way. Consider looking at our describe implementation and table utils over in prog_algs UncertainData. To make this easier, I have already imported the code from prog_algs utils/table.py here. You can try running the code with the parameters dictionary, and while it works, it DOES NOT print in the format/alignment we would like. Might be able to do some tweaking to reuse that table's code.
  • Some attributes are stored as dictionaries. Consider printing separate table for these. Suggest accomplishing this recursively.

@teubert teubert modified the milestones: v1.4, v1.5 Oct 3, 2022
@teubert teubert modified the milestones: v1.5, v1.6 Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: models enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Config Comparing Table
3 participants