From d91c214d9d4faf2043e539030036e391e66b4ff7 Mon Sep 17 00:00:00 2001 From: Jose Borreguero Date: Wed, 30 Oct 2024 15:39:30 -0400 Subject: [PATCH 1/7] Rename 'sample' to 'peak' in reduction code Refactored the code to standardize terminology by replacing 'sample' with 'peak'. This change affects variable names, comments, and documentation strings to improve clarity and consistency in the codebase. Signed-off-by: Jose Borreguero --- src/webmon_app/reporting/reduction/forms.py | 20 +++++----- .../reduction/configuration_ref_m.html | 22 +++++----- .../tests/test_reduction/test_views.py | 8 ++-- .../REF_M/shared/autoreduce/reduce_REF_M.py | 40 +++++++++---------- .../autoreduce/reduce_REF_M.py.template | 36 ++++++++--------- 5 files changed, 63 insertions(+), 63 deletions(-) diff --git a/src/webmon_app/reporting/reduction/forms.py b/src/webmon_app/reporting/reduction/forms.py index 2d24af46..81b47fb5 100644 --- a/src/webmon_app/reporting/reduction/forms.py +++ b/src/webmon_app/reporting/reduction/forms.py @@ -303,17 +303,17 @@ class ReductionConfigurationREFMForm(BaseReductionConfigurationForm): skip_quicknxs = forms.BooleanField(required=False, initial=False) - # Options for all samples in the run + # Options for all peaks in the run plot_in_2D = forms.BooleanField(required=False, initial=False) use_const_q = forms.BooleanField(required=False, initial=False) q_step = forms.FloatField(required=False, initial=-0.02) use_sangle = forms.BooleanField(required=False, initial=True) fit_peak_in_roi = forms.BooleanField(required=False, initial=False) - sample_count = forms.IntegerField( + peak_count = forms.IntegerField( required=True, min_value=1, initial=1, widget=forms.NumberInput(attrs={"size": "2"}) ) - # Options for first sample + # Options for first peak force_peak = forms.BooleanField(required=False, initial=False) peak_min = forms.IntegerField(required=True, initial=160, widget=forms.NumberInput(attrs={"size": "5"})) peak_max = forms.IntegerField(required=True, initial=170, widget=forms.NumberInput(attrs={"size": "5"})) @@ -324,7 +324,7 @@ class ReductionConfigurationREFMForm(BaseReductionConfigurationForm): use_side_bck = forms.BooleanField(required=False, initial=False) bck_width = forms.IntegerField(required=True, initial=10, widget=forms.NumberInput(attrs={"size": "4"})) - # Options for second sample + # Options for second peak force_peak_s2 = forms.BooleanField(required=False, initial=False) peak_min_s2 = forms.IntegerField(required=True, initial=160, widget=forms.NumberInput(attrs={"size": "5"})) peak_max_s2 = forms.IntegerField(required=True, initial=170, widget=forms.NumberInput(attrs={"size": "5"})) @@ -335,7 +335,7 @@ class ReductionConfigurationREFMForm(BaseReductionConfigurationForm): use_side_bck_s2 = forms.BooleanField(required=False, initial=False) bck_width_s2 = forms.IntegerField(required=True, initial=10, widget=forms.NumberInput(attrs={"size": "4"})) - # Options for third sample + # Options for third peak force_peak_s3 = forms.BooleanField(required=False, initial=False) peak_min_s3 = forms.IntegerField(required=True, initial=160, widget=forms.NumberInput(attrs={"size": "5"})) peak_max_s3 = forms.IntegerField(required=True, initial=170, widget=forms.NumberInput(attrs={"size": "5"})) @@ -348,14 +348,14 @@ class ReductionConfigurationREFMForm(BaseReductionConfigurationForm): # List of fields are used in the template _template_list = [ - # Options for all samples in the run + # Options for all peaks in the run "plot_in_2D", "use_const_q", "q_step", "use_sangle", "fit_peak_in_roi", - "sample_count", - # Options for first sample + "peak_count", + # Options for first peak "force_peak", "peak_min", "peak_max", @@ -365,7 +365,7 @@ class ReductionConfigurationREFMForm(BaseReductionConfigurationForm): "bck_max", "use_side_bck", "bck_width", - # Options for second sample + # Options for second peak "force_peak_s2", "peak_min_s2", "peak_max_s2", @@ -375,7 +375,7 @@ class ReductionConfigurationREFMForm(BaseReductionConfigurationForm): "bck_max_s2", "use_side_bck_s2", "bck_width_s2", - # Options for third sample + # Options for third peak "force_peak_s3", "peak_min_s3", "peak_max_s3", diff --git a/src/webmon_app/reporting/templates/reduction/configuration_ref_m.html b/src/webmon_app/reporting/templates/reduction/configuration_ref_m.html index e0fd35df..8c93346a 100644 --- a/src/webmon_app/reporting/templates/reduction/configuration_ref_m.html +++ b/src/webmon_app/reporting/templates/reduction/configuration_ref_m.html @@ -72,7 +72,7 @@ - + @@ -99,7 +99,7 @@ - + - + @@ -137,7 +137,7 @@ - + @@ -199,8 +199,8 @@ - @@ -263,8 +263,8 @@ - diff --git a/src/webmon_app/reporting/tests/test_reduction/test_views.py b/src/webmon_app/reporting/tests/test_reduction/test_views.py index c293089c..a9df9e9b 100644 --- a/src/webmon_app/reporting/tests/test_reduction/test_views.py +++ b/src/webmon_app/reporting/tests/test_reduction/test_views.py @@ -162,7 +162,7 @@ def test_ref_m(self): "q_step": -0.02, "use_sangle": True, "fit_peak_in_roi": False, - "sample_count": 3, + "peak_count": 3, # Options for first sample "force_peak": False, "peak_min": 160, @@ -173,7 +173,7 @@ def test_ref_m(self): "bck_max": 100, "use_side_bck": False, "bck_width": 10, - # Options for second sample + # Options for second peak "force_peak_s2": True, "peak_min_s2": 170, "peak_max_s2": 180, @@ -183,7 +183,7 @@ def test_ref_m(self): "bck_max_s2": 101, "use_side_bck_s2": True, "bck_width_s2": 11, - # Options for third sample + # Options for third peak "force_peak_s3": False, "peak_min_s3": 180, "peak_max_s3": 190, @@ -197,7 +197,7 @@ def test_ref_m(self): ) self.assertEqual(response.status_code, 200) self.assertTemplateUsed(response, "reduction/configuration_ref_m.html") - # open('/tmp/junk.html', 'wb').write(response.content) # inspect with the browser + open("/tmp/junk.html", "wb").write(response.content) # inspect with the browser def test_configuration_change(self): # no data diff --git a/tests/data/REF_M/shared/autoreduce/reduce_REF_M.py b/tests/data/REF_M/shared/autoreduce/reduce_REF_M.py index 1710e96d..baf835bb 100755 --- a/tests/data/REF_M/shared/autoreduce/reduce_REF_M.py +++ b/tests/data/REF_M/shared/autoreduce/reduce_REF_M.py @@ -46,7 +46,7 @@ def _as_bool(value): def reduction_user_options(): r"""Collects all values defined by the user in https://monitor.sns.gov/reduction/ref_m/""" - # Options common to all samples: + # Options common to all peaks: kwargs_common = dict( plot_2d=_as_bool(True), const_q_binning=_as_bool(False), @@ -56,8 +56,8 @@ def reduction_user_options(): publish=False, # uploading to livedata server to be done later by `upload_html_report()` ) - # Options for Sample 1 - kwargs_sample_1 = dict( + # Options for Peak 1 + kwargs_peak_1 = dict( use_roi=True, force_peak_roi=_as_bool(True), peak_roi=[int(149), int(159)], @@ -68,8 +68,8 @@ def reduction_user_options(): bck_offset=int(), ) - # Options for Sample 2 - kwargs_sample_2 = dict( + # Options for Peak 2 + kwargs_peak_2 = dict( use_roi=True, force_peak_roi=_as_bool(True), peak_roi=[int(160), int(180)], @@ -80,8 +80,8 @@ def reduction_user_options(): bck_offset=int(), ) - # Options for Sample 3 - kwargs_sample_3 = dict( + # Options for Peak 3 + kwargs_peak_3 = dict( use_roi=True, force_peak_roi=_as_bool(True), peak_roi=[int(160), int(180)], @@ -92,28 +92,28 @@ def reduction_user_options(): bck_offset=int(), ) - # Do we have more than one sample in this run? - sample_count = int(1) - ReductionOptions = namedtuple("ReductionOptions", "common, sample_count, sample1, sample2, sample3") - return ReductionOptions(kwargs_common, sample_count, kwargs_sample_1, kwargs_sample_2, kwargs_sample_3) + # Do we have more than one peak in this run? + peak_count = int(1) + ReductionOptions = namedtuple("ReductionOptions", "common, peak_count, peak1, peak2, peak3") + return ReductionOptions(kwargs_common, peak_count, kwargs_peak_1, kwargs_peak_2, kwargs_peak_3) def reduce_events_file(event_file_path, outdir): event_file = os.path.split(event_file_path)[-1] # file name - reports = list() # autoreduction reports for each sample in the run, in HTML format + reports = list() # autoreduction reports for each peak in the run, in HTML format opts = reduction_user_options() - assert opts.sample_count <= 3, "Sample count must be <= 3" - kwargs_samples = [opts.sample1, opts.sample2, opts.sample3] - sample_numbers = ( + assert opts.peak_count <= 3, "Peak count must be <= 3" + kwargs_peaks = [opts.peak1, opts.peak2, opts.peak3] + peak_numbers = ( [ None, ] - if opts.sample_count == 1 - else range(1, opts.sample_count + 1) + if opts.peak_count == 1 + else range(1, opts.peak_count + 1) ) # numbers start at 1, not 0 - for i, sample_number in enumerate(sample_numbers): - d = dict(data_run=event_file, output_dir=outdir, sample_number=sample_number) - kwargs = {**d, **opts.common, **kwargs_samples[i]} # merge all partial dicts + for i, peak_number in enumerate(peak_numbers): + d = dict(data_run=event_file, output_dir=outdir, peak_number=peak_number) + kwargs = {**d, **opts.common, **kwargs_peaks[i]} # merge all partial dicts reports.append(ReductionProcess(**kwargs).reduce()) return reports diff --git a/tests/data/REF_M/shared/autoreduce/reduce_REF_M.py.template b/tests/data/REF_M/shared/autoreduce/reduce_REF_M.py.template index 126913bb..b80762d5 100755 --- a/tests/data/REF_M/shared/autoreduce/reduce_REF_M.py.template +++ b/tests/data/REF_M/shared/autoreduce/reduce_REF_M.py.template @@ -45,7 +45,7 @@ def _as_bool(value): def reduction_user_options(): r"""Collects all values defined by the user in https://monitor.sns.gov/reduction/ref_m/""" - # Options common to all samples: + # Options common to all peaks: kwargs_common = dict( plot_2d=_as_bool(${plot_in_2D}), const_q_binning=_as_bool(${use_const_q}), @@ -55,8 +55,8 @@ def reduction_user_options(): publish = False # uploading to livedata server to be done later by `upload_html_report()` ) - # Options for Sample 1 - kwargs_sample_1 = dict( + # Options for Peak 1 + kwargs_peak_1 = dict( use_roi=True, force_peak_roi=_as_bool(${force_peak}), peak_roi=[int(${peak_min}), int(${peak_max})], @@ -67,8 +67,8 @@ def reduction_user_options(): bck_offset=int(${bck_width}) ) - # Options for Sample 2 - kwargs_sample_2 = dict( + # Options for Peak 2 + kwargs_peak_2 = dict( use_roi=True, force_peak_roi=_as_bool(${force_peak_s2}), peak_roi=[int(${peak_min_s2}), int(${peak_max_s2})], @@ -79,8 +79,8 @@ def reduction_user_options(): bck_offset=int(${bck_width_s2}) ) - # Options for Sample 3 - kwargs_sample_3 = dict( + # Options for Peak 3 + kwargs_peak_3 = dict( use_roi=True, force_peak_roi=_as_bool(${force_peak_s3}), peak_roi=[int(${peak_min_s3}), int(${peak_max_s3})], @@ -91,22 +91,22 @@ def reduction_user_options(): bck_offset=int(${bck_width_s3}), ) - # Do we have more than one sample in this run? - sample_count = int(${sample_count}) - ReductionOptions = namedtuple('ReductionOptions', 'common, sample_count, sample1, sample2, sample3') - return ReductionOptions(kwargs_common, sample_count, kwargs_sample_1, kwargs_sample_2, kwargs_sample_3) + # Do we have more than one peak in this run? + peak_count = int(${peak_count}) + ReductionOptions = namedtuple('ReductionOptions', 'common, peak_count, peak1, peak2, peak3') + return ReductionOptions(kwargs_common, peak_count, kwargs_peak_1, kwargs_peak_2, kwargs_peak_3) def reduce_events_file(event_file_path, outdir): event_file = os.path.split(event_file_path)[-1] # file name - reports = list() # autoreduction reports for each sample in the run, in HTML format + reports = list() # autoreduction reports for each peak in the run, in HTML format opts = reduction_user_options() - assert opts.sample_count <= 3, "Sample count must be <= 3" - kwargs_samples = [opts.sample1, opts.sample2, opts.sample3] - sample_numbers = [None, ] if opts.sample_count == 1 else range(1, opts.sample_count + 1) # numbers start at 1, not 0 - for i, sample_number in enumerate(sample_numbers): - d = dict(data_run=event_file, output_dir=outdir, sample_number=sample_number) - kwargs = {**d, **opts.common, **kwargs_samples[i]} # merge all partial dicts + assert opts.peak_count <= 3, "Peak count must be <= 3" + kwargs_peaks = [opts.peak1, opts.peak2, opts.peak3] + peak_numbers = [None, ] if opts.peak_count == 1 else range(1, opts.peak_count + 1) # numbers start at 1, not 0 + for i, peak_number in enumerate(peak_numbers): + d = dict(data_run=event_file, output_dir=outdir, peak_number=peak_number) + kwargs = {**d, **opts.common, **kwargs_peaks[i]} # merge all partial dicts reports.append(ReductionProcess(**kwargs).reduce()) return reports From 63ccd92523e9af13786281da04ed95bfd6f39ff9 Mon Sep 17 00:00:00 2001 From: Jose Borreguero Date: Wed, 30 Oct 2024 15:48:05 -0400 Subject: [PATCH 2/7] Preserve the instrument name (REF_M) in related classes Updated form name from ReductionConfigurationREFMForm to ReductionConfigurationREF_MForm across views and tests to maintain consistency and clarity in naming conventions. Also changed references from "sample" to "peak" for better accuracy in context. Signed-off-by: Jose Borreguero --- src/webmon_app/reporting/reduction/forms.py | 2 +- src/webmon_app/reporting/reduction/views.py | 4 +-- .../tests/test_reduction/test_forms.py | 30 +++++++++---------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/webmon_app/reporting/reduction/forms.py b/src/webmon_app/reporting/reduction/forms.py index 81b47fb5..2ac5540e 100644 --- a/src/webmon_app/reporting/reduction/forms.py +++ b/src/webmon_app/reporting/reduction/forms.py @@ -296,7 +296,7 @@ class ReductionConfigurationCorelliForm(BaseReductionConfigurationForm): ] -class ReductionConfigurationREFMForm(BaseReductionConfigurationForm): +class ReductionConfigurationREF_MForm(BaseReductionConfigurationForm): """ Generic form for REF_M reduction instruments """ diff --git a/src/webmon_app/reporting/reduction/views.py b/src/webmon_app/reporting/reduction/views.py index e85ca6a8..40688b20 100644 --- a/src/webmon_app/reporting/reduction/views.py +++ b/src/webmon_app/reporting/reduction/views.py @@ -111,7 +111,7 @@ def configuration_ref_m(request, instrument): view_util.reset_to_default(instrument_id) return redirect(reverse("reduction:configuration", args=[instrument])) - options_form = forms.ReductionConfigurationREFMForm(request.POST) + options_form = forms.ReductionConfigurationREF_MForm(request.POST) options_form.set_instrument(instrument.lower()) if options_form.is_valid(): options_form.to_db(instrument_id, request.user) @@ -129,7 +129,7 @@ def configuration_ref_m(request, instrument): props_list = ReductionProperty.objects.filter(instrument=instrument_id) for item in props_list: params_dict[str(item.key)] = str(item.value) - options_form = forms.ReductionConfigurationREFMForm(initial=params_dict) + options_form = forms.ReductionConfigurationREF_MForm(initial=params_dict) options_form.set_instrument(instrument.lower()) last_action = datetime.datetime.now().isoformat() diff --git a/src/webmon_app/reporting/tests/test_reduction/test_forms.py b/src/webmon_app/reporting/tests/test_reduction/test_forms.py index e62ab748..793f9cab 100644 --- a/src/webmon_app/reporting/tests/test_reduction/test_forms.py +++ b/src/webmon_app/reporting/tests/test_reduction/test_forms.py @@ -4,17 +4,17 @@ from reporting.reduction.models import ReductionProperty, Choice -class TestREFMForm(TestCase): +class TestREF_MForm(TestCase): default_test_fields = { "skip_quicknxs": False, - # Options for all samples in the run + # Options for all peaks in the run "plot_in_2D": False, "use_const_q": False, "q_step": -0.02, "use_sangle": True, "fit_peak_in_roi": False, - "sample_count": 1, - # Options for first sample + "peak_count": 1, + # Options for first peak "force_peak": False, "peak_min": 160, "peak_max": 170, @@ -24,7 +24,7 @@ class TestREFMForm(TestCase): "bck_max": 100, "use_side_bck": False, "bck_width": 10, - # Options for second sample + # Options for second peak "force_peak_s2": False, "peak_min_s2": 160, "peak_max_s2": 170, @@ -34,7 +34,7 @@ class TestREFMForm(TestCase): "bck_max_s2": 100, "use_side_bck_s2": False, "bck_width_s2": 10, - # Options for third sample + # Options for third peak "force_peak_s3": False, "peak_min_s3": 160, "peak_max_s3": 170, @@ -47,7 +47,7 @@ class TestREFMForm(TestCase): } def test_empty_form(self): - form = forms.ReductionConfigurationREFMForm({}) + form = forms.ReductionConfigurationREF_MForm({}) self.assertFalse( form.is_valid() ) # empty instantiated form invalid because fields like `peak_min` are required @@ -58,14 +58,14 @@ def test_empty_form(self): self.assertEqual( form.to_template(), { - # Options for all samples in the run + # Options for all peaks in the run "plot_in_2D": "False", "use_const_q": "False", "q_step": "None", "use_sangle": "False", "fit_peak_in_roi": "False", - "sample_count": "", - # Options for first sample + "peak_count": "", + # Options for first peak "force_peak": "False", "peak_min": "", "peak_max": "", @@ -75,7 +75,7 @@ def test_empty_form(self): "bck_max": "", "use_side_bck": "False", "bck_width": "", - # Options for second sample + # Options for second peak "force_peak_s2": "False", "peak_min_s2": "", "peak_max_s2": "", @@ -85,7 +85,7 @@ def test_empty_form(self): "bck_max_s2": "", "use_side_bck_s2": "False", "bck_width_s2": "", - # Options for third sample + # Options for third peak "force_peak_s3": "False", "peak_min_s3": "", "peak_max_s3": "", @@ -99,7 +99,7 @@ def test_empty_form(self): ) def test_form_filled(self): - form = forms.ReductionConfigurationREFMForm(self.default_test_fields) + form = forms.ReductionConfigurationREF_MForm(self.default_test_fields) form.full_clean() # Clean all of form.data and populate form._errors and form.cleaned_data. for key, val in self.default_test_fields.items(): self.assertEqual(form.cleaned_data.get(key), val) @@ -115,7 +115,7 @@ def test_form_filled(self): def test_to_db(self): test_fields = {"bck_width_s3": 11} - form = forms.ReductionConfigurationREFMForm(test_fields) + form = forms.ReductionConfigurationREF_MForm(test_fields) self.assertFalse(form.is_valid()) # invalid because fields like `peak_min` are required instrument = Instrument(name="inst") @@ -134,7 +134,7 @@ def test_to_db(self): def test_to_db_bad(self): # no clean data - form = forms.ReductionConfigurationREFMForm({}) + form = forms.ReductionConfigurationREF_MForm({}) form.to_db(0) self.assertEqual(len(ReductionProperty.objects.filter()), 0) From 4ce3f796b83b17d34f6e2f35a886392902769ebf Mon Sep 17 00:00:00 2001 From: Jose Borreguero Date: Wed, 30 Oct 2024 15:57:10 -0400 Subject: [PATCH 3/7] Update build instructions Renamed the target for creating the conda environment to "create/conda" to align with naming conventions. Also provided an alternative command for creating the environment using mamba. Signed-off-by: Jose Borreguero --- docs/developer/instruction/build.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developer/instruction/build.rst b/docs/developer/instruction/build.rst index 6c11f524..17f1d0ef 100644 --- a/docs/developer/instruction/build.rst +++ b/docs/developer/instruction/build.rst @@ -139,7 +139,7 @@ After setting the environment variables, run the following ``make`` targets in t .. code-block:: shell - make conda/create + make create/conda # or "make create/mamba" for mamba, to create the webmon conda environment make all # create: python packages for dasmon, webmon, and workflow; fake SNS data; self-signed SSL certificates make localdev/up # build all the services From cff78c4429e8ad2f8e1c518767e3bcb7741b8cab Mon Sep 17 00:00:00 2001 From: Jose Borreguero Date: Wed, 30 Oct 2024 16:00:01 -0400 Subject: [PATCH 4/7] Update build instructions to include 'make all' command Enhanced the documentation to give clearer steps on rebuilding wheels. Added instructions to run 'make all' after cleaning existing wheels to ensure complete rebuild. Signed-off-by: Jose Borreguero --- docs/developer/instruction/build.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developer/instruction/build.rst b/docs/developer/instruction/build.rst index 17f1d0ef..773087a3 100644 --- a/docs/developer/instruction/build.rst +++ b/docs/developer/instruction/build.rst @@ -176,7 +176,7 @@ source code requires rebuilding the python wheel(s). For instance, if the source code of ``dasmon`` is changed, run at this point ``make wheel/dasmon`` to rebuild the ``dasmon`` wheel. -If necessary, delete all existing wheels with ``make wheel/clean`` +If necessary, delete all existing wheels with ``make wheel/clean``, then run ``make all`` to recreate them. Rebuild the services ~~~~~~~~~~~~~~~~~~~~ From a3da5d3d4da7479b0b92c394b9e94b28123a46b2 Mon Sep 17 00:00:00 2001 From: Jose Borreguero Date: Wed, 30 Oct 2024 16:02:25 -0400 Subject: [PATCH 5/7] Refactor test: Comment out browser inspection code Commented out the line that writes response content to a file for browser inspection. This change ensures that the code is only executed when debugging, preventing accidental file creation during regular test runs. Signed-off-by: Jose Borreguero --- src/webmon_app/reporting/tests/test_reduction/test_views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/webmon_app/reporting/tests/test_reduction/test_views.py b/src/webmon_app/reporting/tests/test_reduction/test_views.py index a9df9e9b..a4c4d940 100644 --- a/src/webmon_app/reporting/tests/test_reduction/test_views.py +++ b/src/webmon_app/reporting/tests/test_reduction/test_views.py @@ -197,7 +197,8 @@ def test_ref_m(self): ) self.assertEqual(response.status_code, 200) self.assertTemplateUsed(response, "reduction/configuration_ref_m.html") - open("/tmp/junk.html", "wb").write(response.content) # inspect with the browser + # uncomment the following line only when debugging, in order to inspect the response content + # open("/tmp/junk.html", "wb").write(response.content) # inspect with the browser def test_configuration_change(self): # no data From 324f6e412ebc037c84a4406d75c10aa86b4ad012 Mon Sep 17 00:00:00 2001 From: Jose Borreguero Date: Wed, 30 Oct 2024 16:04:00 -0400 Subject: [PATCH 6/7] Improve debug comment for inspecting response content Updated the comment to provide clearer instructions on how to inspect the response content using a browser. This change enhances developer clarity when debugging response outputs. Signed-off-by: Jose Borreguero --- src/webmon_app/reporting/tests/test_reduction/test_views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webmon_app/reporting/tests/test_reduction/test_views.py b/src/webmon_app/reporting/tests/test_reduction/test_views.py index a4c4d940..b442cfaa 100644 --- a/src/webmon_app/reporting/tests/test_reduction/test_views.py +++ b/src/webmon_app/reporting/tests/test_reduction/test_views.py @@ -198,7 +198,7 @@ def test_ref_m(self): self.assertEqual(response.status_code, 200) self.assertTemplateUsed(response, "reduction/configuration_ref_m.html") # uncomment the following line only when debugging, in order to inspect the response content - # open("/tmp/junk.html", "wb").write(response.content) # inspect with the browser + # open("/tmp/junk.html", "wb").write(response.content) # take a look to file:///tmp/junk.html with the browser def test_configuration_change(self): # no data From bc10712e652285acd83a4ce85d832c4d1c33053e Mon Sep 17 00:00:00 2001 From: Jose Borreguero Date: Wed, 30 Oct 2024 19:57:50 -0400 Subject: [PATCH 7/7] Add labels to form elements for accessibility Replaced tags with - Pixels on each side {{ options_form.bck_width }} + {{ options_form.bck_width }} @@ -211,9 +211,9 @@ Force peak ROI - Pixelmin + {{ options_form.peak_min_s2 }} - Pixelmax + {{ options_form.peak_max_s2 }} @@ -237,9 +237,9 @@ Force background ROI - Bckmin + {{ options_form.bck_min_s2 }} - Bckmax + {{ options_form.bck_max_s2 }} @@ -255,7 +255,7 @@ if you want to use the region on each side of the peak to estimate your background."> Use side background - Pixels on each side {{ options_form.bck_width_s2 }} + {{ options_form.bck_width_s2 }} @@ -276,9 +276,9 @@ Force peak ROI - Pixelmin + {{ options_form.peak_min_s3 }} - Pixelmax + {{ options_form.peak_max_s3 }} @@ -302,9 +302,9 @@ Force background ROI - Bckmin + {{ options_form.bck_min_s3 }} - Bckmax + {{ options_form.bck_max_s3 }} @@ -320,7 +320,7 @@ if you want to use the region on each side of the peak to estimate your background."> Use side background - Pixels on each side {{ options_form.bck_width_s3 }} + {{ options_form.bck_width_s3 }}
Options for all samplesOptions for all peaks
{{ options_form.use_sangle }} @@ -112,7 +112,7 @@
{{ options_form.fit_peak_in_roi }} -
- Sample count - {{ options_form.sample_count }} + Peak count + {{ options_form.peak_count }}

Sample # 1Peak # 1

- Sample # 2 + + Peak # 2

- Sample # 3 + + Peak # 3