Skip to content

Commit

Permalink
replace more uses
Browse files Browse the repository at this point in the history
  • Loading branch information
kosack committed May 25, 2022
1 parent 94eff39 commit 6ade73e
Show file tree
Hide file tree
Showing 8 changed files with 1,131 additions and 1,180 deletions.
4 changes: 2 additions & 2 deletions ctapipe/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def dl1_image_file(dl1_tmp_path, prod5_gamma_simtel_path):
f"--input={prod5_gamma_simtel_path}",
f"--output={output}",
"--write-dl1-images",
"--DataWriter.write_parameters=False",
"--DataWriter.write_dl1_parameters=False",
"--max-events=20",
"--DataWriter.Contact.name=αℓℓ the äüöß",
]
Expand Down Expand Up @@ -351,7 +351,7 @@ def dl1_muon_file(dl1_tmp_path):
f"--input={infile}",
f"--output={output}",
"--write-dl1-images",
"--DataWriter.write_parameters=False",
"--DataWriter.write_dl1_parameters=False",
"--DataWriter.Contact.name=αℓℓ the äüöß",
]
assert run_tool(ProcessorTool(), argv=argv, cwd=dl1_tmp_path) == 0
Expand Down
2 changes: 1 addition & 1 deletion ctapipe/io/datawriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ def _write_dl1_telescope_events(
if self.write_dl1_images:
if dl1_camera.image is None:
raise ValueError(
"DataWriter.write_images is True but event does not contain image"
"DataWriter.write_dl1_images is True but event does not contain image"
)
# note that we always write the image, even if the image quality
# criteria are not met (those are only to determine if the parameters
Expand Down
10 changes: 5 additions & 5 deletions ctapipe/io/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ def r1_hdf5_file(r1_path):
writer = DataWriter(
event_source=source,
output_path=path,
write_parameters=False,
write_images=False,
write_showers=False,
write_raw_waveforms=False,
write_waveforms=True,
write_dl1_parameters=False,
write_dl1_images=False,
write_dl2=False,
write_r0_waveforms=False,
write_r1_waveforms=True,
)

for e in source:
Expand Down
24 changes: 12 additions & 12 deletions ctapipe/io/tests/test_datawriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ def test_write(tmpdir: Path):
with DataWriter(
event_source=source,
output_path=output_path,
write_parameters=False,
write_images=True,
write_showers=True,
write_raw_waveforms=True,
write_waveforms=True,
write_dl1_parameters=False,
write_dl1_images=True,
write_dl2=True,
write_r0_waveforms=True,
write_r1_waveforms=True,
) as writer:
writer.log.level = logging.DEBUG
for event in source:
Expand Down Expand Up @@ -138,15 +138,15 @@ def test_roundtrip(tmpdir: Path):
with DataWriter(
event_source=source,
output_path=output_path,
write_parameters=False,
write_images=True,
write_dl1_parameters=False,
write_dl1_images=True,
transform_image=True,
image_dtype="int32",
image_scale=10,
transform_peak_time=True,
peak_time_dtype="int16",
peak_time_scale=100,
write_showers=True,
write_dl2=True,
) as write:
write.log.level = logging.DEBUG
for event in source:
Expand Down Expand Up @@ -211,8 +211,8 @@ def test_dl1writer_no_events(tmpdir: Path):
with DataWriter(
event_source=source,
output_path=output_path,
write_parameters=True,
write_images=True,
write_dl1_parameters=True,
write_dl1_images=True,
) as writer:
writer.log.level = logging.DEBUG
writer.write_simulation_histograms(source)
Expand Down Expand Up @@ -249,8 +249,8 @@ def test_metadata(tmpdir: Path):
with DataWriter(
event_source=source,
output_path=output_path,
write_parameters=True,
write_images=True,
write_dl1_parameters=True,
write_dl1_images=True,
config=config,
):
pass
Expand Down
2 changes: 1 addition & 1 deletion ctapipe/resources/base_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ ImageProcessor:
- ["enough_charge", "lambda im: im.sum() > 50"]

# The ShowerProcessor performs the DL1 to DL2a (reconstructed shower geometry)
# transition. It is run only if the parameter DataWriter.write_showers=True.
# transition. It is run only if the parameter DataWriter.write_dl2=True.
ShowerProcessor:
# choose between HillasReconstructor and HillasIntersection (two
# implementations of the standard stereo line-intersection method)
Expand Down
2 changes: 1 addition & 1 deletion ctapipe/resources/training_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Perform Stage 1 and Stage 2a processing to generate features needed for
# training machine learning algorithms.
#
# Note that here write_images is disabled by default (to avoid very large
# Note that here write_dl1_images is disabled by default (to avoid very large
# files), however for training deep learning algorithms, it should be turned on.
# ======================================================================
#
Expand Down
5 changes: 1 addition & 4 deletions ctapipe/tools/tests/test_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,7 @@ def test_multiple_configs(dl1_image_file):
tool.setup()

# ensure the overwriting works (base config has this option disabled)
assert (
tool.get_current_config()["ProcessorTool"]["DataWriter"]["write_showers"]
is True
)
assert tool.get_current_config()["ProcessorTool"]["DataWriter"]["write_dl2"] is True


def test_stage_1_dl1(tmp_path, dl1_image_file, dl1_parameters_file):
Expand Down
Loading

0 comments on commit 6ade73e

Please sign in to comment.