From 33bc18f95a93d670c87f4703ca77ef657bfc92f4 Mon Sep 17 00:00:00 2001 From: Andreas Pedersen Date: Thu, 21 Nov 2024 14:05:48 +0100 Subject: [PATCH] minor adjustments --- src/easyreflectometry/summary/summary.py | 2 +- tests/summary/test_summary.py | 6 +++--- tests/test_project.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/easyreflectometry/summary/summary.py b/src/easyreflectometry/summary/summary.py index e36a7724..4ac259e0 100644 --- a/src/easyreflectometry/summary/summary.py +++ b/src/easyreflectometry/summary/summary.py @@ -144,7 +144,7 @@ def _experiments_section(self) -> str: experiment_name = experiment.name num_data_points = len(experiment.x) resolution_function = self._project.models[idx].resolution_function.as_dict()['smearing'] - if resolution_function == 'PercentageFhwm': + if resolution_function == 'PercentageFwhm': precentage = self._project.models[idx].resolution_function.as_dict()['constant'] resolution_function = f'{resolution_function} {precentage}%' range_min = min(experiment.y) diff --git a/tests/summary/test_summary.py b/tests/summary/test_summary.py index 3316befd..ef8ad80e 100644 --- a/tests/summary/test_summary.py +++ b/tests/summary/test_summary.py @@ -6,7 +6,7 @@ import easyreflectometry from easyreflectometry import Project -from easyreflectometry.model.resolution_functions import PercentageFhwm +from easyreflectometry.model.resolution_functions import PercentageFwhm from easyreflectometry.summary import Summary PATH_STATIC = os.path.join(os.path.dirname(easyreflectometry.__file__), '..', '..', 'tests', '_static') @@ -139,14 +139,14 @@ def test_experiments_section_percentage_fhwm(self, project: Project) -> None: # When fpath = os.path.join(PATH_STATIC, 'example.ort') project.load_experiment_for_model_at_index(fpath) - project.models[0].resolution_function = PercentageFhwm(5) + project.models[0].resolution_function = PercentageFwhm(5) summary = Summary(project) # Then html = summary._experiments_section() # Expect - assert 'PercentageFhwm 5%' in html + assert 'PercentageFwhm 5%' in html def test_refinement_section(self, project: Project) -> None: # When diff --git a/tests/test_project.py b/tests/test_project.py index 0d626b1f..66b92041 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -15,7 +15,7 @@ from easyreflectometry.model import LinearSpline from easyreflectometry.model import Model from easyreflectometry.model import ModelCollection -from easyreflectometry.model import PercentageFhwm +from easyreflectometry.model import PercentageFwhm from easyreflectometry.project import Project from easyreflectometry.sample import Material from easyreflectometry.sample import MaterialCollection @@ -562,7 +562,7 @@ def test_load_experiment(self): assert project.experiments[5].name == 'Experiment for Model 5' assert project.experiments[5].model == model_5 assert isinstance(project.models[5].resolution_function, LinearSpline) - assert isinstance(project.models[4].resolution_function, PercentageFhwm) + assert isinstance(project.models[4].resolution_function, PercentageFwhm) def test_experimental_data_at_index(self): # When