Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.
Merged
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
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,20 @@
Any PR that merged into master branch of this repo will trigger an auto-deployment to the [Badger homepage](https://xopt-org.github.io/Badger/).

This repo could be merged into [Badger core repo](https://github.com/xopt-org/Badger) soon.

### Notes on creating highlighted images

When making an image that highlights a particular portion of the GUI, this process was used for most images:

1. Load the base image in GIMP - usually `static/img/gui/run_1.png`.
2. Make a rectangular selection around the UI element with antialiasing enabled and rounded corners set to 6px.
3. Invert the selection. (Select -> Invert)
4. Set saturation to 0.25. (Colors -> Saturation...)
5. Invert the selection. (Select -> Invert)
6. Create a stroke from the selection. (Edit -> Stroke Selection...)
- Use Line mode.
- Set the color to `#f83232`.
- Enable antialiasing.
- Set width to 6px.
- Use "Round" join style.
7. If adding numbers to denote different parts of the image, use Noto Sans Regular font. A size of 72px was used for most images.
4 changes: 4 additions & 0 deletions docs/extensions/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Extensions",
"position": 4
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
sidebar_position: 6
sidebar_position: 1
---

# BO Visualization Extension Documentation
# BO Visualization

## Overview

Expand Down
49 changes: 49 additions & 0 deletions docs/getting-started/configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
sidebar_position: 2
---

# Configuration

## Property List

#### Plugin Root

The location of custom environments and interfaces.

#### Templates Root

The location where templates for new runs are stored.

#### Logbook Root

The location where Badger run logs are stored. In some environments (e.g. LCLS/LCLS-II) these logs are added to the machine elog.

#### Archive Root

The location where old runs are archived. Runs stored here will appear in the History Navigator panel in the GUI.

---

## CLI

If you would like to change some setting that you configured after `badger` has been run for the first time, you can do so with `badger config`.

To list all the configuration properties:

```bash
badger config
```

To set a property:

```bash
badger config KEY
```

Where `KEY` is one of the keys in the configuration property list.

## GUI

The GUI includes a configuration panel as well, which may be more straightforward to use. Note that if some of these configuration properties are missing, the GUI will not launch, and you will need to set the missing property through the CLI interface.

![Badger GUI settings popup](/img/gui/settings.png)
4 changes: 0 additions & 4 deletions docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ sidebar_position: 1

Badger is essentially a python package. It's recommended to install and test it in a separate [python virtual environment](https://docs.python.org/3/library/venv.html) before using it in a production env.

## Requirements

- Python version >= 3.9. Python 3.11+ is recommended

## Install the Badger package

Badger has a core package (`badger-opt`) that can be extended by a set of plugins. Badger core package is available on both [pip](https://pypi.org/project/badger-opt/) and [conda](https://anaconda.org/conda-forge/badger-opt). So you could install Badger with:
Expand Down
14 changes: 8 additions & 6 deletions docs/getting-started/tutorial_0.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
sidebar_position: 2
sidebar_position: 3
---

# Tutorial (GUI mode)
# Tutorial

:::note Heads-up

Expand Down Expand Up @@ -42,7 +42,9 @@ Run the following command in your terminal to launch the Badger GUI (assume you
badger -g
```

You should be able to see the main GUI like below:
Badger will ask if this is your first time using it. Either type a `y` and press Enter, or simply press Enter to fill out the default configuration values.

When it finishes writing the default config, you should be able to see the main GUI like below:

![Badger GUI](/img/gui/blank.png)

Expand All @@ -62,11 +64,11 @@ Congrats! You just run your very first routine in Badger!

Now it's time to do some more serious stuff -- such as performing optimization on your own optimization problem. In order to do that, we need to create our own custom environment (and optionally, the corresponding interface).

First let's point Badger to a new folder where we would like to store our custom plugins, if necessary. At the bottom right of the Badger GUI window is a settings cog. When clicked it will open a popup to configure the Badger plugin root, logbook root, and archive root. The default folders should be reasonable, but these can be changed to suit your needs, if the defaults are difficult to access.
First let's point Badger to a new folder where we would like to store our custom plugins, if necessary. At the bottom right of the Badger GUI window is a settings cog. When clicked it will open a popup to configure the Badger plugin root, logbook root, and archive root. The default folders should be reasonable, but these can be changed to suit your needs, if the defaults are difficult to access. See [the configuration page](configuration) for more information.

![Badger GUI settings popup](/img/gui/settings.png)

Create a folder named `sphere_3d` in the environments folder beneath the plugin root. Then create the following files inside that `sphere_3d` folder:
In this example, we will be making an extension of the sphere_2d problem in 3 dimensions. Create a folder named `sphere_3d` in the environments folder beneath the plugin root. Then create the following files inside that `sphere_3d` folder:

- The main python script:

Expand Down Expand Up @@ -149,6 +151,6 @@ Press *Run* and stop whenever you feel right, you should see some optimization c

![Badger GUI after the second run](/img/gui/run_2.png)

Congrats! You have accomplished the Badger GUI tutorial! Hope that by this point you already have some feelings about what Badger is and how Badger works. Now you can continue and do the [CLI tutorial](tutorial_1) to get to know the other side of Badger, or you can jump directly to the [guides](../guides/create-a-plugin#create-an-environment-plugin) to adapt Badger to your own optimization problem, good luck!
Congrats! You have accomplished the Badger GUI tutorial! Hope that by this point you already have some feelings about what Badger is and how Badger works. You can continue to the guides to adapt Badger to your own optimization problem! Please reach out to the official mailing list or Slack channel by following the links in the footer if you have any questions or need advice. If you encounter a bug please make an issue on the [Badger GitHub repository](https://github.com/xopt-org/Badger). Good luck!

[^generator]: Term in Xopt, means algorithm
248 changes: 0 additions & 248 deletions docs/getting-started/tutorial_1.md

This file was deleted.

Loading