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 gainsel_webmaker.py #296

Merged
merged 3 commits into from
Jul 9, 2024
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
6 changes: 3 additions & 3 deletions src/osa/scripts/gainsel_webmaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ def determine_status(row):
def main():
"""Produce the html file with the processing OSA Gain Selection status.

It creates an HTML file osa_gainsel_status_YYYYMMDD.html
It creates an HTML file osa_gainsel_status_YYYY-MM-DD.html
"""
args = ArgumentParser(
description=(
"Script to create an HTML file with the gain selection status "
"(osa_gainsel_status_YYYYMMDD.html)"
"(osa_gainsel_status_YYYY-MM-DD.html)"
),
parents=[common_parser],
).parse_args()
Expand All @@ -135,7 +135,7 @@ def main():

gain_selection_web_directory = Path(cfg.get("LST1", "GAIN_SELECTION_WEB_DIR"))
gain_selection_web_directory.mkdir(parents=True, exist_ok=True)
html_file = gain_selection_web_directory / f"osa_gainsel_status_{flat_date}.html"
html_file = gain_selection_web_directory / f"osa_gainsel_status_{date}.html"

# Create and save the HTML file
if not run_summary_file.is_file() or len(Table.read(run_summary_file)["run_id"]) == 0:
Expand Down
4 changes: 2 additions & 2 deletions src/osa/scripts/tests/test_osa_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,14 +407,14 @@ def test_gainsel_webmaker(
output = sp.run(["gainsel_webmaker", "-d", "2020-01-17"])
assert output.returncode == 0
directory = base_test_dir / "OSA" / "GainSelWeb"
expected_file = directory / "osa_gainsel_status_20200117.html"
expected_file = directory / "osa_gainsel_status_2020-01-17.html"
assert expected_file.exists()

# Test a date with non-existing run summary
output = sp.run(["gainsel_webmaker", "-d", "2024-01-12"])
assert output.returncode == 0
directory = base_test_dir / "OSA" / "GainSelWeb"
expected_file = directory / "osa_gainsel_status_20240112.html"
expected_file = directory / "osa_gainsel_status_2024-01-12.html"
assert expected_file.exists()


Expand Down