We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
def unitcell_from_cif(pars): import re regex_a = r'_cell_length_a\s+([\d.]+)' regex_b = r'_cell_length_b\s+([\d.]+)' regex_c = r'_cell_length_c\s+([\d.]+)' regex_alpha = r'_cell_angle_alpha\s+([\d.]+)' regex_beta = r'_cell_angle_beta\s+([\d.]+)' regex_gamma = r'_cell_angle_gamma\s+([\d.]+)' regex_space_group = r'_symmetry_space_group_name_H-M\s*'".*['"]' with open(pars, 'r') as pars: pars = pars.read() cell = unitcell([ float(re.search(regex_a, pars).group(1)), float(re.search(regex_b, pars).group(1)), float(re.search(regex_c, pars).group(1)), float(re.search(regex_alpha, pars).group(1)), float(re.search(regex_beta, pars).group(1)), float(re.search(regex_gamma, pars).group(1)), ], re.search(regex_space_group, pars).group(1)) return cell
The text was updated successfully, but these errors were encountered:
No branches or pull requests
def unitcell_from_cif(pars):
import re
regex_a = r'_cell_length_a\s+([\d.]+)'
regex_b = r'_cell_length_b\s+([\d.]+)'
regex_c = r'_cell_length_c\s+([\d.]+)'
regex_alpha = r'_cell_angle_alpha\s+([\d.]+)'
regex_beta = r'_cell_angle_beta\s+([\d.]+)'
regex_gamma = r'_cell_angle_gamma\s+([\d.]+)'
regex_space_group = r'_symmetry_space_group_name_H-M\s*'".*['"]'
with open(pars, 'r') as pars:
pars = pars.read()
cell = unitcell([
float(re.search(regex_a, pars).group(1)),
float(re.search(regex_b, pars).group(1)),
float(re.search(regex_c, pars).group(1)),
float(re.search(regex_alpha, pars).group(1)),
float(re.search(regex_beta, pars).group(1)),
float(re.search(regex_gamma, pars).group(1)),
],
re.search(regex_space_group, pars).group(1))
return cell
The text was updated successfully, but these errors were encountered: