Skip to content

Commit f602d15

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 8aa4aba commit f602d15

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

baseline/indexer/index_module.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#include <nanobind/eigen/dense.h>
22
#include <nanobind/nanobind.h>
33
#include <nanobind/stl/array.h>
4+
#include <nanobind/stl/string.h>
45
#include <nanobind/stl/tuple.h>
56
#include <nanobind/stl/vector.h>
6-
#include <nanobind/stl/string.h>
77

88
#include <dx2/crystal.hpp>
99
#include <dx2/detector.hpp>
@@ -222,7 +222,9 @@ NB_MODULE(index, m) {
222222
.def_prop_ro("delpsi", [](const IndexingResult &r) { return r.delpsi; })
223223
.def_prop_ro("rmsds", [](const IndexingResult &r) { return r.rmsds; });
224224
m.def("make_panel", &make_panel, "Create a configured Panel object");
225-
m.def("calculate_mu_for_material_at_wavelength", &calculate_mu_for_material_at_wavelength, "Calculate the absorption coefficient from material and wavelength");
225+
m.def("calculate_mu_for_material_at_wavelength",
226+
&calculate_mu_for_material_at_wavelength,
227+
"Calculate the absorption coefficient from material and wavelength");
226228
m.def("ssx_xyz_to_rlp",
227229
&ssx_xyz_to_rlp,
228230
nb::arg("xyzobs_px"),

src/ffs/service.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
import time
1212
from datetime import datetime
1313
from pathlib import Path
14-
from typing import Iterator, Optional, Union, Literal
15-
import pydantic
14+
from typing import Iterator, Literal, Optional, Union
1615

1716
import gemmi
1817
import numpy as np
18+
import pydantic
1919
import workflows.recipe
20-
from pydantic import BaseModel, ValidationError, Field
20+
from pydantic import BaseModel, Field, ValidationError
2121
from rich.logging import RichHandler
2222
from workflows.services.common_service import CommonService
2323

@@ -73,12 +73,14 @@ class DetectorParameters(BaseModel):
7373
_mu_cache: dict = {}
7474

7575
class Config:
76-
extra = "forbid" # Don't allow instantiation of this base class
76+
extra = "forbid" # Don't allow instantiation of this base class
7777

7878
def calculate_mu(self, wavelength: float) -> float:
7979
if wavelength not in self._mu_cache:
80-
self._mu_cache[wavelength] = ffs.index.calculate_mu_for_material_at_wavelength(
81-
self.material, wavelength
80+
self._mu_cache[wavelength] = (
81+
ffs.index.calculate_mu_for_material_at_wavelength(
82+
self.material, wavelength
83+
)
8284
)
8385
return self._mu_cache[wavelength]
8486

@@ -92,6 +94,7 @@ class Eiger16M(DetectorParameters):
9294
image_size_x: int = 4148
9395
image_size_y: int = 4362
9496

97+
9598
class Eiger4M(DetectorParameters):
9699
type: Literal["Eiger4M"]
97100
thickness: float = 0.45
@@ -279,7 +282,7 @@ def gpu_per_image_analysis(
279282
distance=parameters.detector_distance,
280283
beam_center_x=parameters.xBeam,
281284
beam_center_y=parameters.yBeam,
282-
detector={"type" : parameters.detector},
285+
detector={"type": parameters.detector},
283286
)
284287
self.log.debug("{detector_geometry.to_json()=}")
285288
except ValidationError as e:

0 commit comments

Comments
 (0)