From f6b9651c7c6ffc6be21566189b7b04563bd38a77 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 24 Oct 2024 08:23:08 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/pyFAI/integrator/fiber.py | 18 +++++++++--------- src/pyFAI/test/test_fiber_integrator.py | 6 ++---- src/pyFAI/units.py | 4 ++-- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/pyFAI/integrator/fiber.py b/src/pyFAI/integrator/fiber.py index 102d44514..d939b5b7a 100644 --- a/src/pyFAI/integrator/fiber.py +++ b/src/pyFAI/integrator/fiber.py @@ -56,7 +56,7 @@ def tilt_angle(self): @property def sample_orientation(self): return self._cache_parameters.get('sample_orientation', 1) - + def parse_units(self, unit_ip, unit_oop, incident_angle=None, tilt_angle=None, sample_orientation=None): if unit_ip is None: unit_ip = units.get_unit_fiber("qip_nm^-1") @@ -175,7 +175,7 @@ def integrate_fiber(self, data, unit_ip, unit_oop = self.parse_units(unit_ip=unit_ip, unit_oop=unit_oop, sample_orientation=sample_orientation) - + self.reset_integrator(incident_angle=unit_ip.incident_angle, tilt_angle=unit_ip.tilt_angle, sample_orientation=unit_ip.sample_orientation) @@ -243,7 +243,7 @@ def integrate_fiber(self, data, return result - def integrate_grazing_incidence(self, data, + def integrate_grazing_incidence(self, data, npt_ip, ip_range=None, unit_ip=None, npt_oop=1000, oop_range=None, unit_oop=None, vertical_integration = True, @@ -296,11 +296,11 @@ def integrate_grazing_incidence(self, data, incident_angle=incident_angle, tilt_angle=tilt_angle, sample_orientation=sample_orientation) - + self.reset_integrator(incident_angle=unit_ip.incident_angle, tilt_angle=unit_ip.tilt_angle, sample_orientation=unit_ip.sample_orientation) - + return self.integrate_fiber(data=data, npt_oop=npt_oop, unit_oop=unit_oop, oop_range=oop_range, npt_ip=npt_ip, unit_ip=unit_ip, ip_range=ip_range, @@ -312,7 +312,7 @@ def integrate_grazing_incidence(self, data, polarization_factor=polarization_factor, dark=dark, flat=flat, method=method, normalization_factor=normalization_factor) - + def integrate2d_fiber(self, data, npt_ip=1000, unit_ip=None, ip_range=None, @@ -346,11 +346,11 @@ def integrate2d_fiber(self, data, unit_ip, unit_oop = self.parse_units(unit_ip=unit_ip, unit_oop=unit_oop, sample_orientation=sample_orientation) - + self.reset_integrator(incident_angle=unit_ip.incident_angle, tilt_angle=unit_ip.tilt_angle, sample_orientation=unit_ip.sample_orientation) - + if (isinstance(method, (tuple, list)) and method[0] != "no") or (isinstance(method, IntegrationMethod) and method.split != "no"): logger.warning(f"Method {method} is using a pixel-splitting scheme. GI integration should be use WITHOUT PIXEL-SPLITTING! The results could be wrong!") @@ -401,7 +401,7 @@ def integrate2d_grazing_incidence(self, data, incident_angle=incident_angle, tilt_angle=tilt_angle, sample_orientation=sample_orientation) - + self.reset_integrator(incident_angle=unit_ip.incident_angle, tilt_angle=unit_ip.tilt_angle, sample_orientation=unit_ip.sample_orientation) diff --git a/src/pyFAI/test/test_fiber_integrator.py b/src/pyFAI/test/test_fiber_integrator.py index 7182cba43..8c18985ed 100644 --- a/src/pyFAI/test/test_fiber_integrator.py +++ b/src/pyFAI/test/test_fiber_integrator.py @@ -161,7 +161,7 @@ def test_integrate1d_grazing_parameters(self): tilt_angle=tilt_angle, sample_orientation=sample_orientation, ) - + res1d_string_units = self.fi.integrate_grazing_incidence(data=self.data, npt_ip=npt_ip, unit_ip="qip_nm^-1", unit_oop="qoop_nm^-1", incident_angle=incident_angle, @@ -182,7 +182,7 @@ def test_integrate1d_grazing_parameters(self): self.assertEqual(abs(res1d_ref.radial - res1d_fiber_units.radial).max(), 0) self.assertEqual(abs(res1d_ref.intensity - res1d_fiber_units.intensity).max(), 0) - + # def test_integrate1d_priority(self): npt_ip = 500 @@ -218,5 +218,3 @@ def test_integrate1d_grazing_parameters(self): self.assertFalse(abs(res1d_ref.radial - res1d_wrong.radial).max(), 0) self.assertFalse(abs(res1d_ref.intensity - res1d_wrong.intensity).max(), 0) - - diff --git a/src/pyFAI/units.py b/src/pyFAI/units.py index e6566e1a5..58ae3a93d 100644 --- a/src/pyFAI/units.py +++ b/src/pyFAI/units.py @@ -174,12 +174,12 @@ def __init__(self, name, scale=1, label=None, equation=None, formula=None, def __repr__(self): return f""" -{self.name} +{self.name} Incident_angle={self.incident_angle}\u00b0 Tilt_angle={self.tilt_angle}\u00b0 Sample orientation={self.sample_orientation} """ - + @property def incident_angle(self): return self._incident_angle