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

Write .hist files to --outdir directory #42

Merged
merged 2 commits into from
Oct 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions acis_thermal_check/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,12 @@ def run(self, args, override_limits=None):
print(f"acis_thermal_check version {version}")
return

# First, record the selected state builder in the class attributes
self.state_builder = make_state_builder(args.state_builder, args)

# First, do some initial setup and log important information.
proc = self._setup_proc_and_logger(args)

# Record the selected state builder in the class attributes
Copy link
Member

Choose a reason for hiding this comment

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

Did it not work if you didn't move this after _setup_proc_and_logger?

Copy link
Contributor Author

@Gregg140 Gregg140 Oct 21, 2021

Choose a reason for hiding this comment

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

I moved it because I wanted to be sure that the output directory was created before Backstop History was instantiated. All regression tests passed.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, good

self.state_builder = make_state_builder(args.state_builder, args)

# If args.run_start is not none, write validation and prediction
# data to a pickle later
self.write_pickle = args.run_start is not None
Expand Down
9 changes: 7 additions & 2 deletions acis_thermal_check/state_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,11 @@ def get_prediction_states(self, tbegin):
#-------------------------------------------------------------------------------
class ACISStateBuilder(StateBuilder):

def __init__(self, interrupt=False, backstop_file=None, nlet_file=None,
verbose=2, logger=None):
def __init__(self, interrupt=False,
backstop_file=None,
nlet_file=None,
outdir=None,
verbose=2, logger=None):
"""
Give the ACISStateBuilder arguments that were passed in
from the command line and get the backstop commands from the load
Expand All @@ -221,6 +224,7 @@ def __init__(self, interrupt=False, backstop_file=None, nlet_file=None,
logger : Logger object, optional
The Python Logger object to be used when logging.
"""

# Import the BackstopHistory class
from backstop_history import BackstopHistory

Expand All @@ -230,6 +234,7 @@ def __init__(self, interrupt=False, backstop_file=None, nlet_file=None,
# Create an instance of the Backstop command History Class
self.BSC = BackstopHistory.Backstop_History_Class('ACIS-Continuity.txt',
self.nlet_file,
outdir,
verbose)
super(ACISStateBuilder, self).__init__()

Expand Down
1 change: 1 addition & 0 deletions acis_thermal_check/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ def make_state_builder(name, args):
state_builder = builder_class(interrupt=args.interrupt,
backstop_file=args.backstop_file,
nlet_file=args.nlet_file,
outdir=args.outdir,
verbose=args.verbose,
logger=mylog)
else:
Expand Down