From 12d35a3a2f14a71dc6f981adc07c848ecb21946e Mon Sep 17 00:00:00 2001 From: minhuanli Date: Sun, 12 Nov 2023 18:19:19 -0500 Subject: [PATCH] import future annotations for 3.8 and 3.9 --- SFC_Torch/Fmodel.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/SFC_Torch/Fmodel.py b/SFC_Torch/Fmodel.py index 7485269..53d6d3e 100644 --- a/SFC_Torch/Fmodel.py +++ b/SFC_Torch/Fmodel.py @@ -1,3 +1,4 @@ + """ Calculate Structural Factor from an atomic model: F_model = k_total * (F_calc + k_mask * F_mask) @@ -8,12 +9,12 @@ Written in PyTorch """ +from __future__ import annotations __author__ = "Minhuan Li" __email__ = "minhuanli@g.harvard.edu" from typing import Optional, List - import gemmi import time import numpy as np @@ -40,13 +41,13 @@ def __init__( mtzdata: str | rs.DataSet = None, n_bins: int = 10, dmin: Optional[float] = None, - anomalous: bool=False, - wavelength: Optional[float]=None, - set_experiment: bool=True, - expcolumns: List[str]=["FP", "SIGFP"], - freeflag: str="FreeR_flag", - testset_value: int=0, - device: torch.device=try_gpu() + anomalous: bool = False, + wavelength: Optional[float] = None, + set_experiment: bool = True, + expcolumns: List[str] = ["FP", "SIGFP"], + freeflag: str = "FreeR_flag", + testset_value: int = 0, + device: torch.device = try_gpu() ) -> None: """ Initialize with necessary reusable information, like spacegroup, unit cell info, HKL_list, et.c.