Skip to content

Commit 96798de

Browse files
author
HatPdotS
committed
Fixed reflection data being created on CPU when creating refinement on GPU
1 parent 4eff0f6 commit 96798de

6 files changed

Lines changed: 11 additions & 6 deletions

File tree

docs/changelog.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Changelog
22
=========
33

4+
Version 0.4.2
5+
-------------
6+
7+
- Fixed bug where reflection data object in the refinement was not created on cuda when specified.
8+
49
Version 0.4.1
510
-------------
611

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "torchref"
7-
version = "0.4.1"
7+
version = "0.4.2"
88
description = "Pytorch based crystallographic refinement"
99
readme = "README.md"
1010
requires-python = ">=3.10"

torchref/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
General utilities and debugging tools.
4848
"""
4949

50-
__version__ = "0.4.1"
50+
__version__ = "0.4.2"
5151

5252

5353
import os

torchref/model/sf_fft.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,8 @@ def map_to_structure_factors(
533533
from torchref.base.reciprocal import ReciprocalSymmetryExtractor
534534
grid_shape = tuple(int(x) for x in self.gridsize)
535535
self._sym_extractor = ReciprocalSymmetryExtractor(
536-
hkl, self.spacegroup, grid_shape, device=hkl.device,
536+
hkl, self.spacegroup, grid_shape,
537+
device=reciprocal_space_grid.device,
537538
)
538539
self._sym_extractor_hkl_id = id(hkl)
539540
return self._sym_extractor.extract_from_grid(reciprocal_space_grid)

torchref/refinement/base_refinement.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def __init__(
142142
try:
143143
self.to(self.device)
144144
if isinstance(data_file, str):
145-
self.reflection_data = ReflectionData(verbose=self.verbose)
145+
self.reflection_data = ReflectionData(verbose=self.verbose, device=self.device)
146146
if data_file.endswith(".mtz"):
147147
self.reflection_data.load_mtz(data_file)
148148
elif data_file.endswith(".cif"):

torchref/restraints/library.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
----------
1414
Long, F., et al. (2017). AceDRG: a stereochemical description generator
1515
for ligands. Acta Cryst. D73, 112-122.
16-
Sherri, L.N., et al. (2018). Updated CCP4 Monomer Library.
17-
Acta Cryst. D74, 641-655.
16+
1817
"""
1918

2019
import os

0 commit comments

Comments
 (0)