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

Update for SCS-106 change and new power commands #41

Merged
merged 7 commits into from
Oct 18, 2021

Conversation

Gregg140
Copy link
Contributor

Description

Recently, SCS-106 was updated to leave 3 FEPs on rather than no FEPs on.
SCS-106 is run as part of the SCS-107 sequence.

Therefore thermal model history assembly requires that this change be reflected
in any shutdown: both science-only shutdowns as well as Full Stops. Also, the
ACIS Team recently added new power commands which have to be handled by Backstop History.

These were the drivers for the release of this version of Backstop History.
Several changes had been underway for some time and are incorporated in this release.

Testing

  • [x ] Passes unit tests on MacOS, linux, Windows (at least one required)
  • [x ] Functional testing

Fixes #

@jzuhone
Copy link
Member

jzuhone commented Oct 1, 2021

I'm getting some regression test failures--I'll be checking them to see what's causing them.

@Gregg140
Copy link
Contributor Author

Gregg140 commented Oct 4, 2021

I'm getting some regression test failures--I'll be checking them to see what's causing them.

You should be getting errors whenever an SCS-107 was run. This is the crux of the change - SCS-107 calls SCS-106 and 106 now leaves 3 FEP's on, whereas before it left no FEP's on.

So the DPA temps should be very different as well as FEP count. Here is an example(circa 355:10):

SEP0917_DPA_OLD_vs_DPA_NEW

self.bs_cmds = bs_cmds

# Clip commands to tbegin
bs_cmds = bs_cmds[bs_cmds['date'] > tbegin]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So in the old version we were clipping commands to tbegin. Based on your changes, do we not want to do this anymore, or is in being done in backstop_history now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Backstop history was supposed to do that but the ~30 minute backoff caused it to backchain one
extra Continuity load and, without the clipping, that caused the kadi_states.get_states to return the time-disrupted result.

Putting the line back in and clipping the bs_cmds seems to have fixed it.

I will re-run the regression tests and check the FEP plot to be sure.

Thanks

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok--sounds good. Probably a good idea in the future to revisit the -5 element backoff and find something to do that maybe makes more sense (or at least is easier to understand)

@jzuhone
Copy link
Member

jzuhone commented Oct 7, 2021

I have an update that I'd like to add to this PR, which should be a no-op--it only clears up the role of the run-start argument and gets rid of some confusing code.

I've added it to my own branch--you can see it here:

jzuhone@25adbd8

If you want to add it, let me know and we can just push this commit here.

@Gregg140
Copy link
Contributor Author

Gregg140 commented Oct 7, 2021

Sure lets include this update in this release. I'll need a line or two for the release notes.

@@ -1067,10 +1072,10 @@ def make_validation_plots(self, tlm, model_spec, outdir, run_start):
f.write(quant_table)
f.close()

# If run_start is specified this is likely for regression testing
# If self.write_pickle is specified this is likely for regression testing
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check: is "specified" or is True?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is True, yes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually "specified" is a much better comment.

Comments are not supposed to replicate/repeat the code: the reader can see how the if statement works. Comments are there to tell the reader what the intent is....to explain what's going on so that the reader does not have to waste time figuring out what's going on.

As a simple example, suppose you are incrementing x:

x +=1

The following is a useless comment:

# Increment x
x +=1

Anyone can see that x is being incremented. The comment provides no additional information.
The reader does not know why you are doing that.

But this is a more useful comment:

# Point to the next item in the star chart list.
x+=1

"specified" is better than True. But it can be made better still. I changed it to:

    # self.write_pickle is set to the value of the --run-start command 
    # line argument; either a DOY date string or None (if the argument 
    # was not specified). If a DOY date, this model run is likely for regression 
    # testing or other debugging.  In that case write out the full 
    # predicted and telemetered dataset as a pickle.

Anyone trying to figure out what we did now knows how self.write_pickle gets set, why it is set
and the intent of the block of code.

@@ -45,7 +45,7 @@ def get_validation_states(self, datestart, datestop):
Parameters
----------
datestart : string
The start date to grab states afterward.
The start date to grab states afterward.builder_class
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing carriage return before builder_class?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No just some text that wasn't there in the original. It's been removed.

states from the review load backstop file and all the
states between the latest telemetry data and the beginning
commands from the review load backstop file and all the
commands between the latest telemetry data and the beginning
of that review load backstop file.

The Review Backstop commands already obtained.
Telemtry from 21 days back to the latest in Ska obtained.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Telemetry misspelled

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

# Convert backstop commands from a list of dict to a CommandTable and
# store in self.
bs_cmds = kadi.commands.CommandTable(bs_cmds)
# Ask Backstop History to assemble the history for this loa
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"loa" --> "load"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copy link

@jazan12 jazan12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok to me Gregg. I flagged some small typos / potential wording issues in your description, but nothing in the code raised any flags with me.

@jazan12
Copy link

jazan12 commented Oct 15, 2021 via email

@Gregg140 Gregg140 merged commit 65639e9 into master Oct 18, 2021
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.

3 participants