Skip to content

Commit e0b0f88

Browse files
minor
1 parent 8dedfed commit e0b0f88

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

hexsample/bin/hxsim.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
from hexsample import HEXSAMPLE_DATA
3131
from hexsample.app import ArgumentParser
3232
from hexsample.readout import HexagonalReadoutMode, readout_chip
33-
from hexsample.fileio import _digioutput_class
33+
from hexsample.fileio import DigiDescriptionSparse, DigiDescriptionRectangular, DigiDescriptionCircular, digioutput_class
3434
from hexsample.hexagon import HexagonalLayout
3535
from hexsample.mc import PhotonList
3636
from hexsample.roi import Padding
@@ -79,8 +79,8 @@ def hxsim(**kwargs):
7979
readout = readout_chip(readout_mode, *args)
8080
logger.info(f'Readout chip: {readout}')
8181
output_file_path = kwargs.get('outfile')
82-
output_file = _digioutput_class(readout_mode)(output_file_path)
83-
output_file.update_header(*args)
82+
output_file = digioutput_class(readout_mode)(output_file_path)
83+
output_file.update_header(**kwargs)
8484
logger.info('Starting the event loop...')
8585
for mc_event in tqdm(photon_list):
8686
x, y = mc_event.propagate(sensor.trans_diffusion_sigma)

hexsample/fileio.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ def flush(self) -> None:
539539
HexagonalReadoutMode.CIRCULAR: DigiOutputFileCircular
540540
}
541541

542-
def _digioutput_class(mode: HexagonalReadoutMode) -> DigiOutputFileSparse | DigiOutputFileRectangular | DigiDescriptionCircular:
542+
def digioutput_class(mode: HexagonalReadoutMode) -> DigiOutputFileSparse | DigiOutputFileRectangular | DigiDescriptionCircular:
543543
"""Return the proper class to be used as DigiOutputFile, depending on the
544544
readout mode of the chip.
545545
"""

tests/test_fileio.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from hexsample.fileio import DigiInputFile, DigiInputFileSparse, DigiInputFileRectangular,\
2626
DigiInputFileCircular, ReconInputFile, ReconOutputFile,FileType,\
2727
DigiOutputFile, DigiOutputFileSparse, DigiOutputFileRectangular, DigiOutputFileCircular,\
28-
peek_file_type, peek_readout_type, open_input_file, _digioutput_class
28+
peek_file_type, peek_readout_type, open_input_file, digioutput_class
2929
from hexsample.mc import MonteCarloEvent
3030
from hexsample.roi import RegionOfInterest, Padding
3131

@@ -61,7 +61,7 @@ def _test_write(file_path, num_events : int = 10):
6161
"""Small test writing a bunch of toy event structures to file.
6262
This test considers a rectangular type of readout.
6363
"""
64-
output_file = _digioutput_class(HexagonalReadoutMode.RECTANGULAR)(file_path)
64+
output_file = digioutput_class(HexagonalReadoutMode.RECTANGULAR)(file_path)
6565
for i in range(num_events):
6666
output_file.add_row(_digi_event_rectangular(i), _mc_event(i))
6767
output_file.close()
@@ -70,7 +70,7 @@ def _test_write_sparse(file_path, num_events : int = 10):
7070
"""Small test writing a bunch of toy event structures to file.
7171
This test considers a sparse type of readout.
7272
"""
73-
output_file = _digioutput_class(HexagonalReadoutMode.SPARSE)(file_path)
73+
output_file = digioutput_class(HexagonalReadoutMode.SPARSE)(file_path)
7474
for i in range(num_events):
7575
output_file.add_row(_digi_event_sparse(i), _mc_event(i))
7676
output_file.close()
@@ -79,7 +79,7 @@ def _test_write_circular(file_path, num_events : int = 10):
7979
"""Small test writing a bunch of toy event structures to file.
8080
This test considers a sparse type of readout.
8181
"""
82-
output_file = _digioutput_class(HexagonalReadoutMode.CIRCULAR)(file_path)
82+
output_file = digioutput_class(HexagonalReadoutMode.CIRCULAR)(file_path)
8383
for i in range(num_events):
8484
output_file.add_row(_digi_event_circular(i), _mc_event(i))
8585
output_file.close()

0 commit comments

Comments
 (0)