Commit 06721060 authored by Malthe Kjær Bisbo's avatar Malthe Kjær Bisbo
Browse files

modified moduse structure, added test of imports and changed documentation...

modified moduse structure, added test of imports and changed documentation accordingly as some import statements have changed as a result
parent 752fd85b
No preview for this file type
from gofee import GOFEE
__all__ = ['GOFEE']
\ No newline at end of file
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd $DIR/surrogate/prior
cd $DIR/gofee/surrogate/prior
rm *.c *.o
python3 setup.py clean
python3 setup.py build_ext --inplace --force
cd $DIR/surrogate/descriptor
cd $DIR/gofee/surrogate/descriptor
rm *.c *.o
python3 setup.py clean
python3 setup.py build_ext --inplace --force
\ No newline at end of file
No preview for this file type
......@@ -19,7 +19,7 @@ the search. In addition it can be used to generate new candidates during
the search, if it is included as an operation in the
:class:`CandidateGenerator`.
.. autoclass:: candidate_operations.candidate_generation.StartGenerator
.. autoclass:: gofee.candidates.StartGenerator
:exclude-members:
CandidateGenerator
......@@ -28,7 +28,7 @@ The :class:`CandidateGenerator` is used in each iteration in the GOFEE search
to generate new candidates based on a list on operations to use. Possible
operation can be found below under the "Mutations" section.
.. autoclass:: candidate_operations.candidate_generation.CandidateGenerator
.. autoclass:: gofee.candidates.CandidateGenerator
:members: get_new_candidate
......@@ -42,17 +42,17 @@ The mutations to chose from are listed below.
RattleMutation
--------------
.. autoclass:: candidate_operations.basic_mutations.RattleMutation
.. autoclass:: gofee.candidates.RattleMutation
:exclude-members:
RattleMutation2
---------------
.. autoclass:: candidate_operations.basic_mutations.RattleMutation2
.. autoclass:: gofee.candidates.RattleMutation2
:exclude-members:
PermutationMutation
-------------------
.. autoclass:: candidate_operations.basic_mutations.PermutationMutation
.. autoclass:: gofee.candidates.PermutationMutation
:exclude-members:
\ No newline at end of file
No preview for this file type
......@@ -168,7 +168,7 @@ defining the system, must always be set.
In addition it is recomended to also set the <code class="docutils literal notranslate"><span class="pre">candidate_generatior</span></code>.</p>
<dl class="class">
<dt id="gofee.GOFEE">
<em class="property">class </em><code class="sig-prename descclassname">gofee.</code><code class="sig-name descname">GOFEE</code><span class="sig-paren">(</span><em class="sig-param">structures=None</em>, <em class="sig-param">calc=None</em>, <em class="sig-param">gpr=None</em>, <em class="sig-param">startgenerator=None</em>, <em class="sig-param">candidate_generator=None</em>, <em class="sig-param">trajectory='structures.traj'</em>, <em class="sig-param">kappa=2</em>, <em class="sig-param">max_steps=200</em>, <em class="sig-param">Ninit=10</em>, <em class="sig-param">max_relax_dist=4</em>, <em class="sig-param">Ncandidates=30</em>, <em class="sig-param">population_size=10</em>, <em class="sig-param">dualpoint=True</em>, <em class="sig-param">min_certainty=0.7</em>, <em class="sig-param">restart='restart.pickl'</em><span class="sig-paren">)</span><a class="headerlink" href="#gofee.GOFEE" title="Permalink to this definition"></a></dt>
<em class="property">class </em><code class="sig-prename descclassname">gofee.</code><code class="sig-name descname">GOFEE</code><span class="sig-paren">(</span><em class="sig-param">structures=None</em>, <em class="sig-param">calc=None</em>, <em class="sig-param">gpr=None</em>, <em class="sig-param">startgenerator=None</em>, <em class="sig-param">candidate_generator=None</em>, <em class="sig-param">kappa=2</em>, <em class="sig-param">max_steps=200</em>, <em class="sig-param">Ninit=10</em>, <em class="sig-param">max_relax_dist=4</em>, <em class="sig-param">Ncandidates=30</em>, <em class="sig-param">population_size=10</em>, <em class="sig-param">dualpoint=True</em>, <em class="sig-param">min_certainty=0.7</em>, <em class="sig-param">position_constraint=None</em>, <em class="sig-param">trajectory='structures.traj'</em>, <em class="sig-param">logfile='search.log'</em>, <em class="sig-param">restart='restart.pickl'</em><span class="sig-paren">)</span><a class="headerlink" href="#gofee.GOFEE" title="Permalink to this definition"></a></dt>
<dd><p>GOFEE global structure search method.</p>
<p>Parameters:</p>
<dl class="simple">
......@@ -195,6 +195,9 @@ structures. Must be supplied if structures if structues=None.
<dt>trajectory: str</dt><dd><p>Name of trajectory to which all structures,
evaluated during the search, is saved.</p>
</dd>
<dt>logfile: file object or str</dt><dd><p>If <em>logfile</em> is a string, a file with that name will be opened.
Use ‘-‘ for stdout.</p>
</dd>
<dt>kappa: float</dt><dd><p>How much to weigh predicted uncertainty in the acquisition
function.</p>
</dd>
......@@ -219,6 +222,10 @@ surrogate-relaxed in each search iteration.</p>
considdered for evaluation. (in units of the maximum possible
uncertainty.)</p>
</dd>
<dt>position_constraint: OperationConstraint object</dt><dd><p>Enforces constraints on the positions of the “free” atoms
in the search. The constraint is enforces both during
mutation/crossover operations and during surrogate-relaxation.</p>
</dd>
<dt>restart: str</dt><dd><p>Filename for restart file.</p>
</dd>
</dl>
......@@ -237,8 +244,8 @@ the search. In addition it can be used to generate new candidates during
the search, if it is included as an operation in the
<code class="xref py py-class docutils literal notranslate"><span class="pre">CandidateGenerator</span></code>.</p>
<dl class="class">
<dt id="candidate_operations.candidate_generation.StartGenerator">
<em class="property">class </em><code class="sig-prename descclassname">candidate_operations.candidate_generation.</code><code class="sig-name descname">StartGenerator</code><span class="sig-paren">(</span><em class="sig-param">slab</em>, <em class="sig-param">stoichiometry</em>, <em class="sig-param">box_to_place_in</em>, <em class="sig-param">cluster=False</em>, <em class="sig-param">description='StartGenerator'</em>, <em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#candidate_operations.candidate_generation.StartGenerator" title="Permalink to this definition"></a></dt>
<dt id="gofee.candidates.StartGenerator">
<em class="property">class </em><code class="sig-prename descclassname">gofee.candidates.</code><code class="sig-name descname">StartGenerator</code><span class="sig-paren">(</span><em class="sig-param">slab</em>, <em class="sig-param">stoichiometry</em>, <em class="sig-param">box_to_place_in</em>, <em class="sig-param">cluster=False</em>, <em class="sig-param">description='StartGenerator'</em>, <em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#gofee.candidates.StartGenerator" title="Permalink to this definition"></a></dt>
<dd><p>Class used to generate random initial candidates.</p>
<p>Generates new candidates by iteratively adding
one atom at a time within a user-defined box.</p>
......@@ -277,8 +284,8 @@ False the atoms in the slab are also included.</p>
to generate new candidates based on a list on operations to use. Possible
operation can be found below under the “Mutations” section.</p>
<dl class="class">
<dt id="candidate_operations.candidate_generation.CandidateGenerator">
<em class="property">class </em><code class="sig-prename descclassname">candidate_operations.candidate_generation.</code><code class="sig-name descname">CandidateGenerator</code><span class="sig-paren">(</span><em class="sig-param">probabilities</em>, <em class="sig-param">operations</em><span class="sig-paren">)</span><a class="headerlink" href="#candidate_operations.candidate_generation.CandidateGenerator" title="Permalink to this definition"></a></dt>
<dt id="gofee.candidates.CandidateGenerator">
<em class="property">class </em><code class="sig-prename descclassname">gofee.candidates.</code><code class="sig-name descname">CandidateGenerator</code><span class="sig-paren">(</span><em class="sig-param">probabilities</em>, <em class="sig-param">operations</em><span class="sig-paren">)</span><a class="headerlink" href="#gofee.candidates.CandidateGenerator" title="Permalink to this definition"></a></dt>
<dd><p>Class to produce new candidates by applying one of the
candidate generation operations which is supplied in the
‘operations’-list. The operations are drawn randomly according
......@@ -295,8 +302,8 @@ in operations. Must have the same dimensions as operations.</p>
</dd>
</dl>
<dl class="method">
<dt id="candidate_operations.candidate_generation.CandidateGenerator.get_new_candidate">
<code class="sig-name descname">get_new_candidate</code><span class="sig-paren">(</span><em class="sig-param">parents</em><span class="sig-paren">)</span><a class="headerlink" href="#candidate_operations.candidate_generation.CandidateGenerator.get_new_candidate" title="Permalink to this definition"></a></dt>
<dt id="gofee.candidates.CandidateGenerator.get_new_candidate">
<code class="sig-name descname">get_new_candidate</code><span class="sig-paren">(</span><em class="sig-param">parents</em><span class="sig-paren">)</span><a class="headerlink" href="#gofee.candidates.CandidateGenerator.get_new_candidate" title="Permalink to this definition"></a></dt>
<dd><p>Generate new candidate by applying a randomly drawn
operation on the structures. This is done successively for
each list of operations, if multiple are present.</p>
......@@ -311,8 +318,8 @@ each list of operations, if multiple are present.</p>
<div class="section" id="rattlemutation">
<h3>RattleMutation<a class="headerlink" href="#rattlemutation" title="Permalink to this headline"></a></h3>
<dl class="class">
<dt id="candidate_operations.basic_mutations.RattleMutation">
<em class="property">class </em><code class="sig-prename descclassname">candidate_operations.basic_mutations.</code><code class="sig-name descname">RattleMutation</code><span class="sig-paren">(</span><em class="sig-param">n_top</em>, <em class="sig-param">Nrattle=3</em>, <em class="sig-param">rattle_range=3</em>, <em class="sig-param">description='RattleMutation'</em>, <em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#candidate_operations.basic_mutations.RattleMutation" title="Permalink to this definition"></a></dt>
<dt id="gofee.candidates.RattleMutation">
<em class="property">class </em><code class="sig-prename descclassname">gofee.candidates.</code><code class="sig-name descname">RattleMutation</code><span class="sig-paren">(</span><em class="sig-param">n_top</em>, <em class="sig-param">Nrattle=3</em>, <em class="sig-param">rattle_range=3</em>, <em class="sig-param">description='RattleMutation'</em>, <em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#gofee.candidates.RattleMutation" title="Permalink to this definition"></a></dt>
<dd><p>Class to perform rattle mutations on structures.</p>
<p>Rattles a number of randomly selected atoms within a sphere
of radius ‘rattle_range’ of their original positions.</p>
......@@ -344,8 +351,8 @@ info-dict of structures, on which the operation is applied.</p>
<div class="section" id="rattlemutation2">
<h3>RattleMutation2<a class="headerlink" href="#rattlemutation2" title="Permalink to this headline"></a></h3>
<dl class="class">
<dt id="candidate_operations.basic_mutations.RattleMutation2">
<em class="property">class </em><code class="sig-prename descclassname">candidate_operations.basic_mutations.</code><code class="sig-name descname">RattleMutation2</code><span class="sig-paren">(</span><em class="sig-param">n_top</em>, <em class="sig-param">Nrattle=3</em>, <em class="sig-param">description='RattleMutation'</em>, <em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#candidate_operations.basic_mutations.RattleMutation2" title="Permalink to this definition"></a></dt>
<dt id="gofee.candidates.RattleMutation2">
<em class="property">class </em><code class="sig-prename descclassname">gofee.candidates.</code><code class="sig-name descname">RattleMutation2</code><span class="sig-paren">(</span><em class="sig-param">n_top</em>, <em class="sig-param">Nrattle=3</em>, <em class="sig-param">description='RattleMutation'</em>, <em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#gofee.candidates.RattleMutation2" title="Permalink to this definition"></a></dt>
<dd><p>Class to perform rattle mutations on structures.</p>
<p>Rattles a number of randomly selected atom to the visinity
of other candomly selected atoms random atom.</p>
......@@ -373,8 +380,8 @@ info-dict of structures, on which the operation is applied.</p>
<div class="section" id="permutationmutation">
<h3>PermutationMutation<a class="headerlink" href="#permutationmutation" title="Permalink to this headline"></a></h3>
<dl class="class">
<dt id="candidate_operations.basic_mutations.PermutationMutation">
<em class="property">class </em><code class="sig-prename descclassname">candidate_operations.basic_mutations.</code><code class="sig-name descname">PermutationMutation</code><span class="sig-paren">(</span><em class="sig-param">n_top</em>, <em class="sig-param">Npermute=3</em>, <em class="sig-param">description='PermutationMutation'</em>, <em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#candidate_operations.basic_mutations.PermutationMutation" title="Permalink to this definition"></a></dt>
<dt id="gofee.candidates.PermutationMutation">
<em class="property">class </em><code class="sig-prename descclassname">gofee.candidates.</code><code class="sig-name descname">PermutationMutation</code><span class="sig-paren">(</span><em class="sig-param">n_top</em>, <em class="sig-param">Npermute=3</em>, <em class="sig-param">description='PermutationMutation'</em>, <em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#gofee.candidates.PermutationMutation" title="Permalink to this definition"></a></dt>
<dd><p>Class to perform permutation mutations on structures.</p>
<p>Swaps the positions of a number of pairs of unlike atoms.</p>
<p>Parameters:</p>
......
......@@ -174,7 +174,7 @@ source &lt;python stuff&gt;
source &lt;GPAW stuff&gt;
source &lt;DFTB stuff&gt; # if running DFTB
mpiexec --mca mpi_warn_on_fork 0 gpaw-python run_search.py &gt; search.log
mpiexec --mca mpi_warn_on_fork 0 gpaw-python run_search.py
echo &quot;========= Job finished at `date` ==========&quot;
</pre></div>
</div>
......
......@@ -3,8 +3,8 @@ import numpy as np
from ase.calculators.dftb import Dftb
from ase.io import read
from candidate_operations.candidate_generation import CandidateGenerator, StartGenerator
from candidate_operations.basic_mutations import RattleMutation, PermutationMutation
from gofee.candidates import CandidateGenerator, StartGenerator
from gofee.candidates import RattleMutation, PermutationMutation
from gofee import GOFEE
### Define calculator ###
......
......@@ -4,8 +4,7 @@ import numpy as np
from ase import Atoms
from ase.calculators.dftb import Dftb
from candidate_operations.candidate_generation import CandidateGenerator, StartGenerator
from candidate_operations.basic_mutations import RattleMutation
from gofee.candidates import CandidateGenerator, StartGenerator, RattleMutation
from gofee import GOFEE
### Define calculator ###
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment