Factor out get_ofp_states and get_telem_values for cheta #249 improvements - #285
Conversation
get_ofp_states and get_telem_values for cheta #249 improvements
| if not hasattr(self, "_tlm"): | ||
| self._tlm = get_telem_values( | ||
| msids=self.msids, stop=self.stop, days=self.days | ||
| logger.info( |
There was a problem hiding this comment.
The logging and exception handling was previously inside get_telem_values.
| # Enable logging in relevant packages | ||
| logging.getLogger("kadi").setLevel(opt.log_level) | ||
| fetch.add_logging_handler(level=opt.log_level) | ||
| fetch.data_source.set("cxc", "maude allow_subset=False") |
There was a problem hiding this comment.
Using MAUDE was previously hard-coded into get_telem_values which limits its general-purpose utility. Instead we set the data source globally within the validate states app.
javierggt
left a comment
There was a problem hiding this comment.
The code changes seem simple enough to me:
- functions got removed
- replacements from cheta are used
- logging and error check are added
- some other tiny things
I looked over the functional test reports and ran the scripts on the branch. It seems ok to me. I just want to note that I got a slightly different TSCPOS plot. They agree between master and branch, but differ with yours. I put all the reports here. I do not think it is relevant to this PR, but still begs the question.
I suggest to either:
- wait until sot/cheta/pull/249 is merged, in case there are changes in cheta.
- add these functional tests to the tests in sot/cheta/pull/249.
|
@javierggt - thanks for the review. I agree we need to wait on cheta# 249. About the diffs, for the record here it is and I'll look into it. I also note that plotly seems to be doing something weird with the negative sign. This occurs in all the versions so it is not a regression here but still should be fixed. TAJG |
|
@javierggt - about the difference in SIM-Z between our respective runs, I note that the additional bad data point in your plot is within a couple seconds of a time when the OFP is doing something weird at 2022:294:16:37:27.347 CONLOFP=STUP. When I directly look at telemetry from cheta this glitch does not seem present: Do you get the same? |
|
About the malformed minus sign, this is discussed at https://stackoverflow.com/questions/75234217/gibberish-malformed-negative-y-axis-values-in-plotly-charts-in-python, but with no resolution. |
|
cheta 249 is merged now, so I'm merging this one. |


Description
This PR is paired with sot/cheta#249 to factor out the
get_ofp_statesandget_telem_valuesfunctions intochetawhere they more logically belong.Interface impacts
get_ofp_statesandget_telem_valuesare no longer available inkadi.utils. Both of these are currently used only internally withinchetaandkadiin SOT repos on GitHub. Any other usages in non-versioned tools can just be fixed.The API for both of these were changed as well, hence it would not make sense to include a reference in
kadi.utils(from cheta) for back-compatibility.Testing
Unit tests
Independent check of unit tests by [REVIEWER NAME]
Functional tests
Validation script was run from inside the repo for the
branchoutputs and outside the repo forrelease. Thechetarepository was checked out with sot/cheta#249.In both cases below I did a side-by-side visual / by-eye text comparison of the outputs from this branch and ska3 2023.1 respectively. No diffs were seen.
Run with default arguments covering last 14 days (uses MAUDE)
env PYTHONPATH=/Users/aldcroft/git/cheta python -m kadi.scripts.validate_states --out-dir current-branchpython -m kadi.scripts.validate_states --out-dir current-releaseRun with arguments covering 2022:283 safe mode (no MAUDE)
env PYTHONPATH=/Users/aldcroft/git/cheta python -m kadi.scripts.validate_states --out-dir safe-2022-branch --stop=2022:297 --days=5python -m kadi.scripts.validate_states --out-dir safe-2022-release --stop 2022:297 --days=5