DMSC Integration Testing

Last updated: September 25, 2026 08:04:50

Test: scipp-analysis|estia|analyze_reduced_data|fit_model_success

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64        <no unit>  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:537: in fit
    _emit_array_prep_warnings(stats, y_vals, f'reflectivity {i}')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stats = {'valid': 178, 'mighell_substituted': 11, 'masked': 0, 'transformed_all_points': False}
y_vals = array([9.27487850e-01, 9.52332638e-01, 9.23844445e-01, 9.27607868e-01,
       9.45260107e-01, 9.48504316e-01, 9.374221...000e+00, 0.00000000e+00,
       1.73206521e-03, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
       0.00000000e+00])
label = 'reflectivity 0', action = 'fitting', extra = ''

    def _emit_array_prep_warnings(stats: dict, y_vals: np.ndarray, label: str, *, action: str = 'fitting', extra: str = '') -> None:
        """Warn about zero-variance handling applied by :func:`_prepare_fit_arrays`.
    
        Parameters
        ----------
        stats : dict
            The ``stats`` dict returned by :func:`_prepare_fit_arrays`.
        y_vals : np.ndarray
            The original (pre-transform) y values, used for the "all points" count.
        label : str
            Identifies what was fitted/sampled, e.g. ``'reflectivity 1'`` or
            ``'channel pp'``.
        action : str, optional
            Verb describing the operation, e.g. ``'fitting'`` or ``'sampling'``. By default, 'fitting'.
        extra : str, optional
            Extra sentence(s) appended to the Mighell-related warnings (e.g. a
            likelihood-validity caveat for MCMC). By default, ''.
        """
        if stats['masked'] > 0:
            warnings.warn(
                f'Masked {stats["masked"]} data point(s) in {label} due to zero variance during {action}.',
                UserWarning,
            )
        if stats.get('transformed_all_points'):
            warnings.warn(
                f'Applied Mighell transform to all {len(y_vals)} point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
        elif stats['mighell_substituted'] > 0:
>           warnings.warn(
                f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                f'zero-variance point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
E           UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64        <no unit>  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:537: in fit
    _emit_array_prep_warnings(stats, y_vals, f'reflectivity {i}')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stats = {'valid': 178, 'mighell_substituted': 11, 'masked': 0, 'transformed_all_points': False}
y_vals = array([9.27487850e-01, 9.52332638e-01, 9.23844445e-01, 9.27607868e-01,
       9.45260107e-01, 9.48504316e-01, 9.374221...000e+00, 0.00000000e+00,
       1.73206521e-03, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
       0.00000000e+00])
label = 'reflectivity 0', action = 'fitting', extra = ''

    def _emit_array_prep_warnings(stats: dict, y_vals: np.ndarray, label: str, *, action: str = 'fitting', extra: str = '') -> None:
        """Warn about zero-variance handling applied by :func:`_prepare_fit_arrays`.
    
        Parameters
        ----------
        stats : dict
            The ``stats`` dict returned by :func:`_prepare_fit_arrays`.
        y_vals : np.ndarray
            The original (pre-transform) y values, used for the "all points" count.
        label : str
            Identifies what was fitted/sampled, e.g. ``'reflectivity 1'`` or
            ``'channel pp'``.
        action : str, optional
            Verb describing the operation, e.g. ``'fitting'`` or ``'sampling'``. By default, 'fitting'.
        extra : str, optional
            Extra sentence(s) appended to the Mighell-related warnings (e.g. a
            likelihood-validity caveat for MCMC). By default, ''.
        """
        if stats['masked'] > 0:
            warnings.warn(
                f'Masked {stats["masked"]} data point(s) in {label} due to zero variance during {action}.',
                UserWarning,
            )
        if stats.get('transformed_all_points'):
            warnings.warn(
                f'Applied Mighell transform to all {len(y_vals)} point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
        elif stats['mighell_substituted'] > 0:
>           warnings.warn(
                f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                f'zero-variance point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
E           UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64        <no unit>  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:537: in fit
    _emit_array_prep_warnings(stats, y_vals, f'reflectivity {i}')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stats = {'valid': 178, 'mighell_substituted': 11, 'masked': 0, 'transformed_all_points': False}
y_vals = array([9.27487850e-01, 9.52332638e-01, 9.23844445e-01, 9.27607868e-01,
       9.45260107e-01, 9.48504316e-01, 9.374221...000e+00, 0.00000000e+00,
       1.73206521e-03, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
       0.00000000e+00])
label = 'reflectivity 0', action = 'fitting', extra = ''

    def _emit_array_prep_warnings(stats: dict, y_vals: np.ndarray, label: str, *, action: str = 'fitting', extra: str = '') -> None:
        """Warn about zero-variance handling applied by :func:`_prepare_fit_arrays`.
    
        Parameters
        ----------
        stats : dict
            The ``stats`` dict returned by :func:`_prepare_fit_arrays`.
        y_vals : np.ndarray
            The original (pre-transform) y values, used for the "all points" count.
        label : str
            Identifies what was fitted/sampled, e.g. ``'reflectivity 1'`` or
            ``'channel pp'``.
        action : str, optional
            Verb describing the operation, e.g. ``'fitting'`` or ``'sampling'``. By default, 'fitting'.
        extra : str, optional
            Extra sentence(s) appended to the Mighell-related warnings (e.g. a
            likelihood-validity caveat for MCMC). By default, ''.
        """
        if stats['masked'] > 0:
            warnings.warn(
                f'Masked {stats["masked"]} data point(s) in {label} due to zero variance during {action}.',
                UserWarning,
            )
        if stats.get('transformed_all_points'):
            warnings.warn(
                f'Applied Mighell transform to all {len(y_vals)} point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
        elif stats['mighell_substituted'] > 0:
>           warnings.warn(
                f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                f'zero-variance point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
E           UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64        <no unit>  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:537: in fit
    _emit_array_prep_warnings(stats, y_vals, f'reflectivity {i}')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stats = {'valid': 178, 'mighell_substituted': 11, 'masked': 0, 'transformed_all_points': False}
y_vals = array([9.27487850e-01, 9.52332638e-01, 9.23844445e-01, 9.27607868e-01,
       9.45260107e-01, 9.48504316e-01, 9.374221...000e+00, 0.00000000e+00,
       1.73206521e-03, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
       0.00000000e+00])
label = 'reflectivity 0', action = 'fitting', extra = ''

    def _emit_array_prep_warnings(stats: dict, y_vals: np.ndarray, label: str, *, action: str = 'fitting', extra: str = '') -> None:
        """Warn about zero-variance handling applied by :func:`_prepare_fit_arrays`.
    
        Parameters
        ----------
        stats : dict
            The ``stats`` dict returned by :func:`_prepare_fit_arrays`.
        y_vals : np.ndarray
            The original (pre-transform) y values, used for the "all points" count.
        label : str
            Identifies what was fitted/sampled, e.g. ``'reflectivity 1'`` or
            ``'channel pp'``.
        action : str, optional
            Verb describing the operation, e.g. ``'fitting'`` or ``'sampling'``. By default, 'fitting'.
        extra : str, optional
            Extra sentence(s) appended to the Mighell-related warnings (e.g. a
            likelihood-validity caveat for MCMC). By default, ''.
        """
        if stats['masked'] > 0:
            warnings.warn(
                f'Masked {stats["masked"]} data point(s) in {label} due to zero variance during {action}.',
                UserWarning,
            )
        if stats.get('transformed_all_points'):
            warnings.warn(
                f'Applied Mighell transform to all {len(y_vals)} point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
        elif stats['mighell_substituted'] > 0:
>           warnings.warn(
                f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                f'zero-variance point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
E           UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64        <no unit>  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:537: in fit
    _emit_array_prep_warnings(stats, y_vals, f'reflectivity {i}')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stats = {'valid': 178, 'mighell_substituted': 11, 'masked': 0, 'transformed_all_points': False}
y_vals = array([9.27487850e-01, 9.52332638e-01, 9.23844445e-01, 9.27607868e-01,
       9.45260107e-01, 9.48504316e-01, 9.374221...000e+00, 0.00000000e+00,
       1.73206521e-03, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
       0.00000000e+00])
label = 'reflectivity 0', action = 'fitting', extra = ''

    def _emit_array_prep_warnings(stats: dict, y_vals: np.ndarray, label: str, *, action: str = 'fitting', extra: str = '') -> None:
        """Warn about zero-variance handling applied by :func:`_prepare_fit_arrays`.
    
        Parameters
        ----------
        stats : dict
            The ``stats`` dict returned by :func:`_prepare_fit_arrays`.
        y_vals : np.ndarray
            The original (pre-transform) y values, used for the "all points" count.
        label : str
            Identifies what was fitted/sampled, e.g. ``'reflectivity 1'`` or
            ``'channel pp'``.
        action : str, optional
            Verb describing the operation, e.g. ``'fitting'`` or ``'sampling'``. By default, 'fitting'.
        extra : str, optional
            Extra sentence(s) appended to the Mighell-related warnings (e.g. a
            likelihood-validity caveat for MCMC). By default, ''.
        """
        if stats['masked'] > 0:
            warnings.warn(
                f'Masked {stats["masked"]} data point(s) in {label} due to zero variance during {action}.',
                UserWarning,
            )
        if stats.get('transformed_all_points'):
            warnings.warn(
                f'Applied Mighell transform to all {len(y_vals)} point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
        elif stats['mighell_substituted'] > 0:
>           warnings.warn(
                f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                f'zero-variance point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
E           UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64        <no unit>  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:537: in fit
    _emit_array_prep_warnings(stats, y_vals, f'reflectivity {i}')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stats = {'valid': 178, 'mighell_substituted': 11, 'masked': 0, 'transformed_all_points': False}
y_vals = array([9.27487850e-01, 9.52332638e-01, 9.23844445e-01, 9.27607868e-01,
       9.45260107e-01, 9.48504316e-01, 9.374221...000e+00, 0.00000000e+00,
       1.73206521e-03, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
       0.00000000e+00])
label = 'reflectivity 0', action = 'fitting', extra = ''

    def _emit_array_prep_warnings(stats: dict, y_vals: np.ndarray, label: str, *, action: str = 'fitting', extra: str = '') -> None:
        """Warn about zero-variance handling applied by :func:`_prepare_fit_arrays`.
    
        Parameters
        ----------
        stats : dict
            The ``stats`` dict returned by :func:`_prepare_fit_arrays`.
        y_vals : np.ndarray
            The original (pre-transform) y values, used for the "all points" count.
        label : str
            Identifies what was fitted/sampled, e.g. ``'reflectivity 1'`` or
            ``'channel pp'``.
        action : str, optional
            Verb describing the operation, e.g. ``'fitting'`` or ``'sampling'``. By default, 'fitting'.
        extra : str, optional
            Extra sentence(s) appended to the Mighell-related warnings (e.g. a
            likelihood-validity caveat for MCMC). By default, ''.
        """
        if stats['masked'] > 0:
            warnings.warn(
                f'Masked {stats["masked"]} data point(s) in {label} due to zero variance during {action}.',
                UserWarning,
            )
        if stats.get('transformed_all_points'):
            warnings.warn(
                f'Applied Mighell transform to all {len(y_vals)} point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
        elif stats['mighell_substituted'] > 0:
>           warnings.warn(
                f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                f'zero-variance point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
E           UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64        <no unit>  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:537: in fit
    _emit_array_prep_warnings(stats, y_vals, f'reflectivity {i}')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stats = {'valid': 178, 'mighell_substituted': 11, 'masked': 0, 'transformed_all_points': False}
y_vals = array([9.27487850e-01, 9.52332638e-01, 9.23844445e-01, 9.27607868e-01,
       9.45260107e-01, 9.48504316e-01, 9.374221...000e+00, 0.00000000e+00,
       1.73206521e-03, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
       0.00000000e+00])
label = 'reflectivity 0', action = 'fitting', extra = ''

    def _emit_array_prep_warnings(stats: dict, y_vals: np.ndarray, label: str, *, action: str = 'fitting', extra: str = '') -> None:
        """Warn about zero-variance handling applied by :func:`_prepare_fit_arrays`.
    
        Parameters
        ----------
        stats : dict
            The ``stats`` dict returned by :func:`_prepare_fit_arrays`.
        y_vals : np.ndarray
            The original (pre-transform) y values, used for the "all points" count.
        label : str
            Identifies what was fitted/sampled, e.g. ``'reflectivity 1'`` or
            ``'channel pp'``.
        action : str, optional
            Verb describing the operation, e.g. ``'fitting'`` or ``'sampling'``. By default, 'fitting'.
        extra : str, optional
            Extra sentence(s) appended to the Mighell-related warnings (e.g. a
            likelihood-validity caveat for MCMC). By default, ''.
        """
        if stats['masked'] > 0:
            warnings.warn(
                f'Masked {stats["masked"]} data point(s) in {label} due to zero variance during {action}.',
                UserWarning,
            )
        if stats.get('transformed_all_points'):
            warnings.warn(
                f'Applied Mighell transform to all {len(y_vals)} point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
        elif stats['mighell_substituted'] > 0:
>           warnings.warn(
                f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                f'zero-variance point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
E           UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64        <no unit>  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:537: in fit
    _emit_array_prep_warnings(stats, y_vals, f'reflectivity {i}')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stats = {'valid': 178, 'mighell_substituted': 11, 'masked': 0, 'transformed_all_points': False}
y_vals = array([9.27487850e-01, 9.52332638e-01, 9.23844445e-01, 9.27607868e-01,
       9.45260107e-01, 9.48504316e-01, 9.374221...000e+00, 0.00000000e+00,
       1.73206521e-03, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
       0.00000000e+00])
label = 'reflectivity 0', action = 'fitting', extra = ''

    def _emit_array_prep_warnings(stats: dict, y_vals: np.ndarray, label: str, *, action: str = 'fitting', extra: str = '') -> None:
        """Warn about zero-variance handling applied by :func:`_prepare_fit_arrays`.
    
        Parameters
        ----------
        stats : dict
            The ``stats`` dict returned by :func:`_prepare_fit_arrays`.
        y_vals : np.ndarray
            The original (pre-transform) y values, used for the "all points" count.
        label : str
            Identifies what was fitted/sampled, e.g. ``'reflectivity 1'`` or
            ``'channel pp'``.
        action : str, optional
            Verb describing the operation, e.g. ``'fitting'`` or ``'sampling'``. By default, 'fitting'.
        extra : str, optional
            Extra sentence(s) appended to the Mighell-related warnings (e.g. a
            likelihood-validity caveat for MCMC). By default, ''.
        """
        if stats['masked'] > 0:
            warnings.warn(
                f'Masked {stats["masked"]} data point(s) in {label} due to zero variance during {action}.',
                UserWarning,
            )
        if stats.get('transformed_all_points'):
            warnings.warn(
                f'Applied Mighell transform to all {len(y_vals)} point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
        elif stats['mighell_substituted'] > 0:
>           warnings.warn(
                f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                f'zero-variance point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
E           UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64        <no unit>  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:537: in fit
    _emit_array_prep_warnings(stats, y_vals, f'reflectivity {i}')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stats = {'valid': 178, 'mighell_substituted': 11, 'masked': 0, 'transformed_all_points': False}
y_vals = array([9.27487850e-01, 9.52332638e-01, 9.23844445e-01, 9.27607868e-01,
       9.45260107e-01, 9.48504316e-01, 9.374221...000e+00, 0.00000000e+00,
       1.73206521e-03, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
       0.00000000e+00])
label = 'reflectivity 0', action = 'fitting', extra = ''

    def _emit_array_prep_warnings(stats: dict, y_vals: np.ndarray, label: str, *, action: str = 'fitting', extra: str = '') -> None:
        """Warn about zero-variance handling applied by :func:`_prepare_fit_arrays`.
    
        Parameters
        ----------
        stats : dict
            The ``stats`` dict returned by :func:`_prepare_fit_arrays`.
        y_vals : np.ndarray
            The original (pre-transform) y values, used for the "all points" count.
        label : str
            Identifies what was fitted/sampled, e.g. ``'reflectivity 1'`` or
            ``'channel pp'``.
        action : str, optional
            Verb describing the operation, e.g. ``'fitting'`` or ``'sampling'``. By default, 'fitting'.
        extra : str, optional
            Extra sentence(s) appended to the Mighell-related warnings (e.g. a
            likelihood-validity caveat for MCMC). By default, ''.
        """
        if stats['masked'] > 0:
            warnings.warn(
                f'Masked {stats["masked"]} data point(s) in {label} due to zero variance during {action}.',
                UserWarning,
            )
        if stats.get('transformed_all_points'):
            warnings.warn(
                f'Applied Mighell transform to all {len(y_vals)} point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
        elif stats['mighell_substituted'] > 0:
>           warnings.warn(
                f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                f'zero-variance point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
E           UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64        <no unit>  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:537: in fit
    _emit_array_prep_warnings(stats, y_vals, f'reflectivity {i}')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stats = {'valid': 178, 'mighell_substituted': 11, 'masked': 0, 'transformed_all_points': False}
y_vals = array([9.27487850e-01, 9.52332638e-01, 9.23844445e-01, 9.27607868e-01,
       9.45260107e-01, 9.48504316e-01, 9.374221...000e+00, 0.00000000e+00,
       1.73206521e-03, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
       0.00000000e+00])
label = 'reflectivity 0', action = 'fitting', extra = ''

    def _emit_array_prep_warnings(stats: dict, y_vals: np.ndarray, label: str, *, action: str = 'fitting', extra: str = '') -> None:
        """Warn about zero-variance handling applied by :func:`_prepare_fit_arrays`.
    
        Parameters
        ----------
        stats : dict
            The ``stats`` dict returned by :func:`_prepare_fit_arrays`.
        y_vals : np.ndarray
            The original (pre-transform) y values, used for the "all points" count.
        label : str
            Identifies what was fitted/sampled, e.g. ``'reflectivity 1'`` or
            ``'channel pp'``.
        action : str, optional
            Verb describing the operation, e.g. ``'fitting'`` or ``'sampling'``. By default, 'fitting'.
        extra : str, optional
            Extra sentence(s) appended to the Mighell-related warnings (e.g. a
            likelihood-validity caveat for MCMC). By default, ''.
        """
        if stats['masked'] > 0:
            warnings.warn(
                f'Masked {stats["masked"]} data point(s) in {label} due to zero variance during {action}.',
                UserWarning,
            )
        if stats.get('transformed_all_points'):
            warnings.warn(
                f'Applied Mighell transform to all {len(y_vals)} point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
        elif stats['mighell_substituted'] > 0:
>           warnings.warn(
                f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                f'zero-variance point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
E           UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64        <no unit>  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:537: in fit
    _emit_array_prep_warnings(stats, y_vals, f'reflectivity {i}')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stats = {'valid': 178, 'mighell_substituted': 11, 'masked': 0, 'transformed_all_points': False}
y_vals = array([9.27487850e-01, 9.52332638e-01, 9.23844445e-01, 9.27607868e-01,
       9.45260107e-01, 9.48504316e-01, 9.374221...000e+00, 0.00000000e+00,
       1.73206521e-03, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
       0.00000000e+00])
label = 'reflectivity 0', action = 'fitting', extra = ''

    def _emit_array_prep_warnings(stats: dict, y_vals: np.ndarray, label: str, *, action: str = 'fitting', extra: str = '') -> None:
        """Warn about zero-variance handling applied by :func:`_prepare_fit_arrays`.
    
        Parameters
        ----------
        stats : dict
            The ``stats`` dict returned by :func:`_prepare_fit_arrays`.
        y_vals : np.ndarray
            The original (pre-transform) y values, used for the "all points" count.
        label : str
            Identifies what was fitted/sampled, e.g. ``'reflectivity 1'`` or
            ``'channel pp'``.
        action : str, optional
            Verb describing the operation, e.g. ``'fitting'`` or ``'sampling'``. By default, 'fitting'.
        extra : str, optional
            Extra sentence(s) appended to the Mighell-related warnings (e.g. a
            likelihood-validity caveat for MCMC). By default, ''.
        """
        if stats['masked'] > 0:
            warnings.warn(
                f'Masked {stats["masked"]} data point(s) in {label} due to zero variance during {action}.',
                UserWarning,
            )
        if stats.get('transformed_all_points'):
            warnings.warn(
                f'Applied Mighell transform to all {len(y_vals)} point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
        elif stats['mighell_substituted'] > 0:
>           warnings.warn(
                f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                f'zero-variance point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
E           UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64        <no unit>  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:537: in fit
    _emit_array_prep_warnings(stats, y_vals, f'reflectivity {i}')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stats = {'valid': 178, 'mighell_substituted': 11, 'masked': 0, 'transformed_all_points': False}
y_vals = array([9.27487850e-01, 9.52332638e-01, 9.23844445e-01, 9.27607868e-01,
       9.45260107e-01, 9.48504316e-01, 9.374221...000e+00, 0.00000000e+00,
       1.73206521e-03, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
       0.00000000e+00])
label = 'reflectivity 0', action = 'fitting', extra = ''

    def _emit_array_prep_warnings(stats: dict, y_vals: np.ndarray, label: str, *, action: str = 'fitting', extra: str = '') -> None:
        """Warn about zero-variance handling applied by :func:`_prepare_fit_arrays`.
    
        Parameters
        ----------
        stats : dict
            The ``stats`` dict returned by :func:`_prepare_fit_arrays`.
        y_vals : np.ndarray
            The original (pre-transform) y values, used for the "all points" count.
        label : str
            Identifies what was fitted/sampled, e.g. ``'reflectivity 1'`` or
            ``'channel pp'``.
        action : str, optional
            Verb describing the operation, e.g. ``'fitting'`` or ``'sampling'``. By default, 'fitting'.
        extra : str, optional
            Extra sentence(s) appended to the Mighell-related warnings (e.g. a
            likelihood-validity caveat for MCMC). By default, ''.
        """
        if stats['masked'] > 0:
            warnings.warn(
                f'Masked {stats["masked"]} data point(s) in {label} due to zero variance during {action}.',
                UserWarning,
            )
        if stats.get('transformed_all_points'):
            warnings.warn(
                f'Applied Mighell transform to all {len(y_vals)} point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
        elif stats['mighell_substituted'] > 0:
>           warnings.warn(
                f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                f'zero-variance point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
E           UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64        <no unit>  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:537: in fit
    _emit_array_prep_warnings(stats, y_vals, f'reflectivity {i}')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stats = {'valid': 178, 'mighell_substituted': 11, 'masked': 0, 'transformed_all_points': False}
y_vals = array([9.27487850e-01, 9.52332638e-01, 9.23844445e-01, 9.27607868e-01,
       9.45260107e-01, 9.48504316e-01, 9.374221...000e+00, 0.00000000e+00,
       1.73206521e-03, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
       0.00000000e+00])
label = 'reflectivity 0', action = 'fitting', extra = ''

    def _emit_array_prep_warnings(stats: dict, y_vals: np.ndarray, label: str, *, action: str = 'fitting', extra: str = '') -> None:
        """Warn about zero-variance handling applied by :func:`_prepare_fit_arrays`.
    
        Parameters
        ----------
        stats : dict
            The ``stats`` dict returned by :func:`_prepare_fit_arrays`.
        y_vals : np.ndarray
            The original (pre-transform) y values, used for the "all points" count.
        label : str
            Identifies what was fitted/sampled, e.g. ``'reflectivity 1'`` or
            ``'channel pp'``.
        action : str, optional
            Verb describing the operation, e.g. ``'fitting'`` or ``'sampling'``. By default, 'fitting'.
        extra : str, optional
            Extra sentence(s) appended to the Mighell-related warnings (e.g. a
            likelihood-validity caveat for MCMC). By default, ''.
        """
        if stats['masked'] > 0:
            warnings.warn(
                f'Masked {stats["masked"]} data point(s) in {label} due to zero variance during {action}.',
                UserWarning,
            )
        if stats.get('transformed_all_points'):
            warnings.warn(
                f'Applied Mighell transform to all {len(y_vals)} point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
        elif stats['mighell_substituted'] > 0:
>           warnings.warn(
                f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                f'zero-variance point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
E           UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64        <no unit>  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:537: in fit
    _emit_array_prep_warnings(stats, y_vals, f'reflectivity {i}')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stats = {'valid': 178, 'mighell_substituted': 11, 'masked': 0, 'transformed_all_points': False}
y_vals = array([9.27487850e-01, 9.52332638e-01, 9.23844445e-01, 9.27607868e-01,
       9.45260107e-01, 9.48504316e-01, 9.374221...000e+00, 0.00000000e+00,
       1.73206521e-03, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
       0.00000000e+00])
label = 'reflectivity 0', action = 'fitting', extra = ''

    def _emit_array_prep_warnings(stats: dict, y_vals: np.ndarray, label: str, *, action: str = 'fitting', extra: str = '') -> None:
        """Warn about zero-variance handling applied by :func:`_prepare_fit_arrays`.
    
        Parameters
        ----------
        stats : dict
            The ``stats`` dict returned by :func:`_prepare_fit_arrays`.
        y_vals : np.ndarray
            The original (pre-transform) y values, used for the "all points" count.
        label : str
            Identifies what was fitted/sampled, e.g. ``'reflectivity 1'`` or
            ``'channel pp'``.
        action : str, optional
            Verb describing the operation, e.g. ``'fitting'`` or ``'sampling'``. By default, 'fitting'.
        extra : str, optional
            Extra sentence(s) appended to the Mighell-related warnings (e.g. a
            likelihood-validity caveat for MCMC). By default, ''.
        """
        if stats['masked'] > 0:
            warnings.warn(
                f'Masked {stats["masked"]} data point(s) in {label} due to zero variance during {action}.',
                UserWarning,
            )
        if stats.get('transformed_all_points'):
            warnings.warn(
                f'Applied Mighell transform to all {len(y_vals)} point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
        elif stats['mighell_substituted'] > 0:
>           warnings.warn(
                f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                f'zero-variance point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
E           UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64        <no unit>  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:537: in fit
    _emit_array_prep_warnings(stats, y_vals, f'reflectivity {i}')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stats = {'valid': 178, 'mighell_substituted': 11, 'masked': 0, 'transformed_all_points': False}
y_vals = array([9.27487850e-01, 9.52332638e-01, 9.23844445e-01, 9.27607868e-01,
       9.45260107e-01, 9.48504316e-01, 9.374221...000e+00, 0.00000000e+00,
       1.73206521e-03, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
       0.00000000e+00])
label = 'reflectivity 0', action = 'fitting', extra = ''

    def _emit_array_prep_warnings(stats: dict, y_vals: np.ndarray, label: str, *, action: str = 'fitting', extra: str = '') -> None:
        """Warn about zero-variance handling applied by :func:`_prepare_fit_arrays`.
    
        Parameters
        ----------
        stats : dict
            The ``stats`` dict returned by :func:`_prepare_fit_arrays`.
        y_vals : np.ndarray
            The original (pre-transform) y values, used for the "all points" count.
        label : str
            Identifies what was fitted/sampled, e.g. ``'reflectivity 1'`` or
            ``'channel pp'``.
        action : str, optional
            Verb describing the operation, e.g. ``'fitting'`` or ``'sampling'``. By default, 'fitting'.
        extra : str, optional
            Extra sentence(s) appended to the Mighell-related warnings (e.g. a
            likelihood-validity caveat for MCMC). By default, ''.
        """
        if stats['masked'] > 0:
            warnings.warn(
                f'Masked {stats["masked"]} data point(s) in {label} due to zero variance during {action}.',
                UserWarning,
            )
        if stats.get('transformed_all_points'):
            warnings.warn(
                f'Applied Mighell transform to all {len(y_vals)} point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
        elif stats['mighell_substituted'] > 0:
>           warnings.warn(
                f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                f'zero-variance point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
E           UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64        <no unit>  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:537: in fit
    _emit_array_prep_warnings(stats, y_vals, f'reflectivity {i}')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stats = {'valid': 178, 'mighell_substituted': 11, 'masked': 0, 'transformed_all_points': False}
y_vals = array([9.27487850e-01, 9.52332638e-01, 9.23844445e-01, 9.27607868e-01,
       9.45260107e-01, 9.48504316e-01, 9.374221...000e+00, 0.00000000e+00,
       1.73206521e-03, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
       0.00000000e+00])
label = 'reflectivity 0', action = 'fitting', extra = ''

    def _emit_array_prep_warnings(stats: dict, y_vals: np.ndarray, label: str, *, action: str = 'fitting', extra: str = '') -> None:
        """Warn about zero-variance handling applied by :func:`_prepare_fit_arrays`.
    
        Parameters
        ----------
        stats : dict
            The ``stats`` dict returned by :func:`_prepare_fit_arrays`.
        y_vals : np.ndarray
            The original (pre-transform) y values, used for the "all points" count.
        label : str
            Identifies what was fitted/sampled, e.g. ``'reflectivity 1'`` or
            ``'channel pp'``.
        action : str, optional
            Verb describing the operation, e.g. ``'fitting'`` or ``'sampling'``. By default, 'fitting'.
        extra : str, optional
            Extra sentence(s) appended to the Mighell-related warnings (e.g. a
            likelihood-validity caveat for MCMC). By default, ''.
        """
        if stats['masked'] > 0:
            warnings.warn(
                f'Masked {stats["masked"]} data point(s) in {label} due to zero variance during {action}.',
                UserWarning,
            )
        if stats.get('transformed_all_points'):
            warnings.warn(
                f'Applied Mighell transform to all {len(y_vals)} point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
        elif stats['mighell_substituted'] > 0:
>           warnings.warn(
                f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                f'zero-variance point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
E           UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64        <no unit>  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:537: in fit
    _emit_array_prep_warnings(stats, y_vals, f'reflectivity {i}')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stats = {'valid': 178, 'mighell_substituted': 11, 'masked': 0, 'transformed_all_points': False}
y_vals = array([9.27487850e-01, 9.52332638e-01, 9.23844445e-01, 9.27607868e-01,
       9.45260107e-01, 9.48504316e-01, 9.374221...000e+00, 0.00000000e+00,
       1.73206521e-03, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
       0.00000000e+00])
label = 'reflectivity 0', action = 'fitting', extra = ''

    def _emit_array_prep_warnings(stats: dict, y_vals: np.ndarray, label: str, *, action: str = 'fitting', extra: str = '') -> None:
        """Warn about zero-variance handling applied by :func:`_prepare_fit_arrays`.
    
        Parameters
        ----------
        stats : dict
            The ``stats`` dict returned by :func:`_prepare_fit_arrays`.
        y_vals : np.ndarray
            The original (pre-transform) y values, used for the "all points" count.
        label : str
            Identifies what was fitted/sampled, e.g. ``'reflectivity 1'`` or
            ``'channel pp'``.
        action : str, optional
            Verb describing the operation, e.g. ``'fitting'`` or ``'sampling'``. By default, 'fitting'.
        extra : str, optional
            Extra sentence(s) appended to the Mighell-related warnings (e.g. a
            likelihood-validity caveat for MCMC). By default, ''.
        """
        if stats['masked'] > 0:
            warnings.warn(
                f'Masked {stats["masked"]} data point(s) in {label} due to zero variance during {action}.',
                UserWarning,
            )
        if stats.get('transformed_all_points'):
            warnings.warn(
                f'Applied Mighell transform to all {len(y_vals)} point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
        elif stats['mighell_substituted'] > 0:
>           warnings.warn(
                f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                f'zero-variance point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
E           UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64        <no unit>  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:537: in fit
    _emit_array_prep_warnings(stats, y_vals, f'reflectivity {i}')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stats = {'valid': 178, 'mighell_substituted': 11, 'masked': 0, 'transformed_all_points': False}
y_vals = array([9.27487850e-01, 9.52332638e-01, 9.23844445e-01, 9.27607868e-01,
       9.45260107e-01, 9.48504316e-01, 9.374221...000e+00, 0.00000000e+00,
       1.73206521e-03, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
       0.00000000e+00])
label = 'reflectivity 0', action = 'fitting', extra = ''

    def _emit_array_prep_warnings(stats: dict, y_vals: np.ndarray, label: str, *, action: str = 'fitting', extra: str = '') -> None:
        """Warn about zero-variance handling applied by :func:`_prepare_fit_arrays`.
    
        Parameters
        ----------
        stats : dict
            The ``stats`` dict returned by :func:`_prepare_fit_arrays`.
        y_vals : np.ndarray
            The original (pre-transform) y values, used for the "all points" count.
        label : str
            Identifies what was fitted/sampled, e.g. ``'reflectivity 1'`` or
            ``'channel pp'``.
        action : str, optional
            Verb describing the operation, e.g. ``'fitting'`` or ``'sampling'``. By default, 'fitting'.
        extra : str, optional
            Extra sentence(s) appended to the Mighell-related warnings (e.g. a
            likelihood-validity caveat for MCMC). By default, ''.
        """
        if stats['masked'] > 0:
            warnings.warn(
                f'Masked {stats["masked"]} data point(s) in {label} due to zero variance during {action}.',
                UserWarning,
            )
        if stats.get('transformed_all_points'):
            warnings.warn(
                f'Applied Mighell transform to all {len(y_vals)} point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
        elif stats['mighell_substituted'] > 0:
>           warnings.warn(
                f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                f'zero-variance point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
E           UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64        <no unit>  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:537: in fit
    _emit_array_prep_warnings(stats, y_vals, f'reflectivity {i}')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stats = {'valid': 178, 'mighell_substituted': 11, 'masked': 0, 'transformed_all_points': False}
y_vals = array([9.27487850e-01, 9.52332638e-01, 9.23844445e-01, 9.27607868e-01,
       9.45260107e-01, 9.48504316e-01, 9.374221...000e+00, 0.00000000e+00,
       1.73206521e-03, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
       0.00000000e+00])
label = 'reflectivity 0', action = 'fitting', extra = ''

    def _emit_array_prep_warnings(stats: dict, y_vals: np.ndarray, label: str, *, action: str = 'fitting', extra: str = '') -> None:
        """Warn about zero-variance handling applied by :func:`_prepare_fit_arrays`.
    
        Parameters
        ----------
        stats : dict
            The ``stats`` dict returned by :func:`_prepare_fit_arrays`.
        y_vals : np.ndarray
            The original (pre-transform) y values, used for the "all points" count.
        label : str
            Identifies what was fitted/sampled, e.g. ``'reflectivity 1'`` or
            ``'channel pp'``.
        action : str, optional
            Verb describing the operation, e.g. ``'fitting'`` or ``'sampling'``. By default, 'fitting'.
        extra : str, optional
            Extra sentence(s) appended to the Mighell-related warnings (e.g. a
            likelihood-validity caveat for MCMC). By default, ''.
        """
        if stats['masked'] > 0:
            warnings.warn(
                f'Masked {stats["masked"]} data point(s) in {label} due to zero variance during {action}.',
                UserWarning,
            )
        if stats.get('transformed_all_points'):
            warnings.warn(
                f'Applied Mighell transform to all {len(y_vals)} point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
        elif stats['mighell_substituted'] > 0:
>           warnings.warn(
                f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                f'zero-variance point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
E           UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64        <no unit>  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:537: in fit
    _emit_array_prep_warnings(stats, y_vals, f'reflectivity {i}')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stats = {'valid': 178, 'mighell_substituted': 11, 'masked': 0, 'transformed_all_points': False}
y_vals = array([9.27487850e-01, 9.52332638e-01, 9.23844445e-01, 9.27607868e-01,
       9.45260107e-01, 9.48504316e-01, 9.374221...000e+00, 0.00000000e+00,
       1.73206521e-03, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
       0.00000000e+00])
label = 'reflectivity 0', action = 'fitting', extra = ''

    def _emit_array_prep_warnings(stats: dict, y_vals: np.ndarray, label: str, *, action: str = 'fitting', extra: str = '') -> None:
        """Warn about zero-variance handling applied by :func:`_prepare_fit_arrays`.
    
        Parameters
        ----------
        stats : dict
            The ``stats`` dict returned by :func:`_prepare_fit_arrays`.
        y_vals : np.ndarray
            The original (pre-transform) y values, used for the "all points" count.
        label : str
            Identifies what was fitted/sampled, e.g. ``'reflectivity 1'`` or
            ``'channel pp'``.
        action : str, optional
            Verb describing the operation, e.g. ``'fitting'`` or ``'sampling'``. By default, 'fitting'.
        extra : str, optional
            Extra sentence(s) appended to the Mighell-related warnings (e.g. a
            likelihood-validity caveat for MCMC). By default, ''.
        """
        if stats['masked'] > 0:
            warnings.warn(
                f'Masked {stats["masked"]} data point(s) in {label} due to zero variance during {action}.',
                UserWarning,
            )
        if stats.get('transformed_all_points'):
            warnings.warn(
                f'Applied Mighell transform to all {len(y_vals)} point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
        elif stats['mighell_substituted'] > 0:
>           warnings.warn(
                f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                f'zero-variance point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
E           UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64        <no unit>  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:537: in fit
    _emit_array_prep_warnings(stats, y_vals, f'reflectivity {i}')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stats = {'valid': 178, 'mighell_substituted': 11, 'masked': 0, 'transformed_all_points': False}
y_vals = array([9.27487850e-01, 9.52332638e-01, 9.23844445e-01, 9.27607868e-01,
       9.45260107e-01, 9.48504316e-01, 9.374221...000e+00, 0.00000000e+00,
       1.73206521e-03, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
       0.00000000e+00])
label = 'reflectivity 0', action = 'fitting', extra = ''

    def _emit_array_prep_warnings(stats: dict, y_vals: np.ndarray, label: str, *, action: str = 'fitting', extra: str = '') -> None:
        """Warn about zero-variance handling applied by :func:`_prepare_fit_arrays`.
    
        Parameters
        ----------
        stats : dict
            The ``stats`` dict returned by :func:`_prepare_fit_arrays`.
        y_vals : np.ndarray
            The original (pre-transform) y values, used for the "all points" count.
        label : str
            Identifies what was fitted/sampled, e.g. ``'reflectivity 1'`` or
            ``'channel pp'``.
        action : str, optional
            Verb describing the operation, e.g. ``'fitting'`` or ``'sampling'``. By default, 'fitting'.
        extra : str, optional
            Extra sentence(s) appended to the Mighell-related warnings (e.g. a
            likelihood-validity caveat for MCMC). By default, ''.
        """
        if stats['masked'] > 0:
            warnings.warn(
                f'Masked {stats["masked"]} data point(s) in {label} due to zero variance during {action}.',
                UserWarning,
            )
        if stats.get('transformed_all_points'):
            warnings.warn(
                f'Applied Mighell transform to all {len(y_vals)} point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
        elif stats['mighell_substituted'] > 0:
>           warnings.warn(
                f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                f'zero-variance point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
E           UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64        <no unit>  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:537: in fit
    _emit_array_prep_warnings(stats, y_vals, f'reflectivity {i}')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stats = {'valid': 178, 'mighell_substituted': 11, 'masked': 0, 'transformed_all_points': False}
y_vals = array([9.27487850e-01, 9.52332638e-01, 9.23844445e-01, 9.27607868e-01,
       9.45260107e-01, 9.48504316e-01, 9.374221...000e+00, 0.00000000e+00,
       1.73206521e-03, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
       0.00000000e+00])
label = 'reflectivity 0', action = 'fitting', extra = ''

    def _emit_array_prep_warnings(stats: dict, y_vals: np.ndarray, label: str, *, action: str = 'fitting', extra: str = '') -> None:
        """Warn about zero-variance handling applied by :func:`_prepare_fit_arrays`.
    
        Parameters
        ----------
        stats : dict
            The ``stats`` dict returned by :func:`_prepare_fit_arrays`.
        y_vals : np.ndarray
            The original (pre-transform) y values, used for the "all points" count.
        label : str
            Identifies what was fitted/sampled, e.g. ``'reflectivity 1'`` or
            ``'channel pp'``.
        action : str, optional
            Verb describing the operation, e.g. ``'fitting'`` or ``'sampling'``. By default, 'fitting'.
        extra : str, optional
            Extra sentence(s) appended to the Mighell-related warnings (e.g. a
            likelihood-validity caveat for MCMC). By default, ''.
        """
        if stats['masked'] > 0:
            warnings.warn(
                f'Masked {stats["masked"]} data point(s) in {label} due to zero variance during {action}.',
                UserWarning,
            )
        if stats.get('transformed_all_points'):
            warnings.warn(
                f'Applied Mighell transform to all {len(y_vals)} point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
        elif stats['mighell_substituted'] > 0:
>           warnings.warn(
                f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                f'zero-variance point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
E           UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64        <no unit>  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:537: in fit
    _emit_array_prep_warnings(stats, y_vals, f'reflectivity {i}')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stats = {'valid': 178, 'mighell_substituted': 11, 'masked': 0, 'transformed_all_points': False}
y_vals = array([9.27487850e-01, 9.52332638e-01, 9.23844445e-01, 9.27607868e-01,
       9.45260107e-01, 9.48504316e-01, 9.374221...000e+00, 0.00000000e+00,
       1.73206521e-03, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
       0.00000000e+00])
label = 'reflectivity 0', action = 'fitting', extra = ''

    def _emit_array_prep_warnings(stats: dict, y_vals: np.ndarray, label: str, *, action: str = 'fitting', extra: str = '') -> None:
        """Warn about zero-variance handling applied by :func:`_prepare_fit_arrays`.
    
        Parameters
        ----------
        stats : dict
            The ``stats`` dict returned by :func:`_prepare_fit_arrays`.
        y_vals : np.ndarray
            The original (pre-transform) y values, used for the "all points" count.
        label : str
            Identifies what was fitted/sampled, e.g. ``'reflectivity 1'`` or
            ``'channel pp'``.
        action : str, optional
            Verb describing the operation, e.g. ``'fitting'`` or ``'sampling'``. By default, 'fitting'.
        extra : str, optional
            Extra sentence(s) appended to the Mighell-related warnings (e.g. a
            likelihood-validity caveat for MCMC). By default, ''.
        """
        if stats['masked'] > 0:
            warnings.warn(
                f'Masked {stats["masked"]} data point(s) in {label} due to zero variance during {action}.',
                UserWarning,
            )
        if stats.get('transformed_all_points'):
            warnings.warn(
                f'Applied Mighell transform to all {len(y_vals)} point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
        elif stats['mighell_substituted'] > 0:
>           warnings.warn(
                f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                f'zero-variance point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
E           UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64        <no unit>  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:537: in fit
    _emit_array_prep_warnings(stats, y_vals, f'reflectivity {i}')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stats = {'valid': 178, 'mighell_substituted': 11, 'masked': 0, 'transformed_all_points': False}
y_vals = array([9.27487850e-01, 9.52332638e-01, 9.23844445e-01, 9.27607868e-01,
       9.45260107e-01, 9.48504316e-01, 9.374221...000e+00, 0.00000000e+00,
       1.73206521e-03, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
       0.00000000e+00])
label = 'reflectivity 0', action = 'fitting', extra = ''

    def _emit_array_prep_warnings(stats: dict, y_vals: np.ndarray, label: str, *, action: str = 'fitting', extra: str = '') -> None:
        """Warn about zero-variance handling applied by :func:`_prepare_fit_arrays`.
    
        Parameters
        ----------
        stats : dict
            The ``stats`` dict returned by :func:`_prepare_fit_arrays`.
        y_vals : np.ndarray
            The original (pre-transform) y values, used for the "all points" count.
        label : str
            Identifies what was fitted/sampled, e.g. ``'reflectivity 1'`` or
            ``'channel pp'``.
        action : str, optional
            Verb describing the operation, e.g. ``'fitting'`` or ``'sampling'``. By default, 'fitting'.
        extra : str, optional
            Extra sentence(s) appended to the Mighell-related warnings (e.g. a
            likelihood-validity caveat for MCMC). By default, ''.
        """
        if stats['masked'] > 0:
            warnings.warn(
                f'Masked {stats["masked"]} data point(s) in {label} due to zero variance during {action}.',
                UserWarning,
            )
        if stats.get('transformed_all_points'):
            warnings.warn(
                f'Applied Mighell transform to all {len(y_vals)} point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
        elif stats['mighell_substituted'] > 0:
>           warnings.warn(
                f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                f'zero-variance point(s) in {label} during {action}.{extra}',
                UserWarning,
            )
E           UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:251: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <easyreflectometry.fitting.MultiFitter object at 0x7f4838f17ad0>
data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])
id = 0, objective = None

    def fit(self, data: sc.DataGroup, id: int = 0, objective: str | None = None) -> sc.DataGroup:
        """Perform the fitting and populate the DataGroups with the result.
    
        Parameters
        ----------
        data : sc.DataGroup
            DataGroup to be fitted to and populated.
        id : int, optional
            Unused parameter kept for backward compatibility. By default, 0.
        objective : str | None, optional
            Per-call override for the zero-variance objective.
            If ``None``, uses the instance default set at construction. By default, None.
    
        Returns
        -------
        sc.DataGroup
            A new DataGroup with fitted model curves, SLD profiles, and fit statistics.
        """
        obj = _validate_objective(objective) if objective is not None else self._objective
    
        refl_nums = [k[3:] for k in data['coords'].keys() if 'Qz' == k[:2]]
        x = []
        y = []
        dy = []
        original_arrays = []
    
        # Process each reflectivity dataset
        for i in refl_nums:
            x_vals = data['coords'][f'Qz_{i}'].values
            y_vals = data['data'][f'R_{i}'].values
            variances = data['data'][f'R_{i}'].variances
    
            x_out, y_eff, weights, stats = _prepare_fit_arrays(x_vals, y_vals, variances, obj)
    
            if stats['masked'] > 0:
                warnings.warn(
                    f'Masked {stats["masked"]} data point(s) in reflectivity {i} due to zero variance during fitting.',
                    UserWarning,
                )
            if stats.get('transformed_all_points'):
                warnings.warn(
                    f'Applied Mighell transform to all {len(y_vals)} point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
            elif stats['mighell_substituted'] > 0:
>               warnings.warn(
                    f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                    f'zero-variance point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
E               UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <easyreflectometry.fitting.MultiFitter object at 0x7fa9d28480b0>
data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])
id = 0, objective = None

    def fit(self, data: sc.DataGroup, id: int = 0, objective: str | None = None) -> sc.DataGroup:
        """Perform the fitting and populate the DataGroups with the result.
    
        Parameters
        ----------
        data : sc.DataGroup
            DataGroup to be fitted to and populated.
        id : int, optional
            Unused parameter kept for backward compatibility. By default, 0.
        objective : str | None, optional
            Per-call override for the zero-variance objective.
            If ``None``, uses the instance default set at construction. By default, None.
    
        Returns
        -------
        sc.DataGroup
            A new DataGroup with fitted model curves, SLD profiles, and fit statistics.
        """
        obj = _validate_objective(objective) if objective is not None else self._objective
    
        refl_nums = [k[3:] for k in data['coords'].keys() if 'Qz' == k[:2]]
        x = []
        y = []
        dy = []
        original_arrays = []
    
        # Process each reflectivity dataset
        for i in refl_nums:
            x_vals = data['coords'][f'Qz_{i}'].values
            y_vals = data['data'][f'R_{i}'].values
            variances = data['data'][f'R_{i}'].variances
    
            x_out, y_eff, weights, stats = _prepare_fit_arrays(x_vals, y_vals, variances, obj)
    
            if stats['masked'] > 0:
                warnings.warn(
                    f'Masked {stats["masked"]} data point(s) in reflectivity {i} due to zero variance during fitting.',
                    UserWarning,
                )
            if stats.get('transformed_all_points'):
                warnings.warn(
                    f'Applied Mighell transform to all {len(y_vals)} point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
            elif stats['mighell_substituted'] > 0:
>               warnings.warn(
                    f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                    f'zero-variance point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
E               UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <easyreflectometry.fitting.MultiFitter object at 0x7fbf12eb0350>
data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])
id = 0, objective = None

    def fit(self, data: sc.DataGroup, id: int = 0, objective: str | None = None) -> sc.DataGroup:
        """Perform the fitting and populate the DataGroups with the result.
    
        Parameters
        ----------
        data : sc.DataGroup
            DataGroup to be fitted to and populated.
        id : int, optional
            Unused parameter kept for backward compatibility. By default, 0.
        objective : str | None, optional
            Per-call override for the zero-variance objective.
            If ``None``, uses the instance default set at construction. By default, None.
    
        Returns
        -------
        sc.DataGroup
            A new DataGroup with fitted model curves, SLD profiles, and fit statistics.
        """
        obj = _validate_objective(objective) if objective is not None else self._objective
    
        refl_nums = [k[3:] for k in data['coords'].keys() if 'Qz' == k[:2]]
        x = []
        y = []
        dy = []
        original_arrays = []
    
        # Process each reflectivity dataset
        for i in refl_nums:
            x_vals = data['coords'][f'Qz_{i}'].values
            y_vals = data['data'][f'R_{i}'].values
            variances = data['data'][f'R_{i}'].variances
    
            x_out, y_eff, weights, stats = _prepare_fit_arrays(x_vals, y_vals, variances, obj)
    
            if stats['masked'] > 0:
                warnings.warn(
                    f'Masked {stats["masked"]} data point(s) in reflectivity {i} due to zero variance during fitting.',
                    UserWarning,
                )
            if stats.get('transformed_all_points'):
                warnings.warn(
                    f'Applied Mighell transform to all {len(y_vals)} point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
            elif stats['mighell_substituted'] > 0:
>               warnings.warn(
                    f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                    f'zero-variance point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
E               UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <easyreflectometry.fitting.MultiFitter object at 0x7f7fd6be7f20>
data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])
id = 0, objective = None

    def fit(self, data: sc.DataGroup, id: int = 0, objective: str | None = None) -> sc.DataGroup:
        """Perform the fitting and populate the DataGroups with the result.
    
        Parameters
        ----------
        data : sc.DataGroup
            DataGroup to be fitted to and populated.
        id : int, optional
            Unused parameter kept for backward compatibility. By default, 0.
        objective : str | None, optional
            Per-call override for the zero-variance objective.
            If ``None``, uses the instance default set at construction. By default, None.
    
        Returns
        -------
        sc.DataGroup
            A new DataGroup with fitted model curves, SLD profiles, and fit statistics.
        """
        obj = _validate_objective(objective) if objective is not None else self._objective
    
        refl_nums = [k[3:] for k in data['coords'].keys() if 'Qz' == k[:2]]
        x = []
        y = []
        dy = []
        original_arrays = []
    
        # Process each reflectivity dataset
        for i in refl_nums:
            x_vals = data['coords'][f'Qz_{i}'].values
            y_vals = data['data'][f'R_{i}'].values
            variances = data['data'][f'R_{i}'].variances
    
            x_out, y_eff, weights, stats = _prepare_fit_arrays(x_vals, y_vals, variances, obj)
    
            if stats['masked'] > 0:
                warnings.warn(
                    f'Masked {stats["masked"]} data point(s) in reflectivity {i} due to zero variance during fitting.',
                    UserWarning,
                )
            if stats.get('transformed_all_points'):
                warnings.warn(
                    f'Applied Mighell transform to all {len(y_vals)} point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
            elif stats['mighell_substituted'] > 0:
>               warnings.warn(
                    f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                    f'zero-variance point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
E               UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <easyreflectometry.fitting.MultiFitter object at 0x7f837a909190>
data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])
id = 0, objective = None

    def fit(self, data: sc.DataGroup, id: int = 0, objective: str | None = None) -> sc.DataGroup:
        """Perform the fitting and populate the DataGroups with the result.
    
        Parameters
        ----------
        data : sc.DataGroup
            DataGroup to be fitted to and populated.
        id : int, optional
            Unused parameter kept for backward compatibility. By default, 0.
        objective : str | None, optional
            Per-call override for the zero-variance objective.
            If ``None``, uses the instance default set at construction. By default, None.
    
        Returns
        -------
        sc.DataGroup
            A new DataGroup with fitted model curves, SLD profiles, and fit statistics.
        """
        obj = _validate_objective(objective) if objective is not None else self._objective
    
        refl_nums = [k[3:] for k in data['coords'].keys() if 'Qz' == k[:2]]
        x = []
        y = []
        dy = []
        original_arrays = []
    
        # Process each reflectivity dataset
        for i in refl_nums:
            x_vals = data['coords'][f'Qz_{i}'].values
            y_vals = data['data'][f'R_{i}'].values
            variances = data['data'][f'R_{i}'].variances
    
            x_out, y_eff, weights, stats = _prepare_fit_arrays(x_vals, y_vals, variances, obj)
    
            if stats['masked'] > 0:
                warnings.warn(
                    f'Masked {stats["masked"]} data point(s) in reflectivity {i} due to zero variance during fitting.',
                    UserWarning,
                )
            if stats.get('transformed_all_points'):
                warnings.warn(
                    f'Applied Mighell transform to all {len(y_vals)} point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
            elif stats['mighell_substituted'] > 0:
>               warnings.warn(
                    f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                    f'zero-variance point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
E               UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <easyreflectometry.fitting.MultiFitter object at 0x7f0fe5ce9a60>
data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])
id = 0, objective = None

    def fit(self, data: sc.DataGroup, id: int = 0, objective: str | None = None) -> sc.DataGroup:
        """Perform the fitting and populate the DataGroups with the result.
    
        Parameters
        ----------
        data : sc.DataGroup
            DataGroup to be fitted to and populated.
        id : int, optional
            Unused parameter kept for backward compatibility. By default, 0.
        objective : str | None, optional
            Per-call override for the zero-variance objective.
            If ``None``, uses the instance default set at construction. By default, None.
    
        Returns
        -------
        sc.DataGroup
            A new DataGroup with fitted model curves, SLD profiles, and fit statistics.
        """
        obj = _validate_objective(objective) if objective is not None else self._objective
    
        refl_nums = [k[3:] for k in data['coords'].keys() if 'Qz' == k[:2]]
        x = []
        y = []
        dy = []
        original_arrays = []
    
        # Process each reflectivity dataset
        for i in refl_nums:
            x_vals = data['coords'][f'Qz_{i}'].values
            y_vals = data['data'][f'R_{i}'].values
            variances = data['data'][f'R_{i}'].variances
    
            x_out, y_eff, weights, stats = _prepare_fit_arrays(x_vals, y_vals, variances, obj)
    
            if stats['masked'] > 0:
                warnings.warn(
                    f'Masked {stats["masked"]} data point(s) in reflectivity {i} due to zero variance during fitting.',
                    UserWarning,
                )
            if stats.get('transformed_all_points'):
                warnings.warn(
                    f'Applied Mighell transform to all {len(y_vals)} point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
            elif stats['mighell_substituted'] > 0:
>               warnings.warn(
                    f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                    f'zero-variance point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
E               UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <easyreflectometry.fitting.MultiFitter object at 0x7ff635269220>
data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])
id = 0, objective = None

    def fit(self, data: sc.DataGroup, id: int = 0, objective: str | None = None) -> sc.DataGroup:
        """Perform the fitting and populate the DataGroups with the result.
    
        Parameters
        ----------
        data : sc.DataGroup
            DataGroup to be fitted to and populated.
        id : int, optional
            Unused parameter kept for backward compatibility. By default, 0.
        objective : str | None, optional
            Per-call override for the zero-variance objective.
            If ``None``, uses the instance default set at construction. By default, None.
    
        Returns
        -------
        sc.DataGroup
            A new DataGroup with fitted model curves, SLD profiles, and fit statistics.
        """
        obj = _validate_objective(objective) if objective is not None else self._objective
    
        refl_nums = [k[3:] for k in data['coords'].keys() if 'Qz' == k[:2]]
        x = []
        y = []
        dy = []
        original_arrays = []
    
        # Process each reflectivity dataset
        for i in refl_nums:
            x_vals = data['coords'][f'Qz_{i}'].values
            y_vals = data['data'][f'R_{i}'].values
            variances = data['data'][f'R_{i}'].variances
    
            x_out, y_eff, weights, stats = _prepare_fit_arrays(x_vals, y_vals, variances, obj)
    
            if stats['masked'] > 0:
                warnings.warn(
                    f'Masked {stats["masked"]} data point(s) in reflectivity {i} due to zero variance during fitting.',
                    UserWarning,
                )
            if stats.get('transformed_all_points'):
                warnings.warn(
                    f'Applied Mighell transform to all {len(y_vals)} point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
            elif stats['mighell_substituted'] > 0:
>               warnings.warn(
                    f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                    f'zero-variance point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
E               UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <easyreflectometry.fitting.MultiFitter object at 0x7f84831047d0>
data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])
id = 0, objective = None

    def fit(self, data: sc.DataGroup, id: int = 0, objective: str | None = None) -> sc.DataGroup:
        """Perform the fitting and populate the DataGroups with the result.
    
        Parameters
        ----------
        data : sc.DataGroup
            DataGroup to be fitted to and populated.
        id : int, optional
            Unused parameter kept for backward compatibility. By default, 0.
        objective : str | None, optional
            Per-call override for the zero-variance objective.
            If ``None``, uses the instance default set at construction. By default, None.
    
        Returns
        -------
        sc.DataGroup
            A new DataGroup with fitted model curves, SLD profiles, and fit statistics.
        """
        obj = _validate_objective(objective) if objective is not None else self._objective
    
        refl_nums = [k[3:] for k in data['coords'].keys() if 'Qz' == k[:2]]
        x = []
        y = []
        dy = []
        original_arrays = []
    
        # Process each reflectivity dataset
        for i in refl_nums:
            x_vals = data['coords'][f'Qz_{i}'].values
            y_vals = data['data'][f'R_{i}'].values
            variances = data['data'][f'R_{i}'].variances
    
            x_out, y_eff, weights, stats = _prepare_fit_arrays(x_vals, y_vals, variances, obj)
    
            if stats['masked'] > 0:
                warnings.warn(
                    f'Masked {stats["masked"]} data point(s) in reflectivity {i} due to zero variance during fitting.',
                    UserWarning,
                )
            if stats.get('transformed_all_points'):
                warnings.warn(
                    f'Applied Mighell transform to all {len(y_vals)} point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
            elif stats['mighell_substituted'] > 0:
>               warnings.warn(
                    f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                    f'zero-variance point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
E               UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <easyreflectometry.fitting.MultiFitter object at 0x7f41c077a900>
data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])
id = 0, objective = None

    def fit(self, data: sc.DataGroup, id: int = 0, objective: str | None = None) -> sc.DataGroup:
        """Perform the fitting and populate the DataGroups with the result.
    
        Parameters
        ----------
        data : sc.DataGroup
            DataGroup to be fitted to and populated.
        id : int, optional
            Unused parameter kept for backward compatibility. By default, 0.
        objective : str | None, optional
            Per-call override for the zero-variance objective.
            If ``None``, uses the instance default set at construction. By default, None.
    
        Returns
        -------
        sc.DataGroup
            A new DataGroup with fitted model curves, SLD profiles, and fit statistics.
        """
        obj = _validate_objective(objective) if objective is not None else self._objective
    
        refl_nums = [k[3:] for k in data['coords'].keys() if 'Qz' == k[:2]]
        x = []
        y = []
        dy = []
        original_arrays = []
    
        # Process each reflectivity dataset
        for i in refl_nums:
            x_vals = data['coords'][f'Qz_{i}'].values
            y_vals = data['data'][f'R_{i}'].values
            variances = data['data'][f'R_{i}'].variances
    
            x_out, y_eff, weights, stats = _prepare_fit_arrays(x_vals, y_vals, variances, obj)
    
            if stats['masked'] > 0:
                warnings.warn(
                    f'Masked {stats["masked"]} data point(s) in reflectivity {i} due to zero variance during fitting.',
                    UserWarning,
                )
            if stats.get('transformed_all_points'):
                warnings.warn(
                    f'Applied Mighell transform to all {len(y_vals)} point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
            elif stats['mighell_substituted'] > 0:
>               warnings.warn(
                    f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                    f'zero-variance point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
E               UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <easyreflectometry.fitting.MultiFitter object at 0x7f2b4de59370>
data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])
id = 0, objective = None

    def fit(self, data: sc.DataGroup, id: int = 0, objective: str | None = None) -> sc.DataGroup:
        """Perform the fitting and populate the DataGroups with the result.
    
        Parameters
        ----------
        data : sc.DataGroup
            DataGroup to be fitted to and populated.
        id : int, optional
            Unused parameter kept for backward compatibility. By default, 0.
        objective : str | None, optional
            Per-call override for the zero-variance objective.
            If ``None``, uses the instance default set at construction. By default, None.
    
        Returns
        -------
        sc.DataGroup
            A new DataGroup with fitted model curves, SLD profiles, and fit statistics.
        """
        obj = _validate_objective(objective) if objective is not None else self._objective
    
        refl_nums = [k[3:] for k in data['coords'].keys() if 'Qz' == k[:2]]
        x = []
        y = []
        dy = []
        original_arrays = []
    
        # Process each reflectivity dataset
        for i in refl_nums:
            x_vals = data['coords'][f'Qz_{i}'].values
            y_vals = data['data'][f'R_{i}'].values
            variances = data['data'][f'R_{i}'].variances
    
            x_out, y_eff, weights, stats = _prepare_fit_arrays(x_vals, y_vals, variances, obj)
    
            if stats['masked'] > 0:
                warnings.warn(
                    f'Masked {stats["masked"]} data point(s) in reflectivity {i} due to zero variance during fitting.',
                    UserWarning,
                )
            if stats.get('transformed_all_points'):
                warnings.warn(
                    f'Applied Mighell transform to all {len(y_vals)} point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
            elif stats['mighell_substituted'] > 0:
>               warnings.warn(
                    f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                    f'zero-variance point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
E               UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <easyreflectometry.fitting.MultiFitter object at 0x7fe1cd610980>
data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])
id = 0, objective = None

    def fit(self, data: sc.DataGroup, id: int = 0, objective: str | None = None) -> sc.DataGroup:
        """Perform the fitting and populate the DataGroups with the result.
    
        Parameters
        ----------
        data : sc.DataGroup
            DataGroup to be fitted to and populated.
        id : int, optional
            Unused parameter kept for backward compatibility. By default, 0.
        objective : str | None, optional
            Per-call override for the zero-variance objective.
            If ``None``, uses the instance default set at construction. By default, None.
    
        Returns
        -------
        sc.DataGroup
            A new DataGroup with fitted model curves, SLD profiles, and fit statistics.
        """
        obj = _validate_objective(objective) if objective is not None else self._objective
    
        refl_nums = [k[3:] for k in data['coords'].keys() if 'Qz' == k[:2]]
        x = []
        y = []
        dy = []
        original_arrays = []
    
        # Process each reflectivity dataset
        for i in refl_nums:
            x_vals = data['coords'][f'Qz_{i}'].values
            y_vals = data['data'][f'R_{i}'].values
            variances = data['data'][f'R_{i}'].variances
    
            x_out, y_eff, weights, stats = _prepare_fit_arrays(x_vals, y_vals, variances, obj)
    
            if stats['masked'] > 0:
                warnings.warn(
                    f'Masked {stats["masked"]} data point(s) in reflectivity {i} due to zero variance during fitting.',
                    UserWarning,
                )
            if stats.get('transformed_all_points'):
                warnings.warn(
                    f'Applied Mighell transform to all {len(y_vals)} point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
            elif stats['mighell_substituted'] > 0:
>               warnings.warn(
                    f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                    f'zero-variance point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
E               UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <easyreflectometry.fitting.MultiFitter object at 0x7f96889f8890>
data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])
id = 0, objective = None

    def fit(self, data: sc.DataGroup, id: int = 0, objective: str | None = None) -> sc.DataGroup:
        """Perform the fitting and populate the DataGroups with the result.
    
        Parameters
        ----------
        data : sc.DataGroup
            DataGroup to be fitted to and populated.
        id : int, optional
            Unused parameter kept for backward compatibility. By default, 0.
        objective : str | None, optional
            Per-call override for the zero-variance objective.
            If ``None``, uses the instance default set at construction. By default, None.
    
        Returns
        -------
        sc.DataGroup
            A new DataGroup with fitted model curves, SLD profiles, and fit statistics.
        """
        obj = _validate_objective(objective) if objective is not None else self._objective
    
        refl_nums = [k[3:] for k in data['coords'].keys() if 'Qz' == k[:2]]
        x = []
        y = []
        dy = []
        original_arrays = []
    
        # Process each reflectivity dataset
        for i in refl_nums:
            x_vals = data['coords'][f'Qz_{i}'].values
            y_vals = data['data'][f'R_{i}'].values
            variances = data['data'][f'R_{i}'].variances
    
            x_out, y_eff, weights, stats = _prepare_fit_arrays(x_vals, y_vals, variances, obj)
    
            if stats['masked'] > 0:
                warnings.warn(
                    f'Masked {stats["masked"]} data point(s) in reflectivity {i} due to zero variance during fitting.',
                    UserWarning,
                )
            if stats.get('transformed_all_points'):
                warnings.warn(
                    f'Applied Mighell transform to all {len(y_vals)} point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
            elif stats['mighell_substituted'] > 0:
>               warnings.warn(
                    f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                    f'zero-variance point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
E               UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <easyreflectometry.fitting.MultiFitter object at 0x7f8819d950d0>
data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])
id = 0, objective = None

    def fit(self, data: sc.DataGroup, id: int = 0, objective: str | None = None) -> sc.DataGroup:
        """Perform the fitting and populate the DataGroups with the result.
    
        Parameters
        ----------
        data : sc.DataGroup
            DataGroup to be fitted to and populated.
        id : int, optional
            Unused parameter kept for backward compatibility. By default, 0.
        objective : str | None, optional
            Per-call override for the zero-variance objective.
            If ``None``, uses the instance default set at construction. By default, None.
    
        Returns
        -------
        sc.DataGroup
            A new DataGroup with fitted model curves, SLD profiles, and fit statistics.
        """
        obj = _validate_objective(objective) if objective is not None else self._objective
    
        refl_nums = [k[3:] for k in data['coords'].keys() if 'Qz' == k[:2]]
        x = []
        y = []
        dy = []
        original_arrays = []
    
        # Process each reflectivity dataset
        for i in refl_nums:
            x_vals = data['coords'][f'Qz_{i}'].values
            y_vals = data['data'][f'R_{i}'].values
            variances = data['data'][f'R_{i}'].variances
    
            x_out, y_eff, weights, stats = _prepare_fit_arrays(x_vals, y_vals, variances, obj)
    
            if stats['masked'] > 0:
                warnings.warn(
                    f'Masked {stats["masked"]} data point(s) in reflectivity {i} due to zero variance during fitting.',
                    UserWarning,
                )
            if stats.get('transformed_all_points'):
                warnings.warn(
                    f'Applied Mighell transform to all {len(y_vals)} point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
            elif stats['mighell_substituted'] > 0:
>               warnings.warn(
                    f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                    f'zero-variance point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
E               UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <easyreflectometry.fitting.MultiFitter object at 0x7f8cfa125850>
data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])
id = 0, objective = None

    def fit(self, data: sc.DataGroup, id: int = 0, objective: str | None = None) -> sc.DataGroup:
        """Perform the fitting and populate the DataGroups with the result.
    
        Parameters
        ----------
        data : sc.DataGroup
            DataGroup to be fitted to and populated.
        id : int, optional
            Unused parameter kept for backward compatibility. By default, 0.
        objective : str | None, optional
            Per-call override for the zero-variance objective.
            If ``None``, uses the instance default set at construction. By default, None.
    
        Returns
        -------
        sc.DataGroup
            A new DataGroup with fitted model curves, SLD profiles, and fit statistics.
        """
        obj = _validate_objective(objective) if objective is not None else self._objective
    
        refl_nums = [k[3:] for k in data['coords'].keys() if 'Qz' == k[:2]]
        x = []
        y = []
        dy = []
        original_arrays = []
    
        # Process each reflectivity dataset
        for i in refl_nums:
            x_vals = data['coords'][f'Qz_{i}'].values
            y_vals = data['data'][f'R_{i}'].values
            variances = data['data'][f'R_{i}'].variances
    
            x_out, y_eff, weights, stats = _prepare_fit_arrays(x_vals, y_vals, variances, obj)
    
            if stats['masked'] > 0:
                warnings.warn(
                    f'Masked {stats["masked"]} data point(s) in reflectivity {i} due to zero variance during fitting.',
                    UserWarning,
                )
            if stats.get('transformed_all_points'):
                warnings.warn(
                    f'Applied Mighell transform to all {len(y_vals)} point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
            elif stats['mighell_substituted'] > 0:
>               warnings.warn(
                    f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                    f'zero-variance point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
E               UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <easyreflectometry.fitting.MultiFitter object at 0x7f07ad627c20>
data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])
id = 0, objective = None

    def fit(self, data: sc.DataGroup, id: int = 0, objective: str | None = None) -> sc.DataGroup:
        """Perform the fitting and populate the DataGroups with the result.
    
        Parameters
        ----------
        data : sc.DataGroup
            DataGroup to be fitted to and populated.
        id : int, optional
            Unused parameter kept for backward compatibility. By default, 0.
        objective : str | None, optional
            Per-call override for the zero-variance objective.
            If ``None``, uses the instance default set at construction. By default, None.
    
        Returns
        -------
        sc.DataGroup
            A new DataGroup with fitted model curves, SLD profiles, and fit statistics.
        """
        obj = _validate_objective(objective) if objective is not None else self._objective
    
        refl_nums = [k[3:] for k in data['coords'].keys() if 'Qz' == k[:2]]
        x = []
        y = []
        dy = []
        original_arrays = []
    
        # Process each reflectivity dataset
        for i in refl_nums:
            x_vals = data['coords'][f'Qz_{i}'].values
            y_vals = data['data'][f'R_{i}'].values
            variances = data['data'][f'R_{i}'].variances
    
            x_out, y_eff, weights, stats = _prepare_fit_arrays(x_vals, y_vals, variances, obj)
    
            if stats['masked'] > 0:
                warnings.warn(
                    f'Masked {stats["masked"]} data point(s) in reflectivity {i} due to zero variance during fitting.',
                    UserWarning,
                )
            if stats.get('transformed_all_points'):
                warnings.warn(
                    f'Applied Mighell transform to all {len(y_vals)} point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
            elif stats['mighell_substituted'] > 0:
>               warnings.warn(
                    f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                    f'zero-variance point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
E               UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <easyreflectometry.fitting.MultiFitter object at 0x7efef629bd40>
data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])
id = 0, objective = None

    def fit(self, data: sc.DataGroup, id: int = 0, objective: str | None = None) -> sc.DataGroup:
        """Perform the fitting and populate the DataGroups with the result.
    
        Parameters
        ----------
        data : sc.DataGroup
            DataGroup to be fitted to and populated.
        id : int, optional
            Unused parameter kept for backward compatibility. By default, 0.
        objective : str | None, optional
            Per-call override for the zero-variance objective.
            If ``None``, uses the instance default set at construction. By default, None.
    
        Returns
        -------
        sc.DataGroup
            A new DataGroup with fitted model curves, SLD profiles, and fit statistics.
        """
        obj = _validate_objective(objective) if objective is not None else self._objective
    
        refl_nums = [k[3:] for k in data['coords'].keys() if 'Qz' == k[:2]]
        x = []
        y = []
        dy = []
        original_arrays = []
    
        # Process each reflectivity dataset
        for i in refl_nums:
            x_vals = data['coords'][f'Qz_{i}'].values
            y_vals = data['data'][f'R_{i}'].values
            variances = data['data'][f'R_{i}'].variances
    
            x_out, y_eff, weights, stats = _prepare_fit_arrays(x_vals, y_vals, variances, obj)
    
            if stats['masked'] > 0:
                warnings.warn(
                    f'Masked {stats["masked"]} data point(s) in reflectivity {i} due to zero variance during fitting.',
                    UserWarning,
                )
            if stats.get('transformed_all_points'):
                warnings.warn(
                    f'Applied Mighell transform to all {len(y_vals)} point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
            elif stats['mighell_substituted'] > 0:
>               warnings.warn(
                    f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                    f'zero-variance point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
E               UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <easyreflectometry.fitting.MultiFitter object at 0x7f811bb78170>
data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])
id = 0, objective = None

    def fit(self, data: sc.DataGroup, id: int = 0, objective: str | None = None) -> sc.DataGroup:
        """Perform the fitting and populate the DataGroups with the result.
    
        Parameters
        ----------
        data : sc.DataGroup
            DataGroup to be fitted to and populated.
        id : int, optional
            Unused parameter kept for backward compatibility. By default, 0.
        objective : str | None, optional
            Per-call override for the zero-variance objective.
            If ``None``, uses the instance default set at construction. By default, None.
    
        Returns
        -------
        sc.DataGroup
            A new DataGroup with fitted model curves, SLD profiles, and fit statistics.
        """
        obj = _validate_objective(objective) if objective is not None else self._objective
    
        refl_nums = [k[3:] for k in data['coords'].keys() if 'Qz' == k[:2]]
        x = []
        y = []
        dy = []
        original_arrays = []
    
        # Process each reflectivity dataset
        for i in refl_nums:
            x_vals = data['coords'][f'Qz_{i}'].values
            y_vals = data['data'][f'R_{i}'].values
            variances = data['data'][f'R_{i}'].variances
    
            x_out, y_eff, weights, stats = _prepare_fit_arrays(x_vals, y_vals, variances, obj)
    
            if stats['masked'] > 0:
                warnings.warn(
                    f'Masked {stats["masked"]} data point(s) in reflectivity {i} due to zero variance during fitting.',
                    UserWarning,
                )
            if stats.get('transformed_all_points'):
                warnings.warn(
                    f'Applied Mighell transform to all {len(y_vals)} point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
            elif stats['mighell_substituted'] > 0:
>               warnings.warn(
                    f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                    f'zero-variance point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
E               UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <easyreflectometry.fitting.MultiFitter object at 0x7f4b90ba52e0>
data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])
id = 0, objective = None

    def fit(self, data: sc.DataGroup, id: int = 0, objective: str | None = None) -> sc.DataGroup:
        """Perform the fitting and populate the DataGroups with the result.
    
        Parameters
        ----------
        data : sc.DataGroup
            DataGroup to be fitted to and populated.
        id : int, optional
            Unused parameter kept for backward compatibility. By default, 0.
        objective : str | None, optional
            Per-call override for the zero-variance objective.
            If ``None``, uses the instance default set at construction. By default, None.
    
        Returns
        -------
        sc.DataGroup
            A new DataGroup with fitted model curves, SLD profiles, and fit statistics.
        """
        obj = _validate_objective(objective) if objective is not None else self._objective
    
        refl_nums = [k[3:] for k in data['coords'].keys() if 'Qz' == k[:2]]
        x = []
        y = []
        dy = []
        original_arrays = []
    
        # Process each reflectivity dataset
        for i in refl_nums:
            x_vals = data['coords'][f'Qz_{i}'].values
            y_vals = data['data'][f'R_{i}'].values
            variances = data['data'][f'R_{i}'].variances
    
            x_out, y_eff, weights, stats = _prepare_fit_arrays(x_vals, y_vals, variances, obj)
    
            if stats['masked'] > 0:
                warnings.warn(
                    f'Masked {stats["masked"]} data point(s) in reflectivity {i} due to zero variance during fitting.',
                    UserWarning,
                )
            if stats.get('transformed_all_points'):
                warnings.warn(
                    f'Applied Mighell transform to all {len(y_vals)} point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
            elif stats['mighell_substituted'] > 0:
>               warnings.warn(
                    f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                    f'zero-variance point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
E               UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning

View job log here


UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning
Full output
load_data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])

    @pytest.fixture(scope="module")
    def fit_model(load_data):
        data = load_data
        # Rescale data
        reflectivity = data["data"]["R_0"].values
        scale_factor = 1 / np.max(reflectivity)
        data["data"]["R_0"].values *= scale_factor
    
        # Create a model for the sample
    
        si = Material(sld=2.07, isld=0.0, name="Si")
        sio2 = Material(sld=3.47, isld=0.0, name="SiO2")
        d2o = Material(sld=6.33, isld=0.0, name="D2O")
        dlipids = Material(sld=5.0, isld=0.0, name="DLipids")
    
        superphase = Layer(material=si, thickness=0, roughness=0, name="Si superphase")
        sio2_layer = Layer(material=sio2, thickness=20, roughness=4, name="SiO2 layer")
        dlipids_layer = Layer(
            material=dlipids, thickness=40, roughness=4, name="DLipids layer"
        )
        subphase = Layer(material=d2o, thickness=0, roughness=5, name="D2O subphase")
    
        multi_sample = Sample(
            Multilayer(superphase),
            Multilayer(sio2_layer),
            Multilayer(dlipids_layer),
            Multilayer(subphase),
            name="Multilayer Structure",
        )
    
        multi_layer_model = Model(
            sample=multi_sample,
            scale=1,
            background=0.000001,
            resolution_function=PercentageFwhm(0),
            name="Multilayer Model",
        )
    
        # Set the fitting parameters
    
        sio2_layer.roughness.bounds = (3, 12)
        sio2_layer.material.sld.bounds = (3.47, 5)
        sio2_layer.thickness.bounds = (10, 30)
    
        subphase.material.sld.bounds = (6, 6.35)
        dlipids_layer.thickness.bounds = (30, 60)
        dlipids_layer.roughness.bounds = (3, 10)
        dlipids_layer.material.sld.bounds = (4, 6)
        multi_layer_model.scale.bounds = (0.8, 1.2)
        multi_layer_model.background.bounds = (1e-6, 1e-3)
    
        sio2_layer.roughness.free = True
        sio2_layer.material.sld.free = True
        sio2_layer.thickness.free = True
        subphase.material.sld.free = True
        dlipids_layer.thickness.free = True
        dlipids_layer.roughness.free = True
        dlipids_layer.material.sld.free = True
        multi_layer_model.scale.free = True
        multi_layer_model.background.free = True
    
        # Run the model and plot the results
    
        multi_layer_model.interface = CalculatorFactory()
    
        fitter1 = MultiFitter(multi_layer_model)
        fitter1.switch_minimizer(AvailableMinimizers.Bumps_simplex)
    
>       analysed = fitter1.fit(data)
                   ^^^^^^^^^^^^^^^^^

tests/scipp-analysis/estia/ort_file_test.py:109: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <easyreflectometry.fitting.MultiFitter object at 0x7f901acc92e0>
data = DataGroup(sizes={}, keys=[
    data: {'R_0': <scipp.Variable> (Qz_0: 189)    float64  [dimensionless]  [0.927488, 0.95...ame': 'sQz', 'unit': '1/angstrom', 'physical_quantity': 'standard deviation of wavevector transfer resolution'}]}}},
])
id = 0, objective = None

    def fit(self, data: sc.DataGroup, id: int = 0, objective: str | None = None) -> sc.DataGroup:
        """Perform the fitting and populate the DataGroups with the result.
    
        Parameters
        ----------
        data : sc.DataGroup
            DataGroup to be fitted to and populated.
        id : int, optional
            Unused parameter kept for backward compatibility. By default, 0.
        objective : str | None, optional
            Per-call override for the zero-variance objective.
            If ``None``, uses the instance default set at construction. By default, None.
    
        Returns
        -------
        sc.DataGroup
            A new DataGroup with fitted model curves, SLD profiles, and fit statistics.
        """
        obj = _validate_objective(objective) if objective is not None else self._objective
    
        refl_nums = [k[3:] for k in data['coords'].keys() if 'Qz' == k[:2]]
        x = []
        y = []
        dy = []
        original_arrays = []
    
        # Process each reflectivity dataset
        for i in refl_nums:
            x_vals = data['coords'][f'Qz_{i}'].values
            y_vals = data['data'][f'R_{i}'].values
            variances = data['data'][f'R_{i}'].variances
    
            x_out, y_eff, weights, stats = _prepare_fit_arrays(x_vals, y_vals, variances, obj)
    
            if stats['masked'] > 0:
                warnings.warn(
                    f'Masked {stats["masked"]} data point(s) in reflectivity {i} due to zero variance during fitting.',
                    UserWarning,
                )
            if stats.get('transformed_all_points'):
                warnings.warn(
                    f'Applied Mighell transform to all {len(y_vals)} point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
            elif stats['mighell_substituted'] > 0:
>               warnings.warn(
                    f'Applied Mighell substitution to {stats["mighell_substituted"]} '
                    f'zero-variance point(s) in reflectivity {i} during fitting.',
                    UserWarning,
                )
E               UserWarning: Applied Mighell substitution to 11 zero-variance point(s) in reflectivity 0 during fitting.

.tox/scipp-analysis-estia/lib/python3.12/site-packages/easyreflectometry/fitting.py:245: UserWarning