Skip to content

Commit

Permalink
bugfix according to unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaume.grolleron committed Sep 15, 2023
1 parent f1c3298 commit 71976ef
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
5 changes: 0 additions & 5 deletions src/nectarchain/makers/calibration/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,3 @@ def test_change_pixels_id_attribute(self):

assert np.equal(calibration_maker._pixels_id,new_pixels_id).all()


# Tests that an instance of CalibrationMaker cannot be created with an empty list of pixel ids as input.
def test_create_instance_with_empty_pixel_ids(self):
with pytest.raises(TypeError):
gain_maker = CalibrationMakerforTest([])
4 changes: 2 additions & 2 deletions src/nectarchain/makers/chargesMakers.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def _get_imageExtractor(method,subarray,**kwargs) :
imageExtractor = eval(method)(subarray,**extractor_kwargs)
return imageExtractor

def _make_output_container(self,trigger_type,method : str) :
def _make_output_container(self,trigger_type,method : str,*args,**kwargs) :
output = []
for trigger in trigger_type :
chargesContainer = ChargesContainer(
Expand Down Expand Up @@ -223,7 +223,7 @@ def sort(chargesContainer :ChargesContainer, method = 'event_id') :
if method == 'event_id' :
index = np.argsort(chargesContainer.event_id)
for field in chargesContainer.keys() :
if not(field in ["run_number","npixels","camera","pixels_id","nevents"]) :
if not(field in ["run_number","npixels","camera","pixels_id","nevents","method"]) :
output[field] = chargesContainer[field][index]
else :
raise ArgumentError(f"{method} is not a valid method for sorting")
Expand Down
2 changes: 1 addition & 1 deletion src/nectarchain/makers/waveformsMakers.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def _make_event(self,
self._broken_pixels_hg[f'{name}'].append(broken_pixels_hg.tolist())
self._broken_pixels_lg[f'{name}'].append(broken_pixels_lg.tolist())

def _make_output_container(self,trigger_type) :
def _make_output_container(self,trigger_type,*args,**kwargs) :
output = []
for trigger in trigger_type :
waveformsContainer = WaveformsContainer(
Expand Down

0 comments on commit 71976ef

Please sign in to comment.