• R/O
  • HTTP
  • SSH
  • HTTPS

Molby: コミット

Molecular Modeling Software


コミットメタ情報

リビジョンffed1e9b988eda46e7bf88d8a95752c155b3a099 (tree)
日時2021-12-23 23:54:23
作者Toshi Nagata <alchemist.2005@nift...>
コミッターToshi Nagata

ログメッセージ

Import CIF is improved (newer CIF can now be read)

変更サマリ

差分

--- a/Scripts/loadsave.rb
+++ b/Scripts/loadsave.rb
@@ -835,6 +835,7 @@ end_of_header
835835 while true
836836 warn_message = ""
837837 verbose = nil
838+ verbose = true
838839 bond_defined = false
839840 special_positions = []
840841 mol.remove(All)
@@ -845,11 +846,9 @@ end_of_header
845846 calculated_atoms = []
846847 while token != nil
847848 if token =~ /^\#data_/i
848- if token.casecmp("#data_global") == 0
849- token = getciftoken(fp)
850- next
851- elsif data_identifier == nil
852- # Continue processing of this molecule
849+ if data_identifier == nil || mol.natoms == 0
850+ # First block or no atoms yet
851+ # Continue processing of this molecule
853852 data_identifier = token
854853 token = getciftoken(fp)
855854 next
@@ -875,9 +874,9 @@ end_of_header
875874 end
876875 if cell.length == 12 && cell.all?
877876 mol.cell = cell
878- puts "Unit cell is set to #{cell.inspect}." if verbose
877+ puts "Unit cell is set to #{mol.cell.inspect}." if verbose
879878 cell = []
880- cell_trans = self.cell_transform
879+ cell_trans = mol.cell_transform
881880 cell_trans_inv = cell_trans.inverse
882881 end
883882 token = getciftoken(fp)
@@ -887,7 +886,7 @@ end_of_header
887886 while (token = getciftoken(fp)) && token[0] == ?_
888887 labels.push(token)
889888 end
890- if labels[0] =~ /symmetry_equiv_pos|atom_site_label|atom_site_aniso_label|geom_bond/
889+ if labels[0] =~ /symmetry_equiv_pos|space_group_symop|atom_site_label|atom_site_aniso_label|geom_bond/
891890 hlabel = Hash.new(-10000000)
892891 labels.each_with_index { |lb, i|
893892 hlabel[lb] = i
@@ -904,9 +903,9 @@ end_of_header
904903 end
905904 token = getciftoken(fp)
906905 end
907- if labels[0] =~ /^_symmetry_equiv_pos/
906+ if labels[0] =~ /^_symmetry_equiv_pos/ || labels[0] =~ /^_space_group_symop/
908907 data.each { |d|
909- symstr = d[hlabel["_symmetry_equiv_pos_as_xyz"]]
908+ symstr = d[hlabel["_symmetry_equiv_pos_as_xyz"]] || d[hlabel["_space_group_symop_operation_xyz"]]
910909 symstr.delete("\"\'")
911910 exps = symstr.split(/,/)
912911 sym = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
@@ -1053,7 +1052,9 @@ end_of_header
10531052 }
10541053 end
10551054 }
1056- bond_defined = true
1055+ if mol.nbonds > 0
1056+ bond_defined = true
1057+ end
10571058 puts "#{mol.nbonds} bonds are created." if verbose
10581059 if calculated_atoms.length > 0
10591060 # Guess bonds for calculated hydrogen atoms
旧リポジトリブラウザで表示