Skip to content
New issue

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

[WIP] Docs/asktell #1428

Draft
wants to merge 4 commits into
base: experimental/jlnav_plus_shuds_asktell
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/advanced_installation.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Advanced Installation
=====================

libEnsemble can be installed from ``pip``, ``Conda``, or ``Spack``.
libEnsemble can be installed from ``pip``, ``conda``, or ``Spack``.

libEnsemble requires the following dependencies, which are typically
automatically installed alongside libEnsemble:

* Python_ ``>= 3.9``
* NumPy_ ``>= 1.21``
* psutil_ ``>= 5.9.4``
* `pydantic`_ ``<= 1.10.12``
* `pydantic`_ ``>= 1.10.17``
* pyyaml_ ``>= v6.0``
* tomli_ ``>= 1.2.1``

Expand Down
3 changes: 3 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ def __getattr__(cls, name):


MOCK_MODULES = [
"ax",
"argparse",
"dfols",
"gpcam",
"IPython",
"IPython.display",
"IPython.core",
Expand Down Expand Up @@ -71,6 +73,7 @@ def __getattr__(cls, name):
##sys.path.append(os.path.abspath('../libensemble'))
sys.path.append(os.path.abspath("../libensemble/alloc_funcs"))
sys.path.append(os.path.abspath("../libensemble/gen_funcs"))
sys.path.append(os.path.abspath("../libensemble/gen_classes"))
sys.path.append(os.path.abspath("../libensemble/sim_funcs"))
sys.path.append(os.path.abspath("../libensemble/comms"))
sys.path.append(os.path.abspath("../libensemble/utils"))
Expand Down
17 changes: 17 additions & 0 deletions docs/examples/asktell/aposmm.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
APOSMM
------

Asynchronously Parallel Optimization Solver for finding Multiple Minima
(APOSMM) coordinates concurrent local optimization runs in order to identify
many local minima.

This version has been created to adhere to the CAMPA
generator standard: https://github.com/campa-consortium/generator_standard
and *can be used outside of libEnsemble*.

See :doc:`the APOSMM docs<../aposmm>` for implementation, configuration, and more information.

.. automodule:: gen_classes.aposmm
:members:
:undoc-members:
:inherited-members:
8 changes: 8 additions & 0 deletions docs/examples/asktell/gpCAM.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
gpCAM
-----

.. automodule:: gen_classes.gpCAM
:members: GP_CAM, GP_CAM_Covar
:undoc-members:
:inherited-members:
:exclude-members: ask_updates
10 changes: 10 additions & 0 deletions docs/examples/asktell/sampling.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
sampling
--------

.. automodule:: gen_classes.sampling

.. autoclass:: UniformSample
:members: ask_numpy, tell_numpy

.. autoclass:: UniformSampleDicts
:members: ask, tell
6 changes: 6 additions & 0 deletions docs/examples/asktell/surmise.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Surmise
-------

.. automodule:: gen_classes.surmise
:members:
:inherited-members:
1 change: 1 addition & 0 deletions docs/examples/examples_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ the `libEnsemble Community Repository`_, with corresponding generator documentat
:maxdepth: 2
:caption: libEnsemble Example Functions:

gen_classes
gen_funcs
sim_funcs
alloc_funcs
Expand Down
33 changes: 33 additions & 0 deletions docs/examples/gen_classes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
ask/tell Generators
===================

**BETA - SUBJECT TO CHANGE**

These generators, implementations, methods, and subclasses are in BETA, and
may change in future releases.

The Generator interface is expected to roughly correspond with CAMPA's standard:
https://github.com/campa-consortium/generator_standard

.. role:: underline
:class: underline


.. dropdown:: :underline:`Generator interface`

.. automodule:: generators
:members: Generator LibensembleGenerator
:undoc-members:

.. autoclass:: Generator
:member-order: bysource
:members:

.. toctree::
:maxdepth: 2
:caption: Documented ask/tell Generators

asktell/sampling
asktell/aposmm
asktell/surmise
asktell/gpCAM
4 changes: 2 additions & 2 deletions docs/examples/gen_funcs.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Generator Functions
===================
[Legacy] Generator Functions
============================

.. include:: ../introduction.rst
:start-after: example_packages
Expand Down
2 changes: 2 additions & 0 deletions docs/function_guides/ask_tell_generator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ libEnsemble is in the process of supporting generator objects that implement the
.. automodule:: generators
:members: Generator LibensembleGenerator
:undoc-members:
:no-index:

.. autoclass:: Generator
:member-order: bysource
:members:
:no-index:
4 changes: 2 additions & 2 deletions docs/function_guides/generator.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _funcguides-gen:

Generator Functions
===================
[Legacy] Generator Functions
============================

Generator and :ref:`Simulator functions<funcguides-sim>` have relatively similar interfaces.

Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
:maxdepth: 1
:caption: Examples:

examples/gen_classes
examples/gen_funcs
examples/sim_funcs
examples/alloc_funcs
Expand Down
14 changes: 12 additions & 2 deletions libensemble/gen_classes/sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,17 @@ def _get_user_params(self, user_specs):

class UniformSample(SampleBase):
"""
This generator returns ``gen_specs["initial_batch_size"]`` uniformly

.. code-block:: python
:linenos:

import numpy as np
from libensemble.gen_classes import UniformSample

my_sampler = UniformSample(lb=np.array([0.0, 0.0]), ub=np.array([1.0, 1.0]))
sample = my_sampler.ask(5)

When used with libEnsemble, returns ``gen_specs["initial_batch_size"]`` uniformly
sampled points the first time it is called. Afterwards, it returns the
number of points given. This can be used in either a batch or asynchronous
mode by adjusting the allocation function.
Expand All @@ -49,7 +59,7 @@ def tell_numpy(self, calc_in):
# to the classes above. This is for testing a function written directly with that interface.
class UniformSampleDicts(Generator):
"""
This generator returns ``gen_specs["initial_batch_size"]`` uniformly
When used with libEnsemble, returns ``gen_specs["initial_batch_size"]`` uniformly
sampled points the first time it is called. Afterwards, it returns the
number of points given. This can be used in either a batch or asynchronous
mode by adjusting the allocation function.
Expand Down