Skip to content

Commit

Permalink
minor adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
andped10 committed Nov 21, 2024
1 parent bf16e76 commit 33bc18f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/easyreflectometry/summary/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions tests/summary/test_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 33bc18f

Please sign in to comment.