Skip to content

Commit 5609ac1

Browse files
committed
additional rearranging and clarifications
1 parent 72ed72b commit 5609ac1

1 file changed

Lines changed: 14 additions & 15 deletions

File tree

AGENTS.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Read the ``README.rst`` for an overview of libEnsemble.
55

66
- libEnsemble uses a manager-worker architecture. Points are generated by a generator and sent to a worker, which runs a simulator.
77
- The manager determines how and when points get passed to workers via an allocation function.
8+
- See ``libensemble/tests/regression_tests/test_1d_sampling.py`` for a simple example of the libEnsemble interface.
89

910
Repository Layout
1011
-----------------
@@ -28,7 +29,7 @@ Repository Layout
2829
- ``generators.py`` - Base classes for generators that adhere to the `gest-api` standard.
2930
- ``history.py`` - Module for recording points that have been generated and simulation results. NumPy array.
3031
- ``libE.py`` - libE main file. Previous primary interface for parameterizing and running libEnsemble.
31-
- ``logger.py`` - Logging configuration
32+
- ``logger.py`` - Logging configuration.
3233
- ``manager.py`` - Module for maintaining the history array and passing points between the workers.
3334
- ``message_numbers.py`` - Constants that represent states of the ensemble.
3435
- ``specs.py`` - Dataclasses for parameterizing the ensemble. Most importantly, contains ``LibeSpecs, SimSpecs, GenSpecs``.
@@ -44,53 +45,51 @@ Repository Layout
4445

4546
Other files in the root directory should be self-documenting.
4647

47-
Familiarize yourself with ``libensemble/tests/regression_tests/test_1d_sampling.py`` for a simple example of the libEnsemble interface.
48-
4948
Information about Generators
5049
----------------------------
5150

5251
- Generators are functions or objects that produce points for simulations.
53-
- The History array is a numpy structured array that stores points that have been generated and simulation results. Its fields match ``sim_specs/gen_specs["out"]`` or ``vocs`` attributes.
54-
- Prior to libEnsemble v1.6.0, generators were plain functions. They often ran in "persistent" mode, meaning they executed in a long-running loop, sending and receiving points to and from the manager until the ensemble was complete.
52+
- The History array is a NumPy structured array that stores points that have been generated and simulation results.
53+
Its fields match ``sim_specs/gen_specs["out"]`` or ``vocs`` attributes, plus additional reserved fields for metadata.
54+
- Prior to libEnsemble v1.6.0, generators were plain functions. They often ran in "persistent" mode, meaning they executed in a
55+
long-running loop, sending and receiving points to and from the manager until the ensemble was complete.
5556
- A ``gest-api`` or "standardized" generator is a class that at a minimum implements ``suggest`` and ``ingest`` methods, and is parameterized by a ``vocs``.
5657
- See ``libensemble/generators.py`` for more information about the ``gest-api`` standard.
58+
- If using a generator that adheres to the ``gest-api`` standard, or a classic persistent generator, use the ``start_only_persistent`` allocation function.
59+
- Generators are often used for simple sampling, optimization, calibration, uncertainty quantification, and other simulation-based tasks.
5760

5861
General Guidelines
5962
------------------
6063

6164
- If using classic ``sim_specs`` and ``gen_specs``, then ensure that ``sim_specs["out"]`` and ``gen_specs["in"]`` field names match, and vice-versa.
6265
- As-of libEnsemble v1.6.0, ``SimSpecs`` and ``GenSpecs`` can also be parameterized by a ``vocs`` object, imported from ``gest_api.vocs`` (NOT xopt.vocs).
63-
- ``VOCS`` contains variables, objectives, constraints, and other settings that define the problem. See ``libensemble/tests/regression_tests/test_xopt_EI.py`` for an example of how to use it.
64-
- If using a generator that adheres to the ``gest-api`` standard, or a classic persistent generator, use the ``start_only_persistent`` allocation function.
66+
- ``VOCS`` contains variables, objectives, constraints, and other settings that define the problem.
67+
See ``libensemble/tests/regression_tests/test_xopt_EI.py`` for an example of how to use it.
6568
- An MPI distribution is not required for libEnsemble to run, but is required to use the ``MPIExecutor``. ``mpich`` is recommended.
6669
- New tests are heavily encouraged for new features, bug fixes, or integrations. See ``libensemble/tests/regression_tests`` for examples.
6770
- Never use destructive git commands unless explicitly requested.
6871
- Code is in the ``black`` style. This should be enforced by ``pre-commit``.
6972
- When writing new code, prefer the ``LibeSpecs``, ``SimSpecs``, and ``GenSpecs`` dataclasses over the classic ``sim_specs`` and ``gen_specs`` bare dictionaries.
7073
- Read ``CONTRIBUTING.md`` for more information.
74+
- The external ``libE-community-examples`` repository contains past use-cases, generators, and other examples.
7175

7276
Development Environment
7377
-----------------------
7478

7579
- ``pixi`` is the recommended environment manager for libEnsemble development. See ``pyproject.toml`` for the list
7680
of dependencies and the available testing environments.
77-
7881
- Enter the development environment with ``pixi shell -e dev``. This environment contains the most common dependencies for development and testing.
7982
- For one-off commands, use ``pixi run -e dev``. This will run a single command in the development environment.
80-
81-
- If ``pixi`` is not available or not preferred by the user, ``pip`` can be used instead, but the user will need to manually install other dependencies.
82-
83+
- If ``pixi`` is not available or not preferred by the user, ``pip install -e .`` can be used instead. Other dependencies may need to be installed manually.
8384
- If committing, use ``pre-commit`` to ensure that code style and formatting are consistent. See ``.pre-commit-config.yaml`` for
8485
the configuration and ``pyproject.toml`` for other configuration.
8586

8687
Testing
8788
-------
8889

8990
- Run tests with the ``run-tests.py`` script: ``python libensemble/tests/run-tests.py``. See ``libensemble/tests/run-tests.py`` for usage information.
90-
91-
- Some tests require third party software to be installed. When developing a feature or fixing a bug the entire test suite may not necessarily need to be run,
92-
since it will be on Github Actions.
93-
91+
- Some tests require third party software to be installed. When developing a feature or fixing a bug, since the entire test suite will be run on Github Actions,
92+
for local development running individual tests is sufficient.
9493
- Individual unit tests can be run with ``pixi run -e dev pytest path/to/test_file``.
9594
- A libEnsemble run typically outputs an ``ensemble.log`` and ``libE_stats.txt`` file in the working directory. Check these files for tracebacks or run statistics.
9695
- An "ensemble" or "workflow" directory may also be created, often containing per-simulation output directories

0 commit comments

Comments
 (0)