Skip to content

Commit

Permalink
deploy: 2968cdf
Browse files Browse the repository at this point in the history
  • Loading branch information
robinzyb committed Dec 29, 2023
1 parent 9d2dc3d commit a166573
Show file tree
Hide file tree
Showing 23 changed files with 161 additions and 162 deletions.
2 changes: 1 addition & 1 deletion _modules/cp2kdata/block_parser/atomic_kind.html
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ <h1>Source code for cp2kdata.block_parser.atomic_kind</h1><div class="highlight"
<span class="k">for</span> <span class="n">match</span> <span class="ow">in</span> <span class="n">ATOMIC_KINDS_RE</span><span class="o">.</span><span class="n">finditer</span><span class="p">(</span><span class="n">output_file</span><span class="p">):</span>
<span class="n">atomic_kinds</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">match</span><span class="p">[</span><span class="s2">&quot;atomic_kind&quot;</span><span class="p">])</span>
<span class="k">if</span> <span class="n">atomic_kinds</span><span class="p">:</span>
<span class="c1"># only return the last atomic kinds </span>
<span class="c1"># only return the last atomic kinds</span>
<span class="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">atomic_kinds</span><span class="p">[</span><span class="o">-</span><span class="n">num_atomic_kinds_list</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]:],</span> <span class="n">dtype</span><span class="o">=</span><span class="nb">str</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">return</span> <span class="kc">None</span></div>
Expand Down
20 changes: 10 additions & 10 deletions _modules/cp2kdata/block_parser/cells.html
Original file line number Diff line number Diff line change
Expand Up @@ -388,20 +388,20 @@ <h1>Source code for cp2kdata.block_parser.cells</h1><div class="highlight"><pre>
<span class="n">ALL_CELL_RE</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">compile</span><span class="p">(</span>
<span class="w"> </span><span class="sa">r</span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> \s+CELL\|\sVector\sa\s\[angstrom\]:</span>
<span class="sd"> \s+(?P&lt;xx&gt;[\s-]\d+\.\d+) </span>
<span class="sd"> \s+(?P&lt;xy&gt;[\s-]\d+\.\d+) </span>
<span class="sd"> \s+(?P&lt;xx&gt;[\s-]\d+\.\d+)</span>
<span class="sd"> \s+(?P&lt;xy&gt;[\s-]\d+\.\d+)</span>
<span class="sd"> \s+(?P&lt;xz&gt;[\s-]\d+\.\d+)</span>
<span class="sd"> \s+\|a\|\s+=\s+\S+</span>
<span class="sd"> \n</span>
<span class="sd"> \s+CELL\|\sVector\sb\s\[angstrom\]:</span>
<span class="sd"> \s+(?P&lt;yx&gt;[\s-]\d+\.\d+) </span>
<span class="sd"> \s+(?P&lt;yy&gt;[\s-]\d+\.\d+) </span>
<span class="sd"> \s+(?P&lt;yx&gt;[\s-]\d+\.\d+)</span>
<span class="sd"> \s+(?P&lt;yy&gt;[\s-]\d+\.\d+)</span>
<span class="sd"> \s+(?P&lt;yz&gt;[\s-]\d+\.\d+)</span>
<span class="sd"> \s+\|b\|\s+=\s+\S+</span>
<span class="sd"> \n</span>
<span class="sd"> \s+CELL\|\sVector\sc\s\[angstrom\]:</span>
<span class="sd"> \s+(?P&lt;zx&gt;[\s-]\d+\.\d+) </span>
<span class="sd"> \s+(?P&lt;zy&gt;[\s-]\d+\.\d+) </span>
<span class="sd"> \s+(?P&lt;zx&gt;[\s-]\d+\.\d+)</span>
<span class="sd"> \s+(?P&lt;zy&gt;[\s-]\d+\.\d+)</span>
<span class="sd"> \s+(?P&lt;zz&gt;[\s-]\d+\.\d+)</span>
<span class="sd"> \s+\|c\|\s+=\s+\S+</span>
<span class="sd"> \n</span>
Expand All @@ -424,7 +424,7 @@ <h1>Source code for cp2kdata.block_parser.cells</h1><div class="highlight"><pre>
<span class="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">all_cells</span><span class="p">,</span> <span class="n">dtype</span><span class="o">=</span><span class="nb">float</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">return</span> <span class="kc">None</span></div>

<span class="n">ALL_MD_CELL_RE_V7</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">compile</span><span class="p">(</span>
<span class="w"> </span><span class="sa">r</span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> \sCELL\sLNTHS\[bohr\]\s{13}=\s</span>
Expand Down Expand Up @@ -454,22 +454,22 @@ <h1>Source code for cp2kdata.block_parser.cells</h1><div class="highlight"><pre>
<span class="sd"> #skip three lines</span>
<span class="sd"> (.{80}\n){3}</span>
<span class="sd"> #parse angles</span>
<span class="sd"> (\sMD\|\sCell\sangles\s\[deg\]\s{10} </span>
<span class="sd"> (\sMD\|\sCell\sangles\s\[deg\]\s{10}</span>
<span class="sd"> \s{2}(?P&lt;alpha&gt;\d\.\d{8}E(\+|\-)\d{2})</span>
<span class="sd"> \s{2}(?P&lt;beta&gt;\d\.\d{8}E(\+|\-)\d{2})</span>
<span class="sd"> \s{2}(?P&lt;gamma&gt;\d\.\d{8}E(\+|\-)\d{2}))?</span>
<span class="sd"> &quot;&quot;&quot;</span><span class="p">,</span>
<span class="n">re</span><span class="o">.</span><span class="n">VERBOSE</span>
<span class="p">)</span>

<div class="viewcode-block" id="parse_all_md_cells"><a class="viewcode-back" href="../../../_api/cp2kdata.block_parser.cells.html#cp2kdata.block_parser.cells.parse_all_md_cells">[docs]</a><span class="k">def</span> <span class="nf">parse_all_md_cells</span><span class="p">(</span><span class="n">output_file</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">],</span>
<div class="viewcode-block" id="parse_all_md_cells"><a class="viewcode-back" href="../../../_api/cp2kdata.block_parser.cells.html#cp2kdata.block_parser.cells.parse_all_md_cells">[docs]</a><span class="k">def</span> <span class="nf">parse_all_md_cells</span><span class="p">(</span><span class="n">output_file</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">],</span>
<span class="n">cp2k_info</span><span class="p">:</span> <span class="n">Cp2kInfo</span><span class="p">,</span>
<span class="n">init_cell_info</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="c1"># init_cell_info are used for npt_I parse.</span>
<span class="c1"># because npt_I doesn&#39;t include angle info in MD| block</span>

<span class="c1"># notice that the cell of step 0 is excluded from MD| block</span>

<span class="c1"># choose parser according to cp2k_info.version</span>
<span class="k">if</span> <span class="n">cp2k_info</span><span class="o">.</span><span class="n">version</span> <span class="ow">in</span> <span class="p">[</span><span class="s1">&#39;2023.1&#39;</span><span class="p">]:</span>
<span class="n">ALL_MD_CELL_RE</span> <span class="o">=</span> <span class="n">ALL_MD_CELL_RE_V2023</span>
Expand Down
4 changes: 2 additions & 2 deletions _modules/cp2kdata/block_parser/converge.html
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ <h1>Source code for cp2kdata.block_parser.converge</h1><div class="highlight"><p
<span class="n">info_dict</span> <span class="o">=</span> <span class="n">regrep</span><span class="p">(</span>
<span class="n">filename</span><span class="o">=</span><span class="n">filename</span><span class="p">,</span>
<span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="n">patterns</span><span class="o">=</span><span class="p">{</span><span class="s2">&quot;converge&quot;</span><span class="p">:</span> <span class="n">CONVERGE_PATTERN</span><span class="p">},</span>
<span class="n">patterns</span><span class="o">=</span><span class="p">{</span><span class="s2">&quot;converge&quot;</span><span class="p">:</span> <span class="n">CONVERGE_PATTERN</span><span class="p">},</span>
<span class="n">terminate_on_match</span><span class="o">=</span><span class="kc">True</span>
<span class="p">)</span>

Expand All @@ -411,7 +411,7 @@ <h1>Source code for cp2kdata.block_parser.converge</h1><div class="highlight"><p
<span class="n">info_dict</span> <span class="o">=</span> <span class="n">regrep</span><span class="p">(</span>
<span class="n">filename</span><span class="o">=</span><span class="n">filename</span><span class="p">,</span>
<span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="n">patterns</span><span class="o">=</span><span class="p">{</span><span class="s2">&quot;converge&quot;</span><span class="p">:</span> <span class="n">CONVERGE_PATTERN</span><span class="p">},</span>
<span class="n">patterns</span><span class="o">=</span><span class="p">{</span><span class="s2">&quot;converge&quot;</span><span class="p">:</span> <span class="n">CONVERGE_PATTERN</span><span class="p">},</span>
<span class="n">terminate_on_match</span><span class="o">=</span><span class="kc">False</span>
<span class="p">)</span></div>
<span class="c1">#print(info_dict[&#39;converge&#39;])</span>
Expand Down
14 changes: 7 additions & 7 deletions _modules/cp2kdata/block_parser/dipole.html
Original file line number Diff line number Diff line change
Expand Up @@ -407,14 +407,14 @@ <h1>Source code for cp2kdata.block_parser.dipole</h1><div class="highlight"><pre

<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Reference Point [Bohr] 0.00000000 0.00000000 0.00000000</span>
<span class="sd"> Charges </span>
<span class="sd"> Charges</span>
<span class="sd"> Electronic= 864.00000000 Core= -864.00000000 Total= 0.00000000</span>
<span class="sd"> Dipole vectors are based on the periodic (Berry phase) operator. </span>
<span class="sd"> They are defined modulo integer multiples of the cell matrix [Debye]. </span>
<span class="sd"> [X] [ 46.55265580 0.00000000 0.00000000 ] [i] </span>
<span class="sd"> [Y]=[ 0.00000000 54.46353324 0.00000000 ]*[j] </span>
<span class="sd"> [Z] [ 0.00000000 0.00000000 54.47313965 ] [k] </span>
<span class="sd"> Dipole moment [Debye] </span>
<span class="sd"> Dipole vectors are based on the periodic (Berry phase) operator.</span>
<span class="sd"> They are defined modulo integer multiples of the cell matrix [Debye].</span>
<span class="sd"> [X] [ 46.55265580 0.00000000 0.00000000 ] [i]</span>
<span class="sd"> [Y]=[ 0.00000000 54.46353324 0.00000000 ]*[j]</span>
<span class="sd"> [Z] [ 0.00000000 0.00000000 54.47313965 ] [k]</span>
<span class="sd"> Dipole moment [Debye]</span>
<span class="sd"> X= -0.07183634 Y= -0.07690441 Z= 1.13302571 Total= 1.13790246</span>
<span class="sd">&quot;&quot;&quot;</span>
</pre></div>
Expand Down
2 changes: 1 addition & 1 deletion _modules/cp2kdata/block_parser/errors_handle.html
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ <h1>Source code for cp2kdata.block_parser.errors_handle</h1><div class="highligh

<div class="viewcode-block" id="parse_errors"><a class="viewcode-back" href="../../../_api/cp2kdata.block_parser.errors_handle.html#cp2kdata.block_parser.errors_handle.parse_errors">[docs]</a><span class="k">def</span> <span class="nf">parse_errors</span><span class="p">(</span><span class="n">output_file</span><span class="p">):</span>
<span class="n">errors_info</span> <span class="o">=</span> <span class="p">{}</span>

<span class="k">for</span> <span class="n">match</span> <span class="ow">in</span> <span class="n">EXCEED_WALL_TIME_RE</span><span class="o">.</span><span class="n">finditer</span><span class="p">(</span><span class="n">output_file</span><span class="p">):</span>
<span class="c1">#print(match)</span>
<span class="k">if</span> <span class="n">match</span><span class="p">:</span>
Expand Down
22 changes: 11 additions & 11 deletions _modules/cp2kdata/block_parser/header_info.html
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,8 @@ <h1>Source code for cp2kdata.block_parser.header_info</h1><div class="highlight"
<div class="viewcode-block" id="parse_cp2k_info"><a class="viewcode-back" href="../../../_api/cp2kdata.block_parser.header_info.html#cp2kdata.block_parser.header_info.parse_cp2k_info">[docs]</a><span class="k">def</span> <span class="nf">parse_cp2k_info</span><span class="p">(</span><span class="n">filename</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Cp2kInfo</span><span class="p">:</span>

<span class="n">cp2k_info</span> <span class="o">=</span> <span class="n">regrep</span><span class="p">(</span>
<span class="n">filename</span><span class="o">=</span><span class="n">filename</span><span class="p">,</span>
<span class="n">patterns</span><span class="o">=</span><span class="p">{</span><span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="n">CP2K_INFO_VERSION_PATTERN</span><span class="p">},</span>
<span class="n">filename</span><span class="o">=</span><span class="n">filename</span><span class="p">,</span>
<span class="n">patterns</span><span class="o">=</span><span class="p">{</span><span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="n">CP2K_INFO_VERSION_PATTERN</span><span class="p">},</span>
<span class="n">terminate_on_match</span><span class="o">=</span><span class="kc">True</span>
<span class="p">)</span>

Expand All @@ -421,10 +421,10 @@ <h1>Source code for cp2kdata.block_parser.header_info</h1><div class="highlight"

<div class="viewcode-block" id="parse_global_info"><a class="viewcode-back" href="../../../_api/cp2kdata.block_parser.header_info.html#cp2kdata.block_parser.header_info.parse_global_info">[docs]</a><span class="k">def</span> <span class="nf">parse_global_info</span><span class="p">(</span><span class="n">filename</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">GlobalInfo</span><span class="p">:</span>
<span class="n">global_info</span> <span class="o">=</span> <span class="p">{}</span>

<span class="n">global_info</span> <span class="o">=</span> <span class="n">regrep</span><span class="p">(</span>
<span class="n">filename</span><span class="o">=</span><span class="n">filename</span><span class="p">,</span>
<span class="n">patterns</span><span class="o">=</span><span class="p">{</span><span class="s2">&quot;run_type&quot;</span><span class="p">:</span> <span class="n">GLOBAL_INFO_RUN_TYPE_PATTERN</span><span class="p">,</span>
<span class="n">filename</span><span class="o">=</span><span class="n">filename</span><span class="p">,</span>
<span class="n">patterns</span><span class="o">=</span><span class="p">{</span><span class="s2">&quot;run_type&quot;</span><span class="p">:</span> <span class="n">GLOBAL_INFO_RUN_TYPE_PATTERN</span><span class="p">,</span>
<span class="s2">&quot;print_level&quot;</span><span class="p">:</span> <span class="n">GLOBAL_INFO_PRINT_LEVEL_PATTERN</span>
<span class="p">},</span>
<span class="n">terminate_on_match</span><span class="o">=</span><span class="kc">True</span>
Expand Down Expand Up @@ -457,16 +457,16 @@ <h1>Source code for cp2kdata.block_parser.header_info</h1><div class="highlight"

<div class="viewcode-block" id="parse_dft_info"><a class="viewcode-back" href="../../../_api/cp2kdata.block_parser.header_info.html#cp2kdata.block_parser.header_info.parse_dft_info">[docs]</a><span class="k">def</span> <span class="nf">parse_dft_info</span><span class="p">(</span><span class="n">filename</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">DFTInfo</span><span class="p">:</span>
<span class="n">dft_info</span> <span class="o">=</span> <span class="p">{}</span>

<span class="n">dft_info</span> <span class="o">=</span> <span class="n">regrep</span><span class="p">(</span>
<span class="n">filename</span><span class="o">=</span><span class="n">filename</span><span class="p">,</span>
<span class="n">filename</span><span class="o">=</span><span class="n">filename</span><span class="p">,</span>
<span class="n">patterns</span><span class="o">=</span><span class="p">{</span>
<span class="s2">&quot;ks_type&quot;</span><span class="p">:</span> <span class="n">DFT_INFO_KS_TYPE_PATTERN</span><span class="p">,</span>
<span class="s2">&quot;multiplicity&quot;</span><span class="p">:</span> <span class="n">DFT_INFO_MULTIPLICITY_PATTERN</span>
<span class="p">},</span>
<span class="n">terminate_on_match</span><span class="o">=</span><span class="kc">True</span>
<span class="p">)</span>

<span class="k">if</span> <span class="n">dft_info</span><span class="p">:</span>
<span class="k">return</span> <span class="n">DFTInfo</span><span class="p">(</span><span class="n">ks_type</span><span class="o">=</span><span class="n">dft_info</span><span class="p">[</span><span class="s2">&quot;ks_type&quot;</span><span class="p">][</span><span class="mi">0</span><span class="p">][</span><span class="mi">0</span><span class="p">][</span><span class="mi">0</span><span class="p">],</span> <span class="n">multiplicity</span><span class="o">=</span><span class="n">dft_info</span><span class="p">[</span><span class="s2">&quot;multiplicity&quot;</span><span class="p">][</span><span class="mi">0</span><span class="p">][</span><span class="mi">0</span><span class="p">][</span><span class="mi">0</span><span class="p">])</span>
<span class="k">else</span><span class="p">:</span>
Expand All @@ -487,12 +487,12 @@ <h1>Source code for cp2kdata.block_parser.header_info</h1><div class="highlight"

<div class="viewcode-block" id="parse_md_info"><a class="viewcode-back" href="../../../_api/cp2kdata.block_parser.header_info.html#cp2kdata.block_parser.header_info.parse_md_info">[docs]</a><span class="k">def</span> <span class="nf">parse_md_info</span><span class="p">(</span><span class="n">filename</span><span class="p">):</span>
<span class="n">md_info</span> <span class="o">=</span> <span class="p">{}</span>

<span class="n">md_info</span> <span class="o">=</span> <span class="n">regrep</span><span class="p">(</span>
<span class="n">filename</span><span class="o">=</span><span class="n">filename</span><span class="p">,</span>
<span class="n">filename</span><span class="o">=</span><span class="n">filename</span><span class="p">,</span>
<span class="n">patterns</span><span class="o">=</span><span class="p">{</span>
<span class="s2">&quot;ensemble_type&quot;</span><span class="p">:</span> <span class="n">MD_INFO_ENSEMBLE_TYPE_PATTERN</span>
<span class="p">},</span>
<span class="p">},</span>
<span class="n">terminate_on_match</span><span class="o">=</span><span class="kc">True</span>
<span class="p">)</span>

Expand Down
Loading

0 comments on commit a166573

Please sign in to comment.